]> 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)
commitb47275ba7b637efb323dc849181e45ad1185a376
tree6ef73d1078582cde76c4fbfa9ee4942dcd6820e7
parent1b531d1de03be25f9f358011e9e6763637a5cbe2
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: 0e7c9d7c7fe4 ("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