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 84C57A04E1; Tue, 22 Sep 2020 11:04:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6F25C1DC8E; Tue, 22 Sep 2020 10:55:27 +0200 (CEST) Received: from incedge.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id 904861DB3E for ; Tue, 22 Sep 2020 10:54:59 +0200 (CEST) X-ASG-Debug-ID: 1600764897-149d111bae19b050001-TfluYd Received: from mail.chinasoftinc.com ([10.168.0.51]) by incedge.chinasoftinc.com with ESMTP id ahCKDrOVZoWjcPGf (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:54 +0800 X-ASG-Orig-Subj: [PATCH 10/17] net/hns3: support querying RSS flow rule Message-ID: <20200922085401.12272-11-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: 2055 Subject: [dpdk-dev] [PATCH 10/17] net/hns3: support querying RSS flow rule 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 enables to query some RSS configurations of the specified rule. For example, show RSS hash function and rss types. Signed-off-by: Lijun Ou Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_flow.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 1bc5911..14d5968 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1962,9 +1962,15 @@ hns3_flow_query(struct rte_eth_dev *dev, struct rte_flow *flow, const struct rte_flow_action *actions, void *data, struct rte_flow_error *error) { + struct rte_flow_action_rss *rss_conf; + struct hns3_rss_conf_ele *rss_rule; struct rte_flow_query_count *qc; int ret; + if (!flow->rule) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_HANDLE, NULL, "invalid rule"); + for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) { switch (actions->type) { case RTE_FLOW_ACTION_TYPE_VOID: @@ -1975,13 +1981,24 @@ hns3_flow_query(struct rte_eth_dev *dev, struct rte_flow *flow, if (ret) return ret; break; + case RTE_FLOW_ACTION_TYPE_RSS: + if (flow->filter_type != RTE_ETH_FILTER_HASH) { + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, + actions, "action is not supported"); + } + rss_conf = (struct rte_flow_action_rss *)data; + rss_rule = (struct hns3_rss_conf_ele *)flow->rule; + rte_memcpy(rss_conf, &rss_rule->filter_info.conf, + sizeof(struct rte_flow_action_rss)); + break; default: return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ACTION, - actions, - "Query action only support count"); + RTE_FLOW_ERROR_TYPE_ACTION, + actions, "action is not supported"); } } + return 0; } -- 2.9.5