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 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"); -- 2.17.1