Reviewed-by: Michael Shamis <michae...@marvell.com>

-----Original Message-----
From: dev <dev-boun...@dpdk.org> On Behalf Of lir...@marvell.com
Sent: Wednesday, December 2, 2020 12:12 PM
To: Jerin Jacob Kollanukkaran <jer...@marvell.com>
Cc: dev@dpdk.org; Liron Himi <lir...@marvell.com>; sta...@dpdk.org; Yuri 
Chipchev <yu...@marvell.com>
Subject: [dpdk-dev] [PATCH v1 05/38] net/mvpp2: remove CRC len from MRU 
validation

From: Liron Himi <lir...@marvell.com>

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: sta...@dpdk.org

Signed-off-by: Liron Himi <lir...@marvell.com>
Reviewed-by: Yuri Chipchev <yu...@marvell.com>
---
 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

Reply via email to