[PATCH net-next v2 0/2] ipvlan/macvlan: fix local RX byte accounting

From: Xia Yan

Date: Wed Nov 11 2026 - 21:57:32 EST


Both ipvlan and macvlan count the Ethernet header twice for some
traffic between virtual devices sharing one lower device.

Patch 1 fixes ipvlan local unicast, broadcast and multicast RX
accounting. Patch 2 fixes macvlan bridge-mode local broadcast and
multicast RX accounting. The lower-device receive paths retain
their existing Ethernet-header adjustment.

Tested in UML on net-next 368fbf5d82da with IPv4 and IPv6 UDP
traffic: 26 ipvlan cases and 20 macvlan cases. The corrected byte
counts match the received Ethernet frame lengths. The external
RX cases and macvlan local unicast cases retain their counts.

The ipvlan fix was first submitted to net. This v2 targets net-next
and adds the macvlan fix as Eric suggested. Cc: stable is dropped.

Changes since v1:
- Target net-next and drop Cc: stable.
- Add the macvlan local broadcast and multicast accounting fix.

v1: https://lore.kernel.org/netdev/20261025014251.542973-1-yanxia@xxxxxxxxxxxxxxxxxxxx/
Review: https://lore.kernel.org/netdev/CAL4WiioxAR1ZBjVJNgYfLM0hUwyHapRu+TAUzedpOpe0yheH3w@xxxxxxxxxxxxxx/

Xia Yan (2):
ipvlan: fix RX byte accounting for local traffic
macvlan: fix RX byte accounting for local broadcast and multicast

drivers/net/ipvlan/ipvlan_core.c | 4 ++--
drivers/net/macvlan.c | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)


base-commit: 368fbf5d82da9ebce309449c74fc0b128f7d0219