From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4DF59A0A03; Mon, 18 Jan 2021 02:30:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D50F9140D59; Mon, 18 Jan 2021 02:30:28 +0100 (CET) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id C1A80140D57 for ; Mon, 18 Jan 2021 02:30:27 +0100 (CET) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DJvMx5NGKzj7jV for ; Mon, 18 Jan 2021 09:29:33 +0800 (CST) Received: from [10.67.103.119] (10.67.103.119) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Mon, 18 Jan 2021 09:30:18 +0800 To: Steve Yang , CC: , , References: <20201217092312.27033-1-stevex.yang@intel.com> <20210114094616.13898-1-stevex.yang@intel.com> From: oulijun Message-ID: <7d6c3fc2-9b71-2549-fb5a-7a4ce9a64312@huawei.com> Date: Mon, 18 Jan 2021 09:30:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20210114094616.13898-1-stevex.yang@intel.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.119] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v3 06/22] net/hns3: fix the jumbo frame flag condition for mtu set X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Acked-by: Lijun Ou ÔÚ 2021/1/14 17:46, Steve Yang дµÀ: > 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") > > Signed-off-by: Steve Yang > --- > drivers/net/hns3/hns3_ethdev.c | 2 +- > drivers/net/hns3/hns3_ethdev_vf.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c > index 7c34e382fb..10e0c0de46 100644 > --- a/drivers/net/hns3/hns3_ethdev.c > +++ b/drivers/net/hns3/hns3_ethdev.c > @@ -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); > > /* > diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c > index f09cabcd82..ef03fb1c4e 100644 > --- a/drivers/net/hns3/hns3_ethdev_vf.c > +++ b/drivers/net/hns3/hns3_ethdev_vf.c > @@ -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 >