mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Xia Yan" <yanxia@cmss.chinamobile.com>, Netdev <netdev@vger.kernel.org>
Cc: andrew+netdev@lunn.ch, "David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	maheshb@google.com, kaber@trash.net, dskr99@gmail.com,
	linux-kernel@vger.kernel.org, yana06070@163.com
Subject: Re: [PATCH net-next v2 2/2] macvlan: fix RX byte accounting for local broadcast and multicast
Date: Wed, 18 Nov 2026 18:48:22 +0100	[thread overview]
Message-ID: <f19edb7f-d301-4234-ae51-362620d5b61b@app.fastmail.com> (raw)
In-Reply-To: <20261112025619.563195-3-yanxia@cmss.chinamobile.com>

On Thu, Nov 12, 2026, at 03:56, 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>

Acked-by: Arnd Bergmann <arnd@arndb.de>

      parent reply	other threads:[~2026-11-18 17:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  2:56 [PATCH net-next v2 0/2] ipvlan/macvlan: fix local RX byte accounting Xia Yan
2026-11-12  2:56 ` [PATCH net-next v2 1/2] ipvlan: fix RX byte accounting for local traffic Xia Yan
2026-11-18 17:43   ` Simon Horman
2026-11-12  2:56 ` [PATCH net-next v2 2/2] macvlan: fix RX byte accounting for local broadcast and multicast Xia Yan
2026-11-18 17:43   ` Simon Horman
2026-11-18 17:48   ` Arnd Bergmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f19edb7f-d301-4234-ae51-362620d5b61b@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dskr99@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=kaber@trash.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yana06070@163.com \
    --cc=yanxia@cmss.chinamobile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®