[v1,01/12] net/dpaa2: fix the jumbo frame flag condition for mtu set

Message ID 20201209031628.29572-2-stevex.yang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series fix rx packets dropped issue |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Steve Yang Dec. 9, 2020, 3:16 a.m. UTC
  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'.

Fixes: e16408499412 ("net/dpaa2: configure jumbo frames")

Signed-off-by: Steve Yang <stevex.yang@intel.com>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index ab6863300e..b92f4c1a7f 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -1420,7 +1420,7 @@  dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 	if (mtu < RTE_ETHER_MIN_MTU || frame_size > DPAA2_MAX_RX_PKT_LEN)
 		return -EINVAL;
 
-	if (frame_size > RTE_ETHER_MAX_LEN)
+	if (mtu > RTE_ETHER_MTU)
 		dev->data->dev_conf.rxmode.offloads |=
 						DEV_RX_OFFLOAD_JUMBO_FRAME;
 	else