[PATCH v2] net/hns3: fix L4 checksum incorrect for tunnel packets

fengchengwen fengchengwen at huawei.com
Sat May 9 09:18:58 CEST 2026


Reviewed-by: Chengwen Feng <fengchengwen at huawei.com>

On 5/9/2026 2:47 PM, Xingui Yang wrote:
> In HIP09 simple BD mode, the driver incorrectly calculates L4_START
> position for tunnel packets. The current implementation only uses
> l2_len + l3_len without considering outer header lengths (outer_l2_len
> and outer_l3_len), causing hardware to calculate checksum from wrong
> offset.
> 
> For a typical NvGRE tunnel packet with structure:
>   Outer Eth(14) + Outer IPv6(40) + NvGRE(8) + Inner Eth(14) +
>   Inner IPv6(40) + TCP(20)
> 
> Expected L4_START: 116 bytes (from packet start to inner TCP header)
> Actual calculation: 62 bytes (missing outer headers)
> 
> This results in incorrect TCP/UDP checksum for all tunnel packets when
> using simple BD mode, including NvGRE, VxLAN, GRE, GENEVE tunnels.
> 
> Fix by adding outer_l2_len and outer_l3_len to L4_START calculation
> when RTE_MBUF_F_TX_TUNNEL_MASK flag is set.
> 
> Fixes: 6393fc0b823c ("net/hns3: simplify hardware checksum offloading")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Xingui Yang <yangxingui at huawei.com>



More information about the dev mailing list