net/mlx5e: XDP, Drop fragmented packets larger than MTU size
authorCarolina Jubran <cjubran@nvidia.com>
Thu, 23 Nov 2023 14:11:20 +0000 (16:11 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 14 Dec 2023 01:22:17 +0000 (17:22 -0800)
commitbcaf109f794744c14da0e9123b31d1f4571b0a35
tree9e94008884d87ed72e84e2f5434d84ce7842ed4d
parentbe86106fd74a145f24c56c9bc18d658e8fe6d4f4
net/mlx5e: XDP, Drop fragmented packets larger than MTU size

XDP transmits fragmented packets that are larger than MTU size instead of
dropping those packets. The drop check that checks whether a packet is larger
than MTU is comparing MTU size against the linear part length only.

Adjust the drop check to compare MTU size against both linear and non-linear
part lengths to avoid transmitting fragmented packets larger than MTU size.

Fixes: 39a1665d16a2 ("net/mlx5e: Implement sending multi buffer XDP frames")
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c