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)
commit7b1b62bc1e6a7b2fd5ee7a4296268eb291d23aeb
tree6ef73d1078582cde76c4fbfa9ee4942dcd6820e7
parente4e9bfb7c93d7e78aa4ad7e1c411a8df15386062
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: 07dd0a7aae7f ("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