From: Liron Himi Date: Wed, 27 Jan 2021 16:09:18 +0000 (+0200) Subject: net/mvpp2: remove CRC length from MRU validation X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=31536a6892ef9dfe98be26b65d9235d82ea9f9f1;p=dpdk.git net/mvpp2: remove CRC length from MRU validation CRC is being removed by HW before packet get write to the buffer, so CRC len should not be included in MRU validation Fixes: 79ec62028b9a ("net/mvpp2: update MTU and MRU related calculations") Cc: stable@dpdk.org Signed-off-by: Liron Himi Reviewed-by: Yuri Chipchev --- diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index e95c6e5992..476227b9a1 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -441,8 +441,8 @@ mrvl_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) * when this feature has not been enabled/supported so far * (TODO check scattered_rx flag here once scattered RX is supported). */ - if (mru + MRVL_PKT_OFFS > mbuf_data_size) { - mru = mbuf_data_size - MRVL_PKT_OFFS; + if (mru - RTE_ETHER_CRC_LEN + MRVL_PKT_OFFS > mbuf_data_size) { + mru = mbuf_data_size + RTE_ETHER_CRC_LEN - MRVL_PKT_OFFS; mtu = MRVL_PP2_MRU_TO_MTU(mru); MRVL_LOG(WARNING, "MTU too big, max MTU possible limitted " "by current mbuf size: %u. Set MTU to %u, MRU to %u",