]> git.droids-corp.org - dpdk.git/commitdiff
net/ipn3ke: fix jumbo frame flag condition for MTU set
authorSteve Yang <stevex.yang@intel.com>
Mon, 18 Jan 2021 07:04:16 +0000 (07:04 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 19 Jan 2021 02:30:15 +0000 (03:30 +0100)
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: 70d6b7f550f4 ("net/ipn3ke: add representor")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
drivers/net/ipn3ke/ipn3ke_ethdev.h
drivers/net/ipn3ke/ipn3ke_representor.c

index 9b0cf309c8f16e3577cabac8bb688f06a148478a..a6815a9cca813bedaafcf9b9b155504f9bbae3f3 100644 (file)
@@ -640,6 +640,7 @@ ipn3ke_tm_ops_get(struct rte_eth_dev *ethdev,
  */
 #define IPN3KE_ETH_OVERHEAD \
        (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + IPN3KE_VLAN_TAG_SIZE * 2)
+#define IPN3KE_ETH_MAX_LEN (RTE_ETHER_MTU + IPN3KE_ETH_OVERHEAD)
 
 #define IPN3KE_MAC_FRAME_SIZE_MAX    9728
 #define IPN3KE_MAC_RX_FRAME_MAXLENGTH    0x00AE
index 8a536025769429f8344bbe09149ff53edfbdf757..9e15cce34fc1f86845cc7c03740314c78837b260 100644 (file)
@@ -2801,7 +2801,7 @@ ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev, uint16_t mtu)
                return -EBUSY;
        }
 
-       if (frame_size > RTE_ETHER_MAX_LEN)
+       if (frame_size > IPN3KE_ETH_MAX_LEN)
                dev_data->dev_conf.rxmode.offloads |=
                        (uint64_t)(DEV_RX_OFFLOAD_JUMBO_FRAME);
        else