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 9E4C4A0523; Wed, 1 Jul 2020 03:16:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 02F621BE95; Wed, 1 Jul 2020 03:16:05 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 53231255 for ; Wed, 1 Jul 2020 03:16:03 +0200 (CEST) IronPort-SDR: CkeAIYqGJmcDz5pipQoBnsRojk608c0n3OFn6/dVqNZgj7dP83NQyPVtex/XohKaD10V7R5Upl zHCPMfE9sQmA== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="231289200" X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="231289200" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 18:16:02 -0700 IronPort-SDR: 1nv3IJtO2DQe4I34e3yVbGEwBk8st88AIhEWdfcvDX2sXaFEFs33dr5P3y00xmH56S5NfNRyHQ ozC7a6Ys0R+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="481123303" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga006.fm.intel.com with ESMTP; 30 Jun 2020 18:16:02 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 30 Jun 2020 18:16:01 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 1 Jul 2020 09:15:59 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Wed, 1 Jul 2020 09:15:59 +0800 From: "Di, ChenxuX" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Xing, Beilei" Thread-Topic: [PATCH v2 4/5] net/i40e: enable flow query RSS Thread-Index: AQHWQr38gOfN9EKyQkudTt9mWszod6jwhoMAgAF94CA= Date: Wed, 1 Jul 2020 01:15:59 +0000 Message-ID: References: <20200611060142.75465-1-chenxux.di@intel.com> <20200615021858.13985-1-chenxux.di@intel.com> <20200615021858.13985-5-chenxux.di@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 4/5] net/i40e: enable flow query 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" Hi, > -----Original Message----- > From: Yang, Qiming > Sent: Tuesday, June 30, 2020 6:27 PM > To: Di, ChenxuX ; dev@dpdk.org > Cc: Xing, Beilei > Subject: RE: [PATCH v2 4/5] net/i40e: enable flow query RSS >=20 >=20 >=20 > > -----Original Message----- > > From: Di, ChenxuX > > Sent: Monday, June 15, 2020 10:19 > > To: dev@dpdk.org > > Cc: Xing, Beilei ; Yang, Qiming > > ; Di, ChenxuX > > Subject: [PATCH v2 4/5] net/i40e: enable flow query RSS > > > > This patch enables flow query function to get the configuration ofthe > > specified rule. > > > > Signed-off-by: Chenxu Di > > --- > > drivers/net/i40e/i40e_flow.c | 51 > > ++++++++++++++++++++++++++++++++++++ > > 1 file changed, 51 insertions(+) > > > > diff --git a/drivers/net/i40e/i40e_flow.c > > b/drivers/net/i40e/i40e_flow.c index 8f8df6fae..b070802bd 100644 > > --- a/drivers/net/i40e/i40e_flow.c > > +++ b/drivers/net/i40e/i40e_flow.c > > @@ -43,6 +43,11 @@ static int i40e_flow_destroy(struct rte_eth_dev *dev= , > > struct rte_flow_error *error); > > static int i40e_flow_flush(struct rte_eth_dev *dev, > > struct rte_flow_error *error); > > +static int i40e_flow_query(struct rte_eth_dev *dev, > > + struct rte_flow *flow, > > + const struct rte_flow_action *actions, > > + void *data, > > + struct rte_flow_error *error); > > static int > > i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev, > > const struct rte_flow_item *pattern, @@ - > > 129,6 +134,7 @@ const struct rte_flow_ops i40e_flow_ops =3D { .create = =3D > > i40e_flow_create, .destroy =3D i40e_flow_destroy, .flush =3D > > i40e_flow_flush, > > +.query =3D i40e_flow_query, > > }; > > > > static union i40e_filter_t cons_filter; @@ -5462,3 +5468,48 @@ > > i40e_flow_flush_rss_filter(struct rte_eth_dev *dev) > > > > return ret; > > } > > + > > +static int > > +i40e_flow_query(struct rte_eth_dev *dev __rte_unused, struct rte_flow > > +*flow, const struct rte_flow_action *actions, void *data, struct > > +rte_flow_error *error) { struct i40e_rss_filter *rss_rule =3D (struct > > +i40e_rss_filter *)flow->rule; enum rte_filter_type filter_type =3D > > +flow->filter_type; struct rte_flow_action_rss *rss_conf =3D data; > > + > > +if (!rss_rule) { > > +rte_flow_error_set(error, EINVAL, > > + RTE_FLOW_ERROR_TYPE_HANDLE, > > + NULL, "Invalid rule"); > > +return -rte_errno; > > +} > > + > > +for (; actions->type !=3D RTE_FLOW_ACTION_TYPE_END; actions++) { switc= h > > +(actions->type) { case RTE_FLOW_ACTION_TYPE_VOID: > > +break; > > +case RTE_FLOW_ACTION_TYPE_RSS: > > +if (filter_type !=3D RTE_ETH_FILTER_HASH) { rte_flow_error_set(error, > > +ENOTSUP, > > + > > RTE_FLOW_ERROR_TYPE_ACTION, > > + actions, > > + "action not supported"); > > +return -rte_errno; > > +} > > +rte_memcpy(rss_conf, > > + &rss_rule->rss_filter_info.conf, > > + sizeof(struct rte_flow_action_rss)); >=20 > Don't understand the behavior, what's action means? What's the things thi= s > commend query? >=20 By zhangqi's comment, it will query the configuration of rss rule. It just return the config and display it. > > +break; > > +default: > > +return rte_flow_error_set(error, ENOTSUP, > > + > > RTE_FLOW_ERROR_TYPE_ACTION, > > + actions, > > + "action not supported"); > > +} > > +} > > + > > +return 0; > > +} > > -- > > 2.17.1 >=20