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 0BCC8A04B0; Tue, 22 Sep 2020 14:06:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A0131DC15; Tue, 22 Sep 2020 14:04:15 +0200 (CEST) Received: from incedge.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id BD1961DAE8 for ; Tue, 22 Sep 2020 14:03:46 +0200 (CEST) X-ASG-Debug-ID: 1600776224-149d111bae1ab930001-TfluYd Received: from mail.chinasoftinc.com (inccas002.ito.icss [10.168.0.52]) by incedge.chinasoftinc.com with ESMTP id 8u2DCTlEOsvhaeJ0 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Sep 2020 20:03:44 +0800 (CST) X-Barracuda-Envelope-From: huwei013@chinasoftinc.com X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.52 X-ASG-Whitelist: Client Received: from localhost.localdomain (120.133.139.157) by INCCAS002.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 22 Sep 2020 20:03:44 +0800 From: "Wei Hu (Xavier)" X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.60 To: CC: Date: Tue, 22 Sep 2020 20:03:26 +0800 X-ASG-Orig-Subj: [PATCH v2 14/17] net/hns3: fix flow RSS queue num with 0 Message-ID: <20200922120329.21185-15-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20200922120329.21185-1-huwei013@chinasoftinc.com> References: <20200922085401.12272-1-huwei013@chinasoftinc.com> <20200922120329.21185-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [120.133.139.157] X-Barracuda-Connect: inccas002.ito.icss[10.168.0.52] X-Barracuda-Start-Time: 1600776224 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://incspam.chinasofti.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at chinasoftinc.com X-Barracuda-Scan-Msg-Size: 2789 Subject: [dpdk-dev] [PATCH v2 14/17] net/hns3: fix flow RSS queue num with 0 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" From: "Wei Hu (Xavier)" When user specifies RSS queue num for 0 in action list by flow create API, it should create a valid flow rule. The following flow rule should be success in the command line of the testpmd application: flow create 0 actions rss queues / end Fixes: c37ca66f2b27 ("net/hns3: support RSS") Cc: stable@dpdk.org Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_flow.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 6f2ff87..5b5124c 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1360,10 +1360,9 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, uint16_t n; NEXT_ITEM_OF_ACTION(act, actions, act_index); - /* Get configuration args from APP cmdline input */ rss = act->conf; - if (rss == NULL || rss->queue_num == 0) { + if (rss == NULL) { return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, "no valid queues"); @@ -1537,11 +1536,6 @@ hns3_update_indir_table(struct rte_eth_dev *dev, uint8_t queue_id; uint32_t i; - if (num == 0) { - hns3_err(hw, "No PF queues are configured to enable RSS"); - return -ENOTSUP; - } - allow_rss_queues = RTE_MIN(dev->data->nb_rx_queues, hw->rss_size_max); /* Fill in redirection table */ memcpy(indir_tbl, hw->rss_info.rss_indirection_tbl, @@ -1632,10 +1626,11 @@ hns3_config_rss_filter(struct rte_eth_dev *dev, hns3_info(hw, "Max of contiguous %u PF queues are configured", num); rte_spinlock_lock(&hw->lock); - /* Update redirection talbe of rss */ - ret = hns3_update_indir_table(dev, &rss_flow_conf, num); - if (ret) - goto rss_config_err; + if (num) { + ret = hns3_update_indir_table(dev, &rss_flow_conf, num); + if (ret) + goto rss_config_err; + } /* Set hash algorithm and flow types by the user's config */ ret = hns3_hw_rss_hash_set(hw, &rss_flow_conf); @@ -1661,9 +1656,6 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev) struct hns3_adapter *hns = dev->data->dev_private; struct hns3_hw *hw = &hns->hw; - if (hw->rss_info.conf.queue_num == 0) - return 0; - return hns3_config_rss_filter(dev, &hw->rss_info, false); } @@ -1674,9 +1666,6 @@ hns3_restore_rss_filter(struct rte_eth_dev *dev) struct hns3_adapter *hns = dev->data->dev_private; struct hns3_hw *hw = &hns->hw; - if (hw->rss_info.conf.queue_num == 0) - return 0; - /* When user flush all rules, it doesn't need to restore RSS rule */ if (hw->rss_info.conf.func == RTE_ETH_HASH_FUNCTION_MAX) return 0; -- 2.9.5