linux-yocto/drivers/net/ethernet
Christoph Paasch 6a213143e0 net/mlx5: Correctly set gso_size when LRO is used
[ Upstream commit 531d0d32de ]

gso_size is expected by the networking stack to be the size of the
payload (thus, not including ethernet/IP/TCP-headers). However, cqe_bcnt
is the full sized frame (including the headers). Dividing cqe_bcnt by
lro_num_seg will then give incorrect results.

For example, running a bpftrace higher up in the TCP-stack
(tcp_event_data_recv), we commonly have gso_size set to 1450 or 1451 even
though in reality the payload was only 1448 bytes.

This can have unintended consequences:
- In tcp_measure_rcv_mss() len will be for example 1450, but. rcv_mss
will be 1448 (because tp->advmss is 1448). Thus, we will always
recompute scaling_ratio each time an LRO-packet is received.
- In tcp_gro_receive(), it will interfere with the decision whether or
not to flush and thus potentially result in less gro'ed packets.

So, we need to discount the protocol headers from cqe_bcnt so we can
actually divide the payload by lro_num_seg to get the real gso_size.

v2:
 - Use "(unsigned char *)tcp + tcp->doff * 4 - skb->data)" to compute header-len
   (Tariq Toukan <tariqt@nvidia.com>)
 - Improve commit-message (Gal Pressman <gal@nvidia.com>)

Fixes: e586b3b0ba ("net/mlx5: Ethernet Datapath files")
Signed-off-by: Christoph Paasch <cpaasch@openai.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Link: https://patch.msgid.link/20250715-cpaasch-pf-925-investigate-incorrect-gso_size-on-cx-7-nic-v2-1-e06c3475f3ac@openai.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-07-24 08:53:19 +02:00
..
3com
8390
actions
adaptec
adi net: ethernet: adi: adin1110: Fix some error handling path in adin1110_read_fifo() 2024-10-17 15:24:25 +02:00
aeroflex net: ethernet: aeroflex: fix potential memory leak in greth_start_xmit_gbit() 2024-11-01 01:58:22 +01:00
agere
alacritech
allwinner
alteon
altera
amazon net: ena: Fix redundant device NUMA node override 2024-06-12 11:12:59 +02:00
amd amd-xgbe: do not double read link status 2025-07-10 16:03:12 +02:00
apm net: xgene-v2: remove incorrect ACPI_PTR annotation 2025-06-04 14:42:04 +02:00
apple
aquantia net: atlantic: generate software timestamp just before the doorbell 2025-06-27 11:08:54 +01:00
arc net: arc: rockchip: fix emac mdio node support 2024-11-14 13:19:32 +01:00
asix
atheros ethernet: atl1: Add missing DMA mapping error checks and count errors 2025-07-10 16:03:08 +02:00
broadcom bnxt_en: Set DMA unmap len correctly for XDP_REDIRECT 2025-07-17 18:35:20 +02:00
brocade bna: adjust 'name' buf size of bna_tcb and bna_ccb structures 2024-08-03 08:53:43 +02:00
cadence net: macb: Check return value of dma_set_mask_and_coherent() 2025-06-27 11:08:52 +01:00
calxeda
cavium liquidio: Adjust a NULL pointer handling path in lio_vf_rep_copy_packet 2024-06-21 14:38:32 +02:00
chelsio cxgb4: fix memory leak in cxgb4_init_ethtool_filters() error path 2025-04-25 10:45:42 +02:00
cirrus
cisco enic: fix incorrect MTU comparison in enic_change_mtu() 2025-07-10 16:03:11 +02:00
cortina net: ethernet: cortina: Use TOE/TSO on all TCP 2025-06-27 11:08:56 +01:00
davicom net: davicom: fix UAF in dm9000_drv_remove 2025-02-08 09:52:30 +01:00
dec
dlink net: dlink: add synchronization for stats update 2025-06-27 11:08:53 +01:00
emulex emulex/benet: correct command version selection in be_cmd_get_stats() 2025-06-27 11:08:53 +01:00
engleder tsnep: fix timestamping with a stacked DSA driver 2025-05-22 14:12:18 +02:00
ezchip
faraday net: ftgmac100: select FIXED_PHY 2025-06-27 11:08:48 +01:00
freescale dpaa2-eth: fix xdp_rxq_info leak 2025-07-10 16:03:08 +02:00
fujitsu
fungible
google gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO 2025-06-19 15:28:34 +02:00
hisilicon net: hns3: defer calling ptp_clock_register() 2025-05-09 09:44:02 +02:00
huawei net: hinic: Fix cleanup in create_rxqs/txqs() 2024-12-27 13:58:48 +01:00
i825xx net/sun3_82586: fix potential memory leak in sun3_82586_send_packet() 2024-11-01 01:58:28 +01:00
ibm ibmvnic: Fix hardcoded NUM_RX_STATS/NUM_TX_STATS with dynamic sizeof 2025-07-17 18:35:19 +02:00
intel ice: add NULL check in eswitch lag check 2025-07-24 08:53:18 +02:00
litex
marvell octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer() 2025-06-27 11:08:57 +01:00
mediatek driver: net: ethernet: mtk_star_emac: fix suspend/resume issue 2025-06-19 15:28:32 +02:00
mellanox net/mlx5: Correctly set gso_size when LRO is used 2025-07-24 08:53:19 +02:00
micrel net: ks8851: Fix potential TX stall after interface reopen 2024-07-18 13:21:17 +02:00
microchip net: lan743x: fix potential out-of-bounds write in lan743x_ptp_io_event_clock_get() 2025-06-27 11:09:02 +01:00
microsoft net: mana: Record doorbell physical address in PF mode 2025-07-17 18:35:21 +02:00
moxa
mscc net: mscc: ocelot: delete PVID VLAN when readding it as non-PVID 2025-05-09 09:43:58 +02:00
myricom
natsemi
neterion
netronome nfp: bpf: Add check for nfp_app_ctrl_msg_alloc() 2025-02-27 04:10:52 -08:00
ni
nvidia
nxp
oki-semi
packetengines
pasemi
pensando ionic: Prevent driver/fw getting out of sync on devcmd(s) 2025-06-27 11:09:01 +01:00
qlogic net: qede: Initialize qede_ll_ops with designated initializer 2025-05-22 14:12:22 +02:00
qualcomm qca_spi: Make driver probing reliable 2024-12-19 18:11:30 +01:00
rdc
realtek r8169: don't scan PHY addresses > 0 2025-06-04 14:42:12 +02:00
renesas net: sh_eth: Fix missing rtnl lock in suspend/resume path 2025-02-08 09:52:32 +01:00
rocker rocker: fix link status detection in rocker_carrier_init() 2024-12-14 20:00:09 +01:00
samsung
seeq net: seeq: Fix use after free vulnerability in ether3 Driver Due to Race Condition 2024-10-04 16:29:41 +02:00
sfc net: sfc: Correct key_len for efx_tc_ct_zone_ht_params 2025-01-09 13:32:02 +01:00
sgi
silan
sis
smsc net: smc91x: Fix m68k kernel compilation for ColdFire CPU 2024-06-12 11:11:20 +02:00
socionext
stmicro net: stmmac: Fix interrupt handling for level-triggered mode in DWC_XGMAC2 2025-07-17 18:35:10 +02:00
sun nui: Fix dma_mapping_error() check 2025-07-10 16:03:12 +02:00
sunplus
synopsys
tehuti
ti net: ethernet: ti: am65-cpsw: handle -EPROBE_DEFER 2025-06-27 11:08:56 +01:00
toshiba
tundra
vertexcom net: vertexcom: mse102x: Return code for mse102x_rx_pkt_spi 2025-06-27 11:08:55 +01:00
via
wangxun net: libwx: properly reset Rx ring descriptor 2025-07-24 08:53:14 +02:00
wiznet
xilinx net: emaclite: Fix missing pointer increment in aligned_read() 2025-07-24 08:53:17 +02:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c net: ethernet: use ip_hdrlen() instead of bit shift 2024-09-18 19:24:05 +02:00
jme.h
Kconfig
korina.c
lantiq_etop.c net: ethernet: lantiq_etop: fix memory disclosure 2024-10-10 11:57:16 +02:00
lantiq_xrx200.c
Makefile