From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 071BCA04C7; Wed, 16 Sep 2020 07:58:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8538F1C1E0; Wed, 16 Sep 2020 07:57:48 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 5A0C41C1D2 for ; Wed, 16 Sep 2020 07:57:47 +0200 (CEST) IronPort-SDR: WNXC5BXea8oKSE5A5YMSlGCepU5tRwAhgEMcL0xpA06ENffNhlknY8Tq/L9MWFzaGX+15e2DXm 4jOrgrzJKBrQ== X-IronPort-AV: E=McAfee;i="6000,8403,9745"; a="223592010" X-IronPort-AV: E=Sophos;i="5.76,431,1592895600"; d="scan'208";a="223592010" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2020 22:57:47 -0700 IronPort-SDR: J5xs4Hgkx4ZJ35NDuz2WIRRKokhsBh2MwV0/SPfMidVWXZKUpYntlldWdjAwGd/1qmvQlPx6VF Squtp/e7TfmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,431,1592895600"; d="scan'208";a="319722759" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga002.jf.intel.com with ESMTP; 15 Sep 2020 22:57:44 -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, SteveX Yang Date: Wed, 16 Sep 2020 05:52:11 +0000 Message-Id: <20200916055212.25019-5-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200916055212.25019-1-stevex.yang@intel.com> References: <20200916055212.25019-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v1 4/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 does'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 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 8fe81409c..ca4c52a52 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -217,7 +217,7 @@ iavf_dev_configure(struct rte_eth_dev *dev) struct iavf_adapter *ad = 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; + struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode; ad->rx_bulk_alloc_allowed = true; /* Initialize to TRUE. If any of Rx queues doesn't meet the @@ -229,9 +229,18 @@ 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 MTU and + * corresponding ether overhead. + */ + if (dev->data->mtu == RTE_ETHER_MTU && + rxmode->max_rx_pkt_len == RTE_ETHER_MAX_LEN) { + rxmode->max_rx_pkt_len = RTE_ETHER_MTU + IAVF_ETH_OVERHEAD; + rxmode->offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; + } + /* Vlan stripping setting */ if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) { - if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) + if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP) iavf_enable_vlan_strip(ad); else iavf_disable_vlan_strip(ad); -- 2.17.1