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 5DC63A0A03; Mon, 18 Jan 2021 08:10:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7126E140D22; Mon, 18 Jan 2021 08:09:09 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 56395140D26 for ; Mon, 18 Jan 2021 08:09:07 +0100 (CET) IronPort-SDR: ZRAGNF6PRR67sYP2lzWpyymz19oD+NHKbxmcgLlLW73rKvNkwAsypFoMvtxH8LRX2sZz1trtvz lIPX1q2Ilauw== X-IronPort-AV: E=McAfee;i="6000,8403,9867"; a="197460249" X-IronPort-AV: E=Sophos;i="5.79,355,1602572400"; d="scan'208";a="197460249" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2021 23:08:54 -0800 IronPort-SDR: QB39geqCD4WTJLCqG/8hgZwdb9E42p6fpwsQrWbw031n3JfbNHbK/qxe8Yu/B2ieyzhoH/2WNQ PMBYYKSTvK0A== X-IronPort-AV: E=Sophos;i="5.79,355,1602572400"; d="scan'208";a="355087016" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2021 23:08:51 -0800 From: Steve Yang To: dev@dpdk.org Cc: Steve Yang , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou Date: Mon, 18 Jan 2021 07:04:26 +0000 Message-Id: <20210118070428.36998-21-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210118070428.36998-1-stevex.yang@intel.com> References: <20210114094537.13661-1-stevex.yang@intel.com> <20210118070428.36998-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v4 20/22] net/hinic: 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" 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: Ziyang Xuan Cc: Xiaoyun Wang Cc: Guoyang Zhou Signed-off-by: Steve Yang --- drivers/net/hinic/hinic_pmd_ethdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c index 62642354cf..5a2c171099 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.c +++ b/drivers/net/hinic/hinic_pmd_ethdev.c @@ -75,6 +75,9 @@ #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 @@ -1556,7 +1559,7 @@ static int hinic_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) /* 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 -- 2.17.1