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 2E8A1A0564; Tue, 24 Mar 2020 10:48:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 65B011C0C3; Tue, 24 Mar 2020 10:48:04 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id CEF811C0BE for ; Tue, 24 Mar 2020 10:48:02 +0100 (CET) IronPort-SDR: zvZytuiHUuM2sbpOaQs8Sp0oOZuZMkyq1Q2o02aTkbPRHNZzub+mbpbTkNR7xDk/TvPegQdea7 MGdnue3MN6Mw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2020 02:48:01 -0700 IronPort-SDR: O9DHqFt4wMGBLrTJCZzjLqp16Zt+VU+h3sLHnV50QgGX/joa5NwTg/AtCfjkMnJoGNaQ6hYSKG AHdXFlgTLsAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,299,1580803200"; d="scan'208";a="419831874" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga005.jf.intel.com with ESMTP; 24 Mar 2020 02:48:01 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 24 Mar 2020 02:48:00 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 24 Mar 2020 02:47:59 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 24 Mar 2020 02:47:59 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.52) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 24 Mar 2020 02:47:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=flzbSyOlLSVapP06BnSInYhhW+36njYrRIFGVeAi1e5JQmsrjP0HYraWJfeBd0OcF7zr4R2aKd1genRkWlUUt4o5WPIMRVGK2+ksvIcf83XJSHnN8KyS6hB9qcdqqQB/dSzkRlKbMHM1E63qtyRSyV4hmszGiijGbIWYKmXtGmMsPHKMshLBA1VokyInYMdbv7EM2aqptE19PkX/NGcNZFCMHB2UD69Ouv4UpV6W1JTl+8Kt2dBb8yN9T18Mf/HEMKSu86KkYVSY5AIXb/VcaSRDzdpK6EKTHEyTZXZ2L58flHtAfBWGUAsH7pWq0YOeW8JMJOE7KI+R2vigGovmQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rvEUAWytk+6YQCGAzvyG2jYOMrarV/G9pjq461CsSHI=; b=Hvi2wW0A5/qfGEt+dAxU10b7naRM2gsicyDFcm+J/x3tSQwW7cM5JT26Lq1e112jv7Qrp/nWLCNP5lLnHbe2lg5BlQIbjcAp1f4jupGkJFydIr3zFsug8WNtTuAspZfkAYGAdmk6qwLSbJ+Tka1CnNPM4sOZyexZKk7Kp+BLi6BgUNC0EEMMyo3CAtR9wVlQqRUqkVKnl34EZtiEUq5p2PoBqtvQGigviGTJrQ8K5OqJvvAksRiKkmaNV2vXAQICTdVQUcu1RnNFEPNfQf1dDd5E2QjKsfZQtBj+I12pPke4PMyrMJrvmtL9BopdCbu3vohxBEsibLZ1QfXZXY6osQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rvEUAWytk+6YQCGAzvyG2jYOMrarV/G9pjq461CsSHI=; b=Ni7ckoVh3Sz2/q7/OmJ9BUgvd+IjCl+5H/zYKq8PxbzAAK+JH2739RnuzlILC0TzrlBc4NiH00F9+k2dG+whFS0dmA+cYYbJmXRVqDLC9W18BqgikCZPU8QnPWaWdXWkpYlVlcpbJtUm1AwvqK3MUVjwFiAKJGpNAMHhvEvz5XY= Received: from DM6PR11MB3914.namprd11.prod.outlook.com (2603:10b6:5:197::24) by DM6PR11MB2571.namprd11.prod.outlook.com (2603:10b6:5:c7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20; Tue, 24 Mar 2020 09:47:51 +0000 Received: from DM6PR11MB3914.namprd11.prod.outlook.com ([fe80::7d4f:cc97:aa95:dd3b]) by DM6PR11MB3914.namprd11.prod.outlook.com ([fe80::7d4f:cc97:aa95:dd3b%7]) with mapi id 15.20.2835.021; Tue, 24 Mar 2020 09:47:51 +0000 From: "Iremonger, Bernard" To: "Di, ChenxuX" , "dev@dpdk.org" , "Xing, Beilei" , "Zhang, Qi Z" , "Doherty, Declan" CC: "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH 3/3] net/i40e: configure RSS hash from RSS action Thread-Index: AQHV/SIv8A/A+44MJUqPnUOnPaNC46hV7ewAgAGZTcA= Date: Tue, 24 Mar 2020 09:47:50 +0000 Message-ID: References: <1584535089-29499-1-git-send-email-bernard.iremonger@intel.com> <1584535089-29499-4-git-send-email-bernard.iremonger@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=bernard.iremonger@intel.com; x-originating-ip: [192.198.151.189] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b4c12bcd-43ef-4664-67f5-08d7cfd86aee x-ms-traffictypediagnostic: DM6PR11MB2571: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1332; x-forefront-prvs: 03524FBD26 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(346002)(366004)(136003)(39860400002)(53546011)(6506007)(26005)(71200400001)(186003)(110136005)(7696005)(66556008)(316002)(76116006)(66946007)(66476007)(4326008)(66446008)(86362001)(64756008)(52536014)(107886003)(55016002)(2906002)(6636002)(9686003)(8936002)(81156014)(33656002)(478600001)(8676002)(81166006)(5660300002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR11MB2571; H:DM6PR11MB3914.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CovdmoljGG0z3jxT77RZVr/7AXEkw+2nhegSif+9exc4hh1KyMcQN0fVDFfvYYF5IqJtsAYdpT6QelIKUrfttJrAohhiq85dvAxeCaTtfLgCIZz/ZIfva3Qot6IVJ7rTvZ6JgcakeHgjoPDLiquOX2lNY6M/8XLJOoQyYqv9817Ytslb6IG/6f9RZ/m2wcg7FiGUwBtzOW/TEeht1rn0Gy4P1G8FQSyWXQEN9uN7XFjLkz3sazeNks++lrfOy2s4igTSwYi+LIIsl2McQl6SgtKnngliOCj2WX6DErt8hl5RCSkZ/ngCyXO4d2GBiEyB6hA6ENB4EAFjERwG9GB+q+oi43IdtLwBrXga2D0xj0R7cyKpcYNU9JPmZTzqPxBYmlNf6FipOa2xxAOJaagE5gJJKqrJxG62B6uSrKVy3WXsb56GNU1nI20visu87AX4w+T/x2uGz652WA9hm+tr3Kb/4cYIVI6m1Nu2Eq2IKG8vgUD/ov5cQTTcCxB5fjjfsnCcCqPHhL3rW8pIJjPCCg== x-ms-exchange-antispam-messagedata: KiRV7dyaxwJkJfhfsv2ApUfj9YAPd0L8tnotQy4DILh8N+TCF3CUEfxRkBF3cEoWc0uBavUD6Ym3bw4CCn2+tSFUeaDIXThsiG0QSn2YBZoZRWbG/pGrWQxefiEnZby5xymPgNugYp7tYH7lc/3Yew== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b4c12bcd-43ef-4664-67f5-08d7cfd86aee X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Mar 2020 09:47:50.8949 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oJfSjJwVWWbuTmnq0yFPpclcUCABCDx4+bKFa5+rCogvvgxON7u50d2TCaQV81UryEjlQMVVJMN09Xs+WNSl5WkCA0QGi4CeMyU2BoJqIio= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2571 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 3/3] net/i40e: configure RSS hash from RSS action 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 Chenxu, > -----Original Message----- > From: Di, ChenxuX > Sent: Monday, March 23, 2020 9:19 AM > To: Iremonger, Bernard ; dev@dpdk.org; > Xing, Beilei ; Zhang, Qi Z ; > Doherty, Declan > Cc: Ananyev, Konstantin ; Iremonger, > Bernard > Subject: RE: [dpdk-dev] [PATCH 3/3] net/i40e: configure RSS hash from RSS > action >=20 > Hi, Bernard > This patch conflicts with the > patch(http://patchwork.dpdk.org/project/dpdk/list/?series=3D9005). In 20.= 05 > release, there will be some changes for creating RSS flows to support mor= e > features and make it more flexible. > Changes for RSS flow: > - Configure the hash input set according to the packet type. > - Configure hash function. > - User can create more than one RSS flows and won't affect other rules wh= en > destory. > For example, if you want to enable rss for ipv4-tcp, the command looks li= ke > this: > flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss types ip= v4-tcp > end queues end / end >=20 > So, perhaps you need rework your feature depending on that patch. >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bernard > Iremonger > > Sent: Wednesday, March 18, 2020 8:38 PM > > To: dev@dpdk.org; Xing, Beilei ; Zhang, Qi Z > > ; Doherty, Declan > > Cc: Ananyev, Konstantin ; Iremonger, > > Bernard > > Subject: [dpdk-dev] [PATCH 3/3] net/i40e: configure RSS hash from RSS > > action > > > > handle RSS offload types in RSS action handle ipv4, ipv6 and udp RSS > > patterns handle queue_num 0 in RSS action > > > > Signed-off-by: Bernard Iremonger > > --- > > drivers/net/i40e/i40e_flow.c | 46 > > ++++++++++++++++++++++++++++++++------- > > ----- > > 1 file changed, 34 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_flow.c > > b/drivers/net/i40e/i40e_flow.c index d877ac2..b9a928c 100644 > > --- a/drivers/net/i40e/i40e_flow.c > > +++ b/drivers/net/i40e/i40e_flow.c > > @@ -4461,6 +4461,12 @@ i40e_flow_parse_rss_pattern(__rte_unused > struct > > rte_eth_dev *dev, case RTE_FLOW_ITEM_TYPE_ETH: > > *action_flag =3D 1; > > break; > > +case RTE_FLOW_ITEM_TYPE_IPV4: > > +break; > > +case RTE_FLOW_ITEM_TYPE_IPV6: > > +break; > > +case RTE_FLOW_ITEM_TYPE_UDP: > > +break; > > case RTE_FLOW_ITEM_TYPE_VLAN: > > vlan_spec =3D item->spec; > > vlan_mask =3D item->mask; > > @@ -4516,12 +4522,14 @@ i40e_flow_parse_rss_action(struct > rte_eth_dev > > *dev, struct i40e_rte_flow_rss_conf *rss_config =3D &filter->rss_conf= ; > > struct i40e_rte_flow_rss_conf *rss_info =3D &pf->rss_info; > > +struct rte_eth_rss_conf eth_rss_conf; int ret; > > uint16_t i, j, n, tmp; > > uint32_t index =3D 0; > > uint64_t hf_bit =3D 1; > > +uint64_t rss_hf; > > > > NEXT_ITEM_OF_ACTION(act, actions, index); -rss =3D act->conf; > > > > /** > > * rss only supports forwarding, > > @@ -4535,6 +4543,23 @@ i40e_flow_parse_rss_action(struct rte_eth_dev > > *dev, return -rte_errno; } > > > > +rss =3D act->conf; > > +rss_hf =3D rss->types; > > + > > +if (rss->queue_num =3D=3D 0) { > > +memset(ð_rss_conf, 0, sizeof(eth_rss_conf)); ret =3D > > +rte_eth_dev_rss_hash_conf_get(dev->data->port_id, > > +ð_rss_conf); > > +if (ret !=3D 0) > > +return ret; > > + > > +eth_rss_conf.rss_hf |=3D rss_hf; > > +ret =3D rte_eth_dev_rss_hash_update(dev->data->port_id, > > +ð_rss_conf); > > +if (ret !=3D 0) > > +return ret; > > +} > > + >=20 > I don't think it is a good idea that update rss hash enable status in the= parse > function. > it will update status while send command flow validate xxxxxx which can'= t be > destoried. >=20 > > if (action_flag) { > > for (n =3D 0; n < 64; n++) { > > if (rss->types & (hf_bit << n)) { > > @@ -4552,7 +4577,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev > *dev, > > * continuous sequence and also to be part of RSS > > * queue index for this port. > > */ > > -if (conf_info->queue_region_number) { > > +if (conf_info->queue_region_number && rss->queue_num > 0) { > > for (i =3D 0; i < rss->queue_num; i++) { for (j =3D 0; j < > > rss_info->conf.queue_num; j++) { if (rss->queue[i] =3D=3D > > rss_info->conf.queue[j]) @@ -4579,7 +4604,8 @@ > > i40e_flow_parse_rss_action(struct rte_eth_dev *dev, } > > > > /* Parse queue region related parameters from configuration */ -for > > (n =3D 0; n < conf_info->queue_region_number; n++) { > > +for (n =3D 0; n < conf_info->queue_region_number && > > +rss->queue_num > 0; n++) { > > if (conf_info->region[n].user_priority_num || > > conf_info->region[n].flowtype_num) { > > if (!((rte_is_power_of_2(rss->queue_num)) && @@ - > > 4674,14 +4700,6 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, > > if (rss_config->queue_region_conf) return 0; > > > > -if (!rss || !rss->queue_num) { > > -rte_flow_error_set(error, EINVAL, > > -RTE_FLOW_ERROR_TYPE_ACTION, > > -act, > > -"no valid queues"); > > -return -rte_errno; > > -} > > - > > for (n =3D 0; n < rss->queue_num; n++) { if (rss->queue[n] >=3D > > dev->data->nb_rx_queues) { rte_flow_error_set(error, EINVAL, @@ > > -4692,7 +4710,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, > > } } > > > > -if (rss_info->conf.queue_num) { > > +if (rss_info->conf.queue_num && rss->queue_num) { > > rte_flow_error_set(error, EINVAL, > > RTE_FLOW_ERROR_TYPE_ACTION, > > act, > > @@ -4709,6 +4727,10 @@ i40e_flow_parse_rss_action(struct rte_eth_dev > > *dev, return rte_flow_error_set (error, ENOTSUP, > > RTE_FLOW_ERROR_TYPE_ACTION, act, > > "a nonzero RSS encapsulation level is not supported"); > > +if (rss->types > ETH_RSS_ESP) > > +return rte_flow_error_set > > +(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, > > act, > > + "pctype greater than max allowed"); >=20 > At the patch(http://patchwork.dpdk.org/project/dpdk/list/?series=3D9005), > the hash input set will be enable. > So rss->types may has the value ETH_RSS_L3_SRC_ONLY (1ULL << 63) and > ETH_RSS_L3_DST_ONLY (1ULL << 62) and ETH_RSS_L4_SRC_ONLY (1ULL << > 61) and ETH_RSS_L4_DST_ONLY (1ULL << 60). >=20 > > if (rss->key_len && rss->key_len > RTE_DIM(rss_config->key)) return > > rte_flow_error_set (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, > act, > > -- > > 2.7.4 >=20 Yes, I will need to rework this patch based on top of your patch. Regards, Bernard.