OSDN Git Service

mlx4: xdp: Allow raising MTU up to one page minus eth and vlan hdrs
authorMartin KaFai Lau <kafai@fb.com>
Wed, 7 Dec 2016 23:53:12 +0000 (15:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Dec 2016 19:25:13 +0000 (14:25 -0500)
commitb45f0674b997ee769907d6092dfa9ee8f59bb51d
tree04e52255772e0556b7770147d4195bbdf969d711
parent17bedab2723145d17b14084430743549e6943d03
mlx4: xdp: Allow raising MTU up to one page minus eth and vlan hdrs

When XDP is active in mlx4, mlx4 is using one page/pkt.
At the same time (i.e. when XDP is active), it is currently
limiting MTU to be FRAG_SZ0 - ETH_HLEN - (2 * VLAN_HLEN)
which is 1514 in x86.  AFAICT, we can at least raise the MTU
limit up to PAGE_SIZE - ETH_HLEN - (2 * VLAN_HLEN) which this
patch is doing.  It will be useful in the next patch which
allows XDP program to extend the packet by adding new header(s).

Note: In the earlier XDP patches, there is already existing guard
to ensure the page/pkt scheme only applies when XDP is active
in mlx4.

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/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/en_rx.c