]> git.baikalelectronics.ru Git - kernel.git/commit
net: marvell: mvpp2: increase MTU limit when XDP enabled
authorMarek Behún <kabel@kernel.org>
Mon, 22 Nov 2021 20:08:34 +0000 (21:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Nov 2021 12:37:09 +0000 (12:37 +0000)
commitaa19ae31039acbae579c60417cae0292576bc517
tree6ef73d1078582cde76c4fbfa9ee4942dcd6820e7
parent7b9ae9d4f2712b9bf3a4b929d4381d82d8a8eab4
net: marvell: mvpp2: increase MTU limit when XDP enabled

Currently mvpp2_xdp_setup won't allow attaching XDP program if
  mtu > ETH_DATA_LEN (1500).

The mvpp2_change_mtu on the other hand checks whether
  MVPP2_RX_PKT_SIZE(mtu) > MVPP2_BM_LONG_PKT_SIZE.

These two checks are semantically different.

Moreover this limit can be increased to MVPP2_MAX_RX_BUF_SIZE, since in
mvpp2_rx we have
  xdp.data = data + MVPP2_MH_SIZE + MVPP2_SKB_HEADROOM;
  xdp.frame_sz = PAGE_SIZE;

Change the checks to check whether
  mtu > MVPP2_MAX_RX_BUF_SIZE

Fixes: 94f461c77565 ("mvpp2: add basic XDP support")
Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c