[dpdk-dev] [PATCH v4 03/22] net/dpaa: fix the jumbo frame flag condition for mtu set

Steve Yang stevex.yang at intel.com
Mon Jan 18 08:04:09 CET 2021


The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports VLAN tag.
That will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.

This fix will change the boundary condition with 'RTE_ETHER_MTU' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: 25f854197abc ("net/dpaa: support jumbo frames")

Cc: Hemant Agrawal <hemant.agrawal at nxp.com>
Cc: Sachin Saxena <sachin.saxena at oss.nxp.com>

Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>

Signed-off-by: Steve Yang <stevex.yang at intel.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 2 +-
 drivers/net/dpaa/dpaa_ethdev.h | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index f00279e004..0c87c136d7 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -184,7 +184,7 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 		return -EINVAL;
 	}
 
-	if (frame_size > RTE_ETHER_MAX_LEN)
+	if (frame_size > DPAA_ETH_MAX_LEN)
 		dev->data->dev_conf.rxmode.offloads |=
 						DEV_RX_OFFLOAD_JUMBO_FRAME;
 	else
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 659bceb467..a858b1372c 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -51,6 +51,10 @@
 #define VLAN_TAG_SIZE   4 /** < Vlan Header Length */
 #endif
 
+#define DPAA_ETH_MAX_LEN (RTE_ETHER_MTU + \
+			  RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + \
+			  VLAN_TAG_SIZE)
+
 /* PCD frame queues */
 #define DPAA_DEFAULT_NUM_PCD_QUEUES	1
 #define DPAA_VSP_PROFILE_MAX_NUM	8
-- 
2.17.1



More information about the dev mailing list