OSDN Git Service

net/mlx5e: Restrict the combination of large MTU and XDP
authorTariq Toukan <tariqt@mellanox.com>
Sun, 31 Dec 2017 13:50:13 +0000 (15:50 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 26 Jul 2018 22:23:53 +0000 (15:23 -0700)
commita26a5bdf3ee2da419ba2c2baa54f467103dc8cc5
tree339dbae79b4dcceba6e2f26710f5dc64a7599412
parent0ec13877ce95c00737ff4f71a96cd90533b12b48
net/mlx5e: Restrict the combination of large MTU and XDP

Add checks in control path upon an MTU change or an XDP program set,
to prevent reaching cases where large MTU and XDP are set simultaneously.

This is to make sure we allow XDP only with the linear RX memory scheme,
i.e. a received packet is not scattered to different pages.
Change mlx5e_rx_get_linear_frag_sz() accordingly, so that we make sure
the XDP configuration can really be set, instead of assuming that it is.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c