]> git.droids-corp.org - dpdk.git/commitdiff
net/hns3: fix jumbo frame flag condition for MTU set
authorSteve Yang <stevex.yang@intel.com>
Mon, 18 Jan 2021 07:04:12 +0000 (07:04 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 19 Jan 2021 02:30:14 +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 'HSN3_DEFAULT_FRAME_LEN',
that perhaps impacts the cases of the jumbo frame related.

Fixes: 1f5ca0b460cd ("net/hns3: support some device operations")
Fixes: a5475d61fa34 ("net/hns3: support VF")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Lijun Ou <oulijun@huawei.com>
drivers/net/hns3/hns3_ethdev.c
drivers/net/hns3/hns3_ethdev_vf.c

index 90544fe3284708cde5283671fb703b24d34510e6..bf633a3d713a9dc2d92a4d1a11c914b4445501c3 100644 (file)
@@ -2467,7 +2467,7 @@ hns3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
        }
 
        rte_spinlock_lock(&hw->lock);
-       is_jumbo_frame = frame_size > RTE_ETHER_MAX_LEN ? true : false;
+       is_jumbo_frame = frame_size > HNS3_DEFAULT_FRAME_LEN ? true : false;
        frame_size = RTE_MAX(frame_size, HNS3_DEFAULT_FRAME_LEN);
 
        /*
index f09cabcd82775290fe5bb7e405c2d283d9cfd604..ef03fb1c4eb059b25f527073f9fa3f8796e58ad8 100644 (file)
@@ -928,7 +928,7 @@ hns3vf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
                rte_spinlock_unlock(&hw->lock);
                return ret;
        }
-       if (frame_size > RTE_ETHER_MAX_LEN)
+       if (mtu > RTE_ETHER_MTU)
                dev->data->dev_conf.rxmode.offloads |=
                                                DEV_RX_OFFLOAD_JUMBO_FRAME;
        else