]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5e: RX, Drop oversized packets in non-linear mode
authorDragos Tatulea <dtatulea@nvidia.com>
Tue, 3 Feb 2026 07:21:29 +0000 (09:21 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 5 Feb 2026 05:16:05 +0000 (21:16 -0800)
commit7ed7a576f20a8c60bbd4335e57776f3ad5812577
tree49bb8330afa51af699d464fb7450d635877e75be
parent14eb64db8ff07b58a35b98375f446d9e20765674
net/mlx5e: RX, Drop oversized packets in non-linear mode

Currently the driver has an inconsistent behaviour between modes when it
comes to oversized packets that are not dropped through the physical MTU
check in HW. This can happen for Multi Host configurations where each
port has a different MTU.

Current behavior:

1) Striding RQ in linear mode drops the packet in SW and counts it
   with oversize_pkts_sw_drop.

2) Striding RQ in non-linear mode allows it like a normal packet.

3) Legacy RQ can't receive oversized packets by design:
   the RX WQE uses MTU sized packet buffers.

This inconsistency is not a violation of the netdev policy [1]
but it is better to be consistent across modes.

This patch aligns (2) with (1) and (3). One exception is added for
LRO: don't drop the oversized packet if it is an LRO packet.

As now rq->hw_mtu always needs to be updated during the MTU change flow,
drop the reset avoidance optimization from mlx5e_change_mtu().

Extract the CQE LRO segments reading into a helper function as it
is used twice now.

[1] Documentation/networking/netdevices.rst#L205

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260203072130.1710255-2-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
include/linux/mlx5/device.h