diff options
author | Martin KaFai Lau <kafai@fb.com> | 2016-12-08 02:53:13 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-08 22:25:13 +0300 |
commit | ea3349a03519dcd4f32d949cd80ab995623dc5ac (patch) | |
tree | 01d77dc1b6492c486e3df0503fc4b1ef17fb7884 /drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |
parent | b45f0674b997ee769907d6092dfa9ee8f59bb51d (diff) | |
download | linux-ea3349a03519dcd4f32d949cd80ab995623dc5ac.tar.xz |
mlx4: xdp: Reserve headroom for receiving packet when XDP prog is active
Reserve XDP_PACKET_HEADROOM for packet and enable bpf_xdp_adjust_head()
support. This patch only affects the code path when XDP is active.
After testing, the tx_dropped counter is incremented if the xdp_prog sends
more than wire MTU.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_netdev.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index c97d25b06444..bcd955339058 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -51,7 +51,8 @@ #include "mlx4_en.h" #include "en_port.h" -#define MLX4_EN_MAX_XDP_MTU ((int)(PAGE_SIZE - ETH_HLEN - (2 * VLAN_HLEN))) +#define MLX4_EN_MAX_XDP_MTU ((int)(PAGE_SIZE - ETH_HLEN - (2 * VLAN_HLEN) - \ + XDP_PACKET_HEADROOM)) int mlx4_en_setup_tc(struct net_device *dev, u8 up) { @@ -2700,11 +2701,6 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog) int err; int i; - if (prog && prog->xdp_adjust_head) { - en_err(priv, "Does not support bpf_xdp_adjust_head()\n"); - return -EOPNOTSUPP; - } - xdp_ring_num = prog ? priv->rx_ring_num : 0; /* No need to reconfigure buffers when simply swapping the |