From patchwork Mon Sep 28 06:55:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 78971 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8E2B1A04C0; Mon, 28 Sep 2020 09:07:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E00711C190; Mon, 28 Sep 2020 09:07:11 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 96C3B1C0D2 for ; Mon, 28 Sep 2020 09:07:06 +0200 (CEST) IronPort-SDR: +5sxlPK3XUgIWwWJOX5akmNpsx156yhUYmFNB3El2OdiirWBaVe52cFqVlS8mHvVtQ/k9cz8oZ R8u9S1x4soNg== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="141966822" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="141966822" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 00:07:02 -0700 IronPort-SDR: S4cevKcjslpbbKM5CC94Jhdx96G72MF5H47g5MEGO4C/7Jk2FvjwWcPX5YWPLq33vI3XImolz0 69Gh1Wd/spCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="414895736" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by fmsmga001.fm.intel.com with ESMTP; 28 Sep 2020 00:06:59 -0700 From: SteveX Yang To: dev@dpdk.org Cc: wei.zhao1@intel.com, jia.guo@intel.com, qiming.yang@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, konstantin.ananyev@intel.com, SteveX Yang Date: Mon, 28 Sep 2020 06:55:37 +0000 Message-Id: <20200928065541.7520-2-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200928065541.7520-1-stevex.yang@intel.com> References: <20200923040909.73418-1-stevex.yang@intel.com> <20200928065541.7520-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v4 1/5] net/e1000: fix max mtu size packets with vlan tag cannot be received by default X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" testpmd will initialize default max packet length to 1518 which doesn't include vlan tag size in ether overheader. Once, send the max mtu length packet with vlan tag, the max packet length will exceed 1518 that will cause packets dropped directly from NIC hw side. e1000 can support single vlan tags that need more 4 bytes for max packet size, so, configures the correct max packet size in dev_config ops. Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines") Signed-off-by: SteveX Yang --- drivers/net/e1000/em_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 1dc360713..96ff99951 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -437,10 +437,22 @@ eth_em_configure(struct rte_eth_dev *dev) { struct e1000_interrupt *intr = E1000_DEV_PRIVATE_TO_INTR(dev->data->dev_private); + uint16_t frame_size = dev->data->mtu + E1000_ETH_OVERHEAD; + int rc = 0; PMD_INIT_FUNC_TRACE(); intr->flags |= E1000_FLAG_NEED_LINK_UPDATE; + /** + * Considering vlan tag packet, max frame size should be equal or + * larger than total size of MTU and Ether overhead. + */ + if (frame_size > dev->data->dev_conf.rxmode.max_rx_pkt_len) { + rc = eth_em_mtu_set(dev, dev->data->mtu); + if (rc != 0) + return rc; + } + PMD_INIT_FUNC_TRACE(); return 0; From patchwork Mon Sep 28 06:55:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 78972 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF97CA04C0; Mon, 28 Sep 2020 09:07:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA2F81C1FD; Mon, 28 Sep 2020 09:07:17 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id CE9AB1C137 for ; Mon, 28 Sep 2020 09:07:10 +0200 (CEST) IronPort-SDR: 69QjGpjV1ZrWz7UFQ/hPwIUni7yU5Fw/bOw4HRT8sOk0GZdu2MbGn3WlhRiOkTrVujGNWy7FHm hzir/6naS5Kg== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="141966830" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="141966830" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 00:07:10 -0700 IronPort-SDR: qSVj7mM6EtT1AOrMA4Y1oDrn0pWYB3Idf4XBXZmUeiCrPQiCQN55P83KCGq7mFSB1jbn2XolT4 c8DwxMehqzdA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="414895760" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by fmsmga001.fm.intel.com with ESMTP; 28 Sep 2020 00:07:02 -0700 From: SteveX Yang To: dev@dpdk.org Cc: wei.zhao1@intel.com, jia.guo@intel.com, qiming.yang@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, konstantin.ananyev@intel.com, SteveX Yang Date: Mon, 28 Sep 2020 06:55:38 +0000 Message-Id: <20200928065541.7520-3-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200928065541.7520-1-stevex.yang@intel.com> References: <20200923040909.73418-1-stevex.yang@intel.com> <20200928065541.7520-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v4 2/5] net/igc: fix max mtu size packets with vlan tag cannot be received by default X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" testpmd will initialize default max packet length to 1518 which doesn't include vlan tag size in ether overheader. Once, send the max mtu length packet with vlan tag, the max packet length will exceed 1518 that will cause packets dropped directly from NIC hw side. igc can support single vlan tag that need more 4 bytes for max packet size, so, configures the correct max packet size in dev_config ops. Fixes: a5aeb2b9e225 ("net/igc: support Rx and Tx") Signed-off-by: SteveX Yang --- drivers/net/igc/igc_ethdev.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index 810568bc5..f47ea3e64 100644 --- a/drivers/net/igc/igc_ethdev.c +++ b/drivers/net/igc/igc_ethdev.c @@ -337,11 +337,22 @@ static int eth_igc_configure(struct rte_eth_dev *dev) { struct igc_interrupt *intr = IGC_DEV_PRIVATE_INTR(dev); + uint32_t frame_size = dev->data->mtu + IGC_ETH_OVERHEAD; int ret; PMD_INIT_FUNC_TRACE(); - ret = igc_check_mq_mode(dev); + /** + * Considering vlan tag packet, max frame size should be equal or + * larger than total size of MTU and Ether overhead. + */ + if (frame_size > dev->data->dev_conf.rxmode.max_rx_pkt_len) { + ret = eth_igc_mtu_set(dev, dev->data->mtu); + if (ret != 0) + return ret; + } + + ret = igc_check_mq_mode(dev); if (ret != 0) return ret; From patchwork Mon Sep 28 06:55:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 78973 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ABDD1A04C0; Mon, 28 Sep 2020 09:08:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 46AD41C246; Mon, 28 Sep 2020 09:07:19 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 9C1251C1DF for ; Mon, 28 Sep 2020 09:07:15 +0200 (CEST) IronPort-SDR: Ytk8SkqT/UQSY8Hn01Zc6X9mfDCvK1vDymiEaacsLZ/sywVzC/CnutgkYS+P5pRhUYazS6jEDk Y7ne2PznhMvg== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="141966834" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="141966834" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 00:07:14 -0700 IronPort-SDR: 9sbRrUUSk2HBPcYqH8omtHYjO5RbLt52GyD1Z0Qb6fqlayE2XiYvg/2+vwTR4mYLxG/mTK4QO6 7iGpbdK71uvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="414895769" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by fmsmga001.fm.intel.com with ESMTP; 28 Sep 2020 00:07:09 -0700 From: SteveX Yang To: dev@dpdk.org Cc: wei.zhao1@intel.com, jia.guo@intel.com, qiming.yang@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, konstantin.ananyev@intel.com, SteveX Yang Date: Mon, 28 Sep 2020 06:55:39 +0000 Message-Id: <20200928065541.7520-4-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200928065541.7520-1-stevex.yang@intel.com> References: <20200923040909.73418-1-stevex.yang@intel.com> <20200928065541.7520-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v4 3/5] net/ice: fix max mtu size packets with vlan tag cannot be received by default X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" testpmd will initialize default max packet length to 1518 which doesn't include vlan tag size in ether overheader. Once, send the max mtu length packet with vlan tag, the max packet length will exceed 1518 that will cause packets dropped directly from NIC hw side. ice can support dual vlan tags that need more 8 bytes for max packet size, so, configures the correct max packet size in dev_config ops. Fixes: 50cc9d2a6e9d ("net/ice: fix max frame size") Signed-off-by: SteveX Yang --- drivers/net/ice/ice_ethdev.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index cfd357b05..6b7098444 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3146,6 +3146,7 @@ ice_dev_configure(struct rte_eth_dev *dev) struct ice_adapter *ad = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); + uint32_t frame_size = dev->data->mtu + ICE_ETH_OVERHEAD; int ret; /* Initialize to TRUE. If any of Rx queues doesn't meet the @@ -3157,6 +3158,16 @@ ice_dev_configure(struct rte_eth_dev *dev) if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; + /** + * Considering QinQ packet, max frame size should be equal or + * larger than total size of MTU and Ether overhead. + */ + if (frame_size > dev->data->dev_conf.rxmode.max_rx_pkt_len) { + ret = ice_mtu_set(dev, dev->data->mtu); + if (ret != 0) + return ret; + } + ret = ice_init_rss(pf); if (ret) { PMD_DRV_LOG(ERR, "Failed to enable rss for PF"); From patchwork Mon Sep 28 06:55:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 78974 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6D54BA04C0; Mon, 28 Sep 2020 09:08:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E1EAF1C137; Mon, 28 Sep 2020 09:07:24 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 3E4441C1DF for ; Mon, 28 Sep 2020 09:07:16 +0200 (CEST) IronPort-SDR: MepZVLrJow+8xNZeNKsHF1MG7ZvqXubCpuM0aC/XsEiwKzY4nJyX7abfwk0k+gT+D+8h4m3zY2 ts4B5KLZvWbQ== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="141966839" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="141966839" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 00:07:15 -0700 IronPort-SDR: jRr20hBdKImUwatOwWmJaam14+IgDYibFui6eYDR0eKRMx1XQGRNJNpS8W7oOKmTyJj89WVTpq AtI3wHG9FVWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="414895776" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by fmsmga001.fm.intel.com with ESMTP; 28 Sep 2020 00:07:13 -0700 From: SteveX Yang To: dev@dpdk.org Cc: wei.zhao1@intel.com, jia.guo@intel.com, qiming.yang@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, konstantin.ananyev@intel.com, SteveX Yang Date: Mon, 28 Sep 2020 06:55:40 +0000 Message-Id: <20200928065541.7520-5-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200928065541.7520-1-stevex.yang@intel.com> References: <20200923040909.73418-1-stevex.yang@intel.com> <20200928065541.7520-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v4 4/5] net/i40e: fix max mtu size packets with vlan tag cannot be received by default X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" testpmd will initialize default max packet length to 1518 which doesn't include vlan tag size in ether overheader. Once, send the max mtu length packet with vlan tag, the max packet length will exceed 1518 that will cause packets dropped directly from NIC hw side. But for i40e/i40evf, they should support dual vlan tags that need more 8 bytes for max packet size, so, configure the correct max packet size in dev_config ops. Fixes: ff8282f4bbcd ("net/i40e: consider QinQ when setting MTU") Signed-off-by: SteveX Yang --- drivers/net/i40e/i40e_ethdev.c | 11 +++++++++++ drivers/net/i40e/i40e_ethdev_vf.c | 13 ++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 6439baf2f..35ffe33ab 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1916,6 +1916,7 @@ i40e_dev_configure(struct rte_eth_dev *dev) struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); enum rte_eth_rx_mq_mode mq_mode = dev->data->dev_conf.rxmode.mq_mode; + uint32_t frame_size = dev->data->mtu + I40E_ETH_OVERHEAD; int i, ret; ret = i40e_dev_sync_phy_type(hw); @@ -1930,6 +1931,16 @@ i40e_dev_configure(struct rte_eth_dev *dev) ad->tx_simple_allowed = true; ad->tx_vec_allowed = true; + /** + * Considering QinQ packet, max frame size should be equal or + * larger than total size of MTU and Ether overhead. + */ + if (frame_size > dev->data->dev_conf.rxmode.max_rx_pkt_len) { + ret = i40e_dev_mtu_set(dev, dev->data->mtu); + if (ret != 0) + return ret; + } + if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 8531cf6b1..e3c809037 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1669,6 +1669,8 @@ i40evf_dev_configure(struct rte_eth_dev *dev) I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); uint16_t num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues, dev->data->nb_tx_queues); + uint32_t frame_size = dev->data->mtu + I40E_ETH_OVERHEAD; + int ret; /* Initialize to TRUE. If any of Rx queues doesn't meet the bulk * allocation or vector Rx preconditions we will reset it. @@ -1681,9 +1683,18 @@ i40evf_dev_configure(struct rte_eth_dev *dev) dev->data->dev_conf.intr_conf.lsc = !!(dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC); + /** + * Considering QinQ packet, max frame size should be equal or + * larger than total size of MTU and Ether overhead. + */ + if (frame_size > dev->data->dev_conf.rxmode.max_rx_pkt_len) { + ret = i40evf_dev_mtu_set(dev, dev->data->mtu); + if (ret != 0) + return ret; + } + if (num_queue_pairs > vf->vsi_res->num_queue_pairs) { struct i40e_hw *hw; - int ret; if (rte_eal_process_type() != RTE_PROC_PRIMARY) { PMD_DRV_LOG(ERR, From patchwork Mon Sep 28 06:55:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 78975 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4B113A04C0; Mon, 28 Sep 2020 09:08:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CB041D530; Mon, 28 Sep 2020 09:07:26 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id AC27B1D182 for ; Mon, 28 Sep 2020 09:07:19 +0200 (CEST) IronPort-SDR: 4GrcZa5e9ZTtj+luppZhUJhzs5UJoAcsl1R2D1POXFpfnZMpiWUM/m8ozsKPFMhnrvoB5c8K/k bJ0Zx8LWmnuQ== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="141966845" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="141966845" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 00:07:18 -0700 IronPort-SDR: JFwqOVcfL4B2GaUQB5hPUhkj40nU5hEzvP1TlFavH2Z5/34LrIBBKupnNOXriG7BLQX/7ZnI1L Q2jwL9pKDIqA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="414895796" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by fmsmga001.fm.intel.com with ESMTP; 28 Sep 2020 00:07:16 -0700 From: SteveX Yang To: dev@dpdk.org Cc: wei.zhao1@intel.com, jia.guo@intel.com, qiming.yang@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, konstantin.ananyev@intel.com, SteveX Yang Date: Mon, 28 Sep 2020 06:55:41 +0000 Message-Id: <20200928065541.7520-6-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200928065541.7520-1-stevex.yang@intel.com> References: <20200923040909.73418-1-stevex.yang@intel.com> <20200928065541.7520-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v4 5/5] net/iavf: fix max mtu size packets with vlan tag cannot be received by default X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" testpmd will initialize default max packet length to 1518 which doesn't include vlan tag size in ether overheader. Once, send the max mtu length packet with vlan tag, the max packet length will exceed 1518 that will cause packets dropped directly from NIC hw side. iavf can support dual vlan tags that need more 8 bytes for max packet size, so, configures the correct max packet size in dev_config ops. Fixes: 02d212ca3125 ("net/iavf: rename remaining avf strings") Signed-off-by: SteveX Yang --- drivers/net/iavf/iavf_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index a88d53ab0..635d781eb 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -258,6 +258,8 @@ iavf_dev_configure(struct rte_eth_dev *dev) IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad); struct rte_eth_conf *dev_conf = &dev->data->dev_conf; + uint32_t frame_size = dev->data->mtu + IAVF_ETH_OVERHEAD; + int ret; ad->rx_bulk_alloc_allowed = true; /* Initialize to TRUE. If any of Rx queues doesn't meet the @@ -269,6 +271,16 @@ iavf_dev_configure(struct rte_eth_dev *dev) if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; + /** + * Considering QinQ packet, max frame size should be equal or + * larger than total size of MTU and Ether overhead. + */ + if (frame_size > dev->data->dev_conf.rxmode.max_rx_pkt_len) { + ret = iavf_dev_mtu_set(dev, dev->data->mtu); + if (ret != 0) + return ret; + } + /* Vlan stripping setting */ if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) { if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)