The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition.
If 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 normalize the boundary condition with 'RTE_ETHER_MTU'
and overhead even though current overhead is 18.
Fixes:
254bd849b132 ("net/hinic: set jumbo frame offload flag")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
#define HINIC_PKTLEN_TO_MTU(pktlen) \
((pktlen) - (ETH_HLEN + ETH_CRC_LEN))
+/* The max frame size with default MTU */
+#define HINIC_ETH_MAX_LEN (RTE_ETHER_MTU + ETH_HLEN + ETH_CRC_LEN)
+
/* lro numer limit for one packet */
#define HINIC_LRO_WQE_NUM_DEFAULT 8
/* update max frame size */
frame_size = HINIC_MTU_TO_PKTLEN(mtu);
- if (frame_size > RTE_ETHER_MAX_LEN)
+ if (frame_size > HINIC_ETH_MAX_LEN)
dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_JUMBO_FRAME;
else