]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Support bpf_xdp_adjust_head()
authorMartin KaFai Lau <kafai@fb.com>
Wed, 18 Jan 2017 06:06:07 +0000 (22:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jan 2017 16:31:13 +0000 (11:31 -0500)
commitd16c3ec4ef2463b1b689abb75d241ca44a25f005
tree54146549044d0a193cda1769b56156b9a66e205e
parentca4e096a74e6cf6d04eee83df8661b1f5c64cd45
net/mlx5e: Support bpf_xdp_adjust_head()

This patch adds bpf_xdp_adjust_head() support to mlx5e.

1. rx_headroom is added to struct mlx5e_rq.  It uses
   an existing 4 byte hole in the struct.
2. The adjusted data length is checked against
   MLX5E_XDP_MIN_INLINE and MLX5E_SW2HW_MTU(rq->netdev->mtu).
3. The macro MLX5E_SW2HW_MTU is moved from en_main.c to en.h.
   MLX5E_HW2SW_MTU is also moved to en.h for symmetric reason
   but it is not a must.

v2:
- Keep the xdp specific logic in mlx5e_xdp_handle()
- Update dma_len after the sanity checks in mlx5e_xmit_xdp_frame()

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>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c