[v4,13/22] net/qede: fix the jumbo frame flag condition for mtu set
Checks
Commit Message
The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
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: 200645ac7909 ("net/qede: set MTU")
Cc: Rasesh Mody <rmody@marvell.com>
Cc: Shahed Shaikh <shshaikh@marvell.com>
Signed-off-by: Steve Yang <stevex.yang@intel.com>
---
drivers/net/qede/qede_ethdev.c | 2 +-
drivers/net/qede/qede_rxtx.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
@@ -2367,7 +2367,7 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
fp->rxq->rx_buf_size = rc;
}
}
- if (max_rx_pkt_len > RTE_ETHER_MAX_LEN)
+ if (frame_size > QEDE_ETH_MAX_LEN)
dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
else
dev->data->dev_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
@@ -71,6 +71,7 @@
+ (QEDE_LLC_SNAP_HDR_LEN) + 2)
#define QEDE_MAX_ETHER_HDR_LEN (RTE_ETHER_HDR_LEN + QEDE_ETH_OVERHEAD)
+#define QEDE_ETH_MAX_LEN (RTE_ETHER_MTU + QEDE_MAX_ETHER_HDR_LEN)
#define QEDE_RSS_OFFLOAD_ALL (ETH_RSS_IPV4 |\
ETH_RSS_NONFRAG_IPV4_TCP |\