Reviewed-by: Michael Shamis <[email protected]> -----Original Message----- From: dev <[email protected]> On Behalf Of [email protected] Sent: Wednesday, December 2, 2020 12:12 PM To: Jerin Jacob Kollanukkaran <[email protected]> Cc: [email protected]; Liron Himi <[email protected]>; [email protected]; Yuri Chipchev <[email protected]> Subject: [dpdk-dev] [PATCH v1 05/38] net/mvpp2: remove CRC len from MRU validation
From: Liron Himi <[email protected]> CRC is being removed by HW before packet get write to the buffer, so CRC len should not be included in MRU validation Fixes: 79ec62028 ("net/mvpp2: update MTU and MRU related calculations") Cc: [email protected] Signed-off-by: Liron Himi <[email protected]> Reviewed-by: Yuri Chipchev <[email protected]> --- drivers/net/mvpp2/mrvl_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 0985ccebe..dbb193496 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", -- 2.28.0

