Re: [PATCH net-next v2 1/2] ipvlan: fix RX byte accounting for local traffic

From: Simon Horman

Date: Wed Nov 18 2026 - 12:43:39 EST


On Thu, Nov 12, 2026 at 10:56:18AM +0800, Xia Yan wrote:
> For traffic between ipvlan devices on the same lower device,
> skb->len already includes the Ethernet header. Adding ETH_HLEN
> again in ipvlan_rcv_frame() overcounts rx_bytes by 14 bytes per
> packet. ipvlan_process_multicast() does the same for local broadcast
> and multicast traffic.
>
> Packets received from the lower device have had the Ethernet header
> pulled by eth_type_trans(), so their counters still need ETH_HLEN.
>
> Use the existing local and tx_pkt flags to distinguish these paths.
>
> Found during a code review of the ipvlan receive paths.
>
> Sending five IPv4 UDP packets with 32-byte payloads between ipvlan
> devices in separate network namespaces increases rx_bytes by 440
> instead of 370. With this change the count is 370. External RX byte
> counts are unchanged in the same tests.
>
> Tested before and after the change with custom IPv4 and IPv6 UDP
> tests in UML, covering L2 unicast, broadcast and joined multicast,
> and L3 unicast.
>
> Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
> Signed-off-by: Xia Yan <yanxia@xxxxxxxxxxxxxxxxxxxx>

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

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>