🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18662

Re: [PATCH net-next v2 2/2] macvlan: fix RX byte accounting for local broadcast and multicast

#18662
From: Simon Horman
Date: Wed, 18 Nov 2026 17:43
30 lines
9052 bytes
On Thu, Nov 12, 2026 at 10:56:19AM +0800, Xia Yan wrote:
> In bridge mode, broadcast and multicast packets sent by one macvlan
> are delivered to the other bridge ports by macvlan_broadcast(),
> called from macvlan_queue_xmit(). The skb still contains its
> Ethernet header there, so adding ETH_HLEN again in the rx_bytes
> accounting overcounts by 14 bytes per packet on every receiving
> macvlan.
> 
> Packets flooded from the receive handler have had the Ethernet
> header pulled by eth_type_trans(), so they still need ETH_HLEN.
> 
> Use the existing mode argument to skip the extra ETH_HLEN for the
> local bridge-mode path.
> 
> Noticed in macvlan during review of the ipvlan fix, and confirmed
> on a 6.6 distribution kernel: five IPv4 UDP packets with 32-byte
> payloads increased rx_bytes by 440 instead of 370.
> 
> Tested before and after the change with custom IPv4 and IPv6 UDP
> tests in UML. The corrected counters match the received Ethernet
> frame lengths. Local unicast and external RX counts are unchanged
> in these tests.
> 
> Fixes: 618e1b7482f7 ("macvlan: implement bridge, VEPA and private mode")
> Signed-off-by: Xia Yan <yanxia@cmss.chinamobile.com>

I agree that net-next is an appropriate target for this change.

Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID: <20261118174343.GN860048@horms.kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366312-linux-kernel-netdev=dewy.ru
References: <20261112025619.563195-1-yanxia@cmss.chinamobile.com> <20261112025619.563195-3-yanxia@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366312-linux-kernel-netdev=dewy.ru
From: horms@kernel.org (Simon Horman)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 2/2] macvlan: fix RX byte accounting for
 local broadcast and multicast
Date: Wed, 18 Nov 2026 17:43:43 +0000
Organization: Usenet Network
Message-ID: <20261118174343.GN860048@horms.kernel.org>
References: <20261112025619.563195-1-yanxia@cmss.chinamobile.com>
 <20261112025619.563195-3-yanxia@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="2653863"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:S7OynafqbdsIT/q5ZkvZ5VBDLkc= sha256:A5yAp3IgrVK6RmIBRsFcU9ZDml9OH7FW+dpSFVrWC+0=
	sha1:pU6Il0PYvhj4gxaCOacgqC0k5Rs= sha256:4ElKxQI5qoDAviPuHxa6tZnEOAdT/fin69BqbEtWp84=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 825A7115350; Wed, 18 Nov 2026 20:44:09 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id N5kVzKnWko1w;
	Wed, 18 Nov 2026 20:44:06 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366312-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 1ECEE11534E; Wed, 18 Nov 2026 20:43:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id B6BF786C52; Wed, 18 Nov 2026 17:43:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795023829;
	b=GSuVd0w3BHnDU9UOyAvDWRwlCr17Nz4NxYeKU55WXSK1Owy5S0OK4wslU+LMIPwW9Ugv
	 H8h2yz+mwCQ05ELoP60i2v3aVdFZDOCvbi9z2BKnk61XhTpLAW/kvIZuBZgWJlgimjY9n
	 YRfKOy3mVCJ6qmC8Xqdjraf97SHSLp7bt7+SNhh+L13TkFLHPJy9rcIEOWDa04H39CDYr
	 ex2VxN/NPuR76JzjlDMMCRZYWyMonQ+4iNHMWFXp7CFHQvQNojT1cGGGArzjz7IGfXnTA
	 guehUTEckUN3af9H3Ys2YQnCVc+lyalCyKPqJrppS8gxQGB/oY62IMA5i8qgMyjzFFQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795023829;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=L/JG2kVIljtQt8JbbY2gIgeH7gzLpxrJG2728cL2kgU=;
	b=MufEHSeNAhGt4xpD/m5OcFbD6r20iWkcMOMXgGMaABsuAfYv9VHmkaEl3sBexq68n760
	 +ssjBtde8eNU+ijKG7i2yHXkw2xmoJbGORCAA6ff+ZApNDP3wEyTP7vi6SY+Tq6GCDizs
	 q684UvAkAaI4qfm4t9Q0Ot/aufGYOCttpjOUz6s2VUcDSHwur+sG8HukUHWVe9exAekxh
	 Z5yQ3XH3YHOBBDtEXk8IAivaoFnDzvi2oO1cIA0QCZWWqVFVMSNTnPUCtSY24W1n6y0H2
	 z2JVjmznUkAGCdozLmImmMFgkqiHebY2pK7l0PQPGMRMfP4t5VOn9DSESL2Ud1xQmPQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ln93A87G;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 383D5606A339;
	Wed, 18 Nov 2026 17:43:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ln93A87G
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795023828;
	b=TbubwfchgnpYiupwVA9xn7ODUOVlt7sZ8GfQPNA/R2Q05e2vASgXDfEA4Uj3IuJjRyCo
	 nHQ2ZykoqE2VH8k3tGdrCogwSl0BTwBy9rbnY8wEvqSFaI2Pl3IEd1VDEYira/utAaCVK
	 HjD03Y1stu4tTQktN01PTIOqTDeBsIWbq59nEUdbDgFVGgYR+YVK1MEtxNrlWpQrWgyrC
	 dDWnexOSSJIOFaZvYxCfV0WDUbrROzIXFgie7RsVmyfKO9deF1ttLSkW2KfTvdkqAgQ6c
	 Onq8CTUyoa3g0Qrpj5Yh63ZwFCvCxvDsUC0xePOvTHYv6iCI8njOT2nXG5bWko8rgSw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795023828;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=L/JG2kVIljtQt8JbbY2gIgeH7gzLpxrJG2728cL2kgU=;
	b=AUffx9IqpNYX6h/Wlwk1onMRosOKk/zjMd2vAWqif0y+M39A+/r9HTDGQOcZA3S3qbAo
	 V16sgcauWwAQuZ66Jav8HFTIkAEK1syfnlwoyY/0R6ZtOG5JL8MCf8WtrYkBumROwpXWT
	 MfgqdNbZ48y/MFfq81z9pkEJYjG8/InK8VDprNdRSqdfbl1aebWlpJND1q44YILuFQ1be
	 YXkYYQNy7GZCUwLPhy00OVxwbYZPcw5Iu/j8lBknbMyT2ovuxfV/idGHOrSssS9fJgkTT
	 1zp602lsYU6/KXE0m2fMml7o69Ol9C2bckx4020dkuSp10VcQBVjh2EMWotNmhEHFLA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ln93A87G;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 580DD606A32A;
	Wed, 18 Nov 2026 17:43:48 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD37A1F000C4;
	Wed, 18 Nov 2026 17:43:45 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795023828;
	bh=L/JG2kVIljtQt8JbbY2gIgeH7gzLpxrJG2728cL2kgU=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=Ln93A87GjnCBTWrVNRokUdUeeCxDWSJDndnvASI9YG8Phxb2IMijf5GXzSJXR46M1
	 0jHYl/xX/GPJJybdhZgvbgKFRetIPi9xVFDIWewy1yjBp/HFEeA8tHAC8Gc78kmVfc
	 hQBtPy1lf39BvqwJSSSzm7szDRdCm9oXWVNpDqdKAr4glruJd88ctHgv/HvtT+we0v
	 v9wm7eWLDsh/TFmZVTgrF2q8tZBIte7o96P0rHbvGlRUOg30EyE2bMO+vIaW07KUi+
	 miuE2kU5fn4sgOK9VXFSQsVVEYHVUm3ELCegoChu7PR2jT3UtH877ZolVGZB17AAVO
	 pch0aU6E1qGoA==
X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	maheshb@google.com, arnd@arndb.de, kaber@trash.net,
	dskr99@gmail.com, linux-kernel@vger.kernel.org, yana06070@163.com
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261112025619.563195-3-yanxia@cmss.chinamobile.com>