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 152F9A04E1; Tue, 22 Sep 2020 11:03:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CACDD1DC66; Tue, 22 Sep 2020 10:55:19 +0200 (CEST) Received: from incedge.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id 512241DAF8 for ; Tue, 22 Sep 2020 10:54:58 +0200 (CEST) X-ASG-Debug-ID: 1600764897-149d111bae19b060001-TfluYd Received: from mail.chinasoftinc.com ([10.168.0.51]) by incedge.chinasoftinc.com with ESMTP id jMf0gDAxE2oStujr (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Sep 2020 16:54:57 +0800 (CST) X-Barracuda-Envelope-From: huwei013@chinasoftinc.com X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.51 X-ASG-Whitelist: Client Received: from localhost.localdomain (120.133.139.157) by INCCAS001.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 22 Sep 2020 16:54:56 +0800 From: "Wei Hu (Xavier)" X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.60 To: CC: Date: Tue, 22 Sep 2020 16:53:55 +0800 X-ASG-Orig-Subj: [PATCH 11/17] net/hns3: check input RSS type when creating flow with RSS Message-ID: <20200922085401.12272-12-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20200922085401.12272-1-huwei013@chinasoftinc.com> References: <20200922085401.12272-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [120.133.139.157] X-Barracuda-Connect: UNKNOWN[10.168.0.51] X-Barracuda-Start-Time: 1600764897 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: 2184 Subject: [dpdk-dev] [PATCH 11/17] net/hns3: check input RSS type when creating flow with RSS 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: Lijun Ou This patch adds checking the input RSS type when creating a flow with RSS. If the input RSS type are not supported based on hns3 network engine, an error is returned. Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_flow.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 14d5968..f4ea47a 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1403,6 +1403,13 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_ACTION, act, "too many queues for RSS context"); + if (rss->types & (ETH_RSS_L4_DST_ONLY | ETH_RSS_L4_SRC_ONLY) && + (rss->types & ETH_RSS_IP)) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, + &rss->types, + "input RSS types are not supported"); + act_index++; /* Check if the next not void action is END */ @@ -1563,23 +1570,6 @@ hns3_config_rss_filter(struct rte_eth_dev *dev, .queue = conf->conf.queue, }; - /* The types is Unsupported by hns3' RSS */ - if (!(rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT) && - rss_flow_conf.types) { - hns3_err(hw, - "Flow types(%" PRIx64 ") is unsupported by hns3's RSS", - rss_flow_conf.types); - return -EINVAL; - } - - if (rss_flow_conf.key_len && - rss_flow_conf.key_len > RTE_DIM(rss_info->key)) { - hns3_err(hw, - "input hash key(%u) greater than supported len(%zu)", - rss_flow_conf.key_len, RTE_DIM(rss_info->key)); - return -EINVAL; - } - /* Filter the unsupported flow types */ flow_types = conf->conf.types ? rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT : @@ -1755,7 +1745,7 @@ hns3_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, struct hns3_fdir_rule fdir_rule; int ret; - ret = hns3_flow_args_check(attr, pattern, actions, error); + ret = hns3_flow_validate(dev, attr, pattern, actions, error); if (ret) return NULL; -- 2.9.5