From patchwork Mon Jul 26 09:17:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alvin Zhang X-Patchwork-Id: 96277 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 mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C4CD3A0C47; Mon, 26 Jul 2021 11:17:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44C24410E1; Mon, 26 Jul 2021 11:17:38 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id A02F740F35; Mon, 26 Jul 2021 11:17:35 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10056"; a="212234887" X-IronPort-AV: E=Sophos;i="5.84,270,1620716400"; d="scan'208";a="212234887" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2021 02:17:32 -0700 X-IronPort-AV: E=Sophos;i="5.84,270,1620716400"; d="scan'208";a="463867448" Received: from shwdenpg235.ccr.corp.intel.com ([10.253.106.22]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2021 02:17:30 -0700 From: Alvin Zhang To: beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Alvin Zhang , stable@dpdk.org Date: Mon, 26 Jul 2021 17:17:24 +0800 Message-Id: <20210726091724.17104-1-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20210721063209.9724-1-alvinx.zhang@intel.com> References: <20210721063209.9724-1-alvinx.zhang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2] net/iavf: fix virtual channel RSS command error handling 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" Kernel PF may not respond to virtual channel commands VIRTCHNL_OP_GET_RSS_HENA_CAPS and VIRTCHNL_OP_SET_RSS_HENA, which will cause VF to fail to start. RSS offload type configuration is not a necessary feature for VF, so in order to improve VF compatibility, in this patch the PMD will ignore the error result of above two commands and will print warnings instead. Fixes: 5a038d19962d ("net/iavf: fix RSS configuration on i40e VF") Cc: stable@dpdk.org Signed-off-by: Alvin Zhang Acked-by: Qi Zhang --- drivers/net/iavf/iavf_ethdev.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 41382c6..574cfe0 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -259,7 +259,7 @@ struct rte_iavf_xstats_name_off { return err; } -static int +static void iavf_config_rss_hf(struct iavf_adapter *adapter, uint64_t rss_hf) { static const uint64_t map_hena_rss[] = { @@ -319,8 +319,16 @@ struct rte_iavf_xstats_name_off { int ret; ret = iavf_get_hena_caps(adapter, &caps); - if (ret) - return ret; + if (ret) { + /** + * RSS offload type configuration is not a necessary feature + * for VF, so here just print a warning and return. + */ + PMD_DRV_LOG(WARNING, + "fail to get RSS offload type caps, ret: %d", ret); + return; + } + /** * ETH_RSS_IPV4 and ETH_RSS_IPV6 can be considered as 2 * generalizations of all other IPv4 and IPv6 RSS types. @@ -343,8 +351,15 @@ struct rte_iavf_xstats_name_off { } ret = iavf_set_hena(adapter, hena); - if (ret) - return ret; + if (ret) { + /** + * RSS offload type configuration is not a necessary feature + * for VF, so here just print a warning and return. + */ + PMD_DRV_LOG(WARNING, + "fail to set RSS offload types, ret: %d", ret); + return; + } if (valid_rss_hf & ipv4_rss) valid_rss_hf |= rss_hf & ETH_RSS_IPV4; @@ -357,7 +372,6 @@ struct rte_iavf_xstats_name_off { rss_hf & ~valid_rss_hf); vf->rss_hf = valid_rss_hf; - return 0; } static int @@ -409,9 +423,7 @@ struct rte_iavf_xstats_name_off { return ret; } } else { - ret = iavf_config_rss_hf(adapter, rss_conf->rss_hf); - if (ret != -ENOTSUP) - return ret; + iavf_config_rss_hf(adapter, rss_conf->rss_hf); } return 0; @@ -1400,9 +1412,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, return ret; } } else { - ret = iavf_config_rss_hf(adapter, rss_conf->rss_hf); - if (ret != -ENOTSUP) - return ret; + iavf_config_rss_hf(adapter, rss_conf->rss_hf); } return 0;