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 15140A04B7; Wed, 14 Oct 2020 11:22:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8FB6E1DD79; Wed, 14 Oct 2020 11:21:34 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 03BB11DD77 for ; Wed, 14 Oct 2020 11:21:31 +0200 (CEST) IronPort-SDR: ZxQ75MfKCIarEWHgNqgFcpmpf0V0TcbKFjpgXaHq9GAhwpRzMKqYGuJcA9Vjdqk2IeP6hRavdv dCasWc/cMFOg== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="183585322" X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="183585322" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 02:21:31 -0700 IronPort-SDR: Tl4tLOf29VIGQThVXMKhXNQSjxnsTnh+dmZNBtZFUERA/Lj+uuhzkN7XRI9Cnk06qDh0FbSnOG qDkzwhpraa/A== X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="530752314" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 02:21:29 -0700 From: SteveX Yang To: dev@dpdk.org Cc: 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: Wed, 14 Oct 2020 09:19:43 +0000 Message-Id: <20201014091945.1934-4-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201014091945.1934-1-stevex.yang@intel.com> References: <20200928065541.7520-1-stevex.yang@intel.com> <20201014091945.1934-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v5 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" when application presets the max rx packet length and expected mtu at the same time, driver need identify if the preset max frame size can hold mtu data and Ether overhead completely. if not, adjust the max frame size via mtu_set ops within dev_configure. 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 0056da78a..a707612c2 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3305,6 +3305,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 @@ -3316,6 +3317,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; + /** + * Reset the max frame size via mtu_set ops if preset max frame + * cannot hold MTU data 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