From patchwork Wed Mar 21 07:25:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao1, Wei" X-Patchwork-Id: 36355 X-Patchwork-Delegate: helin.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E341E10B7; Wed, 21 Mar 2018 08:43:12 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id E142023A for ; Wed, 21 Mar 2018 08:43:11 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2018 00:43:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,339,1517904000"; d="scan'208";a="213486919" Received: from dpdk6.bj.intel.com ([172.16.182.119]) by fmsmga005.fm.intel.com with ESMTP; 21 Mar 2018 00:43:10 -0700 From: Wei Zhao To: dev@dpdk.org Cc: qi.z.zhang@intel.com, Wei Zhao Date: Wed, 21 Mar 2018 15:25:03 +0800 Message-Id: <1521617103-4776-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 Subject: [dpdk-dev] [PATCH v2] net/i40e: fix flow RSS configuration error 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" I40e need a protection for rss rule flow configuration after one rule is set for a port. Fixes: ecad87d22383 ("net/i40e: move RSS to flow API") Signed-off-by: Wei Zhao Tested-by: Peng Yuan --- Changes in v2: change fixes version number. --- drivers/net/i40e/i40e_flow.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 16c47cf..7268426 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -4385,14 +4385,15 @@ i40e_config_rss_filter_set(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); + int ret = -ENOTSUP; if (conf->queue_region_conf) { - i40e_flush_queue_region_all_conf(dev, hw, pf, 1); + ret = i40e_flush_queue_region_all_conf(dev, hw, pf, 1); conf->queue_region_conf = 0; } else { - i40e_config_rss_filter(pf, conf, 1); + ret = i40e_config_rss_filter(pf, conf, 1); } - return 0; + return ret; } static int @@ -4545,6 +4546,8 @@ i40e_flow_create(struct rte_eth_dev *dev, case RTE_ETH_FILTER_HASH: ret = i40e_config_rss_filter_set(dev, &cons_filter.rss_conf); + if (ret) + goto free_flow; flow->rule = &pf->rss_info; break; default: