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 72B85A058A; Wed, 25 Mar 2020 10:48:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1FFD2378E; Wed, 25 Mar 2020 10:48:51 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 3E8C1F3E for ; Wed, 25 Mar 2020 10:48:48 +0100 (CET) IronPort-SDR: HpYhVk4ow40eYco9C+qBVGaMKSyCHmlSLIOXN21f1SDJCZQagMJfxym+zYlqCKgI7WNrsAt1kJ 1xa/TvVqMV5Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 02:48:47 -0700 IronPort-SDR: fCzvnMH1ztJb64YPOxKRl6DRst9+cXymxBUdCzMouzoxqERvrB1s6v7SLEWMSXJwhbCirBbxRd Qh48UUtV0sdg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,303,1580803200"; d="scan'208";a="420260213" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by orsmga005.jf.intel.com with ESMTP; 25 Mar 2020 02:48:47 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Mar 2020 02:48:46 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 25 Mar 2020 02:48:46 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 25 Mar 2020 02:48:46 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.177) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Mar 2020 02:48:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GlcB013Z2/QERL8usizD3E1p53ToNWLsj2BARvJU0mLuGVSqhc+J0Plg+4b0kSOfGKvt7Q+07heghTBFFqz7Dh8FyL2qXrFHnQDO6Mn4YTMQD2bCuEL1iInEoKNwRxgPzyTNcEyUd1oJxARs3tqKNLZvaTTRWG2X5CtniVSbQs5ZPwHXfc3x+mYTAZ0NK9QgNWcskUN8DM6qa7rBaBxuQZTKu4iNZrzibtRUbd6JDe2YMntQ/jBk/1L4q09R/17Fm0HfGoGcJvmvOEY3nKGS6EoCY6bnYct0ouLHIBabPeGuXyWUyB3XJjeb68coGEkleAeokGXIQ5jrk+RB7XQkHg== 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=lU6J/Fm1KTFNaaMQHcKSGSkUa4Fj3OqkCTdDBMohvdY=; b=KlEJPLl8+jJkNve44KKZE89iRL0ZJ2TQyaoQ0roZpzBKFlGtQ0mmoSedBtqafsiZnWjvMhs9un3lg0rbQ0FX3ZBHG13vc3Z7uoepELs98FzhFx5HtHw1YJFhxhJXKnJ9VhQFfCmuoFpX1+x3AWdT7alAwxNopxMMzQROs0yaLtRdhJJIIV93VZrnx9uF489x/esuJ4l2ECm+Gb1KnQIYIfEbbSNZks5vGCIooHNajfEN5W2/N96akv9avC5Pgk2nvyI+ion/Q+bkZ8G7XGliZRMmDcUacJYKdtrl1ca0MiUviBMidPpAajsvMeMWrFsOIhbpwzDnW6lZrg5HZ+DVGg== 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=lU6J/Fm1KTFNaaMQHcKSGSkUa4Fj3OqkCTdDBMohvdY=; b=q/VEw5SlAxe0oZkslQ1+ChB3ZVSAdjLpoJk3+cM7dhaUWNPMJlsRJc+liJIC2N1oU8PuMQgUt9EXfm9oSDR/6PExKiovyHYuXWvoBDuOW+wdIP6dGdiOob4jf4cTy+f+E/NEpexofSafR5HXt/fphGTpo1pB/Q9OZyIt+53/K5w= Received: from DM6PR11MB3914.namprd11.prod.outlook.com (2603:10b6:5:197::24) by DM6PR11MB3611.namprd11.prod.outlook.com (2603:10b6:5:13d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.18; Wed, 25 Mar 2020 09:48:42 +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.023; Wed, 25 Mar 2020 09:48:42 +0000 From: "Iremonger, Bernard" To: "Di, ChenxuX" , "dev@dpdk.org" CC: "Yang, Qiming" , "Xing, Beilei" , "Zhao1, Wei" Thread-Topic: [dpdk-dev] [PATCH v5] net/i40e: implement hash function in rte flow API Thread-Index: AQHWAbZidEJT1jwNCUyDrTHYPX3AdqhXrK2QgADstQCAAHNLUA== Date: Wed, 25 Mar 2020 09:48:42 +0000 Message-ID: References: <20200318014710.13577-1-chenxux.di@intel.com> <20200324081737.47572-1-chenxux.di@intel.com> <87688dbf6ac946d5974a61578be1ed89@intel.com> In-Reply-To: <87688dbf6ac946d5974a61578be1ed89@intel.com> 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.190] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a7a22516-3536-4132-1319-08d7d0a1b41e x-ms-traffictypediagnostic: DM6PR11MB3611: 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:8882; x-forefront-prvs: 0353563E2B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(366004)(136003)(396003)(39860400002)(346002)(478600001)(55016002)(9686003)(33656002)(8936002)(81156014)(81166006)(6506007)(2906002)(7696005)(66476007)(26005)(71200400001)(76116006)(52536014)(66446008)(66946007)(4326008)(66556008)(64756008)(107886003)(54906003)(110136005)(5660300002)(186003)(316002)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR11MB3611; 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: YQA+q/HuhBgmlKZGbX3sBC2f4ishRvKAM/CbC1L4H1j3EDZsnkkQyFeYjoCicdC3UkUbrG0YPFwujO5QCleE44TNW/BZGcXZSwphNBaHpIYZb8JwbsCQnOFnSUKbHf7Geb3ReS2MySMXV2pt9mLylqB8T1LulS0xm2S70v8I//yBhBZ0ICQnGONDVpfMPmPxLCow7IkQwb7P4r9XNbL/00QdmUVhOzhYGCuIKqfmEieRXWObHcOsFA9a8aiIpnrG5kZb9K/E0Y6tlWG+/drDuJhgOJz5FJARiugjzhNqGT3JTnOob0HqtYbelTruyv9cWCz7yqU8ZymvYyaEcGAA2CaXsrH8tpkNqSGDDPDqX3V66pI/E6G2OKjHwLRp1N3rzSQHBeFy4IZkG+L8vvs2C/zx5/V3XLaJunnpl6Yx75795AqzijQudt3YatG45CRT x-ms-exchange-antispam-messagedata: jCj55GFIDEXjIdewbkF8JPA9Q3yTt/pALm34zd7LVFoimVDmvwVzwlRow43rJZOOYehx860tOinN/cTtSECUY8p0aV4emXhB2EijUETK6hh4/xpD2iQhBQPaDS41Og6XZ8WQKh/FQgtKtAh9/V2tnw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a7a22516-3536-4132-1319-08d7d0a1b41e X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2020 09:48:42.5746 (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: tv7iueJPQ8FRCsnQQXTq/jKQS3iYL3OdIlF9Uw3E4frQI9REGKdXb4DvTUiE7wrYAgw3dNHy3pxSV07+1skchVFlLXLCw7A3VPfJ3ImRRvM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3611 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5] net/i40e: implement hash function in rte flow API 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, > [snip] >=20 > > > --- a/drivers/net/i40e/i40e_flow.c > > > +++ b/drivers/net/i40e/i40e_flow.c > > > @@ -4424,10 +4424,10 @@ i40e_flow_parse_qinq_filter(struct > > > rte_eth_dev *dev, > > > * function for RSS, or flowtype for queue region configuration. > > > * For example: > > > * pattern: > > > - * Case 1: only ETH, indicate flowtype for queue region will be par= sed. > > > - * Case 2: only VLAN, indicate user_priority for queue region will b= e > parsed. > > > - * Case 3: none, indicate RSS related will be parsed in action. > > > - * Any pattern other the ETH or VLAN will be treated as invalid exce= pt > END. > > > + * Case 1: try to transform patterns to pctype. valid pctype will be > > > + * used in parse action. > > > + * Case 2: only ETH, indicate flowtype for queue region will be pars= ed. > > > + * Case 3: only VLAN, indicate user_priority for queue region will b= e > parsed. > > > * So, pattern choice is depened on the purpose of configuration of > > > * that flow. > > > * action: > > > @@ -4438,15 +4438,66 @@ static int > > > i40e_flow_parse_rss_pattern(__rte_unused struct rte_eth_dev *dev, > > > const struct rte_flow_item *pattern, > > > struct rte_flow_error *error, > > > - uint8_t *action_flag, > > > + struct i40e_rss_pattern_info *p_info, > > > struct i40e_queue_regions *info) { const struct > > > rte_flow_item_vlan *vlan_spec, *vlan_mask; const struct > > > rte_flow_item *item =3D pattern; enum rte_flow_item_type item_type; > > > - > > > -if (item->type =3D=3D RTE_FLOW_ITEM_TYPE_END) > > > +struct rte_flow_item *items; > > > +uint32_t item_num =3D 0; /* non-void item number of pattern*/ > > > +uint32_t i =3D 0; static const struct { enum rte_flow_item_type > > > +*item_array; uint64_t type; } i40e_rss_pctype_patterns[] =3D { { > > > +pattern_fdir_ipv4, > > > +ETH_RSS_FRAG_IPV4 | > > > ETH_RSS_NONFRAG_IPV4_OTHER }, > > > +{ pattern_fdir_ipv4_tcp, ETH_RSS_NONFRAG_IPV4_TCP }, { > > > +pattern_fdir_ipv4_udp, ETH_RSS_NONFRAG_IPV4_UDP }, { > > > +pattern_fdir_ipv4_sctp, ETH_RSS_NONFRAG_IPV4_SCTP }, { > > > +pattern_fdir_ipv6, > > > +ETH_RSS_FRAG_IPV6 | > > > ETH_RSS_NONFRAG_IPV6_OTHER }, > > > +{ pattern_fdir_ipv6_tcp, ETH_RSS_NONFRAG_IPV6_TCP }, { > > > +pattern_fdir_ipv6_udp, ETH_RSS_NONFRAG_IPV6_UDP }, { > > > +pattern_fdir_ipv6_sctp, ETH_RSS_NONFRAG_IPV6_SCTP }, }; > > > + > > > +p_info->types =3D I40E_RSS_TYPE_INVALID; > > > + > > > +if (item->type =3D=3D RTE_FLOW_ITEM_TYPE_END) { p_info->types =3D > > > +I40E_RSS_TYPE_NONE; > > > return 0; > > > +} > > > + > > > +/* convert flow to pctype */ > > > +while ((pattern + i)->type !=3D RTE_FLOW_ITEM_TYPE_END) { if > > > +((pattern > > > ++ i)->type !=3D RTE_FLOW_ITEM_TYPE_VOID) item_num++; > > > +i++; > > > +} > > > +item_num++; > > > + > > > +items =3D rte_zmalloc("i40e_pattern", > > > + item_num * sizeof(struct rte_flow_item), 0); if (!items) { > > > +rte_flow_error_set(error, ENOMEM, > > > RTE_FLOW_ERROR_TYPE_ITEM_NUM, > > > + NULL, "No memory for PMD internal > > > items."); > > > +return -ENOMEM; > > > +} > > > + > > > +i40e_pattern_skip_void_item(items, pattern); > > > + > > > +for (i =3D 0; i < RTE_DIM(i40e_rss_pctype_patterns); i++) { if > > > (i40e_match_pattern(i40e_rss_pctype_patterns[i].item_array, > > > +items)) { > > > +p_info->types =3D i40e_rss_pctype_patterns[i].type; rte_free(items); > > > +return 0; } } > > > + > > > +rte_free(items); > > > > > > for (; item->type !=3D RTE_FLOW_ITEM_TYPE_END; item++) { if > > > (item->last) { @@ -4459,7 +4510,7 @@ > > > i40e_flow_parse_rss_pattern(__rte_unused struct rte_eth_dev *dev, > > > item_type =3D item->type; switch (item_type) { case > > > RTE_FLOW_ITEM_TYPE_ETH: > > > -*action_flag =3D 1; > > > +p_info->action_flag =3D 1; > > > break; > > > case RTE_FLOW_ITEM_TYPE_VLAN: > > > vlan_spec =3D item->spec; > > > @@ -4472,7 +4523,7 @@ i40e_flow_parse_rss_pattern(__rte_unused > > > struct rte_eth_dev *dev, > > > vlan_spec->tci) >> 13) & 0x7; > > > info->region[0].user_priority_num =3D 1; info->queue_region_number = =3D > > > 1; -*action_flag =3D 0; > > > +p_info->action_flag =3D 0; > > > } > > > } > > > break; > > > @@ -4500,12 +4551,14 @@ i40e_flow_parse_rss_pattern(__rte_unused > > > struct rte_eth_dev *dev, > > > * max index should be 7, and so on. And also, queue index should be > > > * continuous sequence and queue region index should be part of rss > > > * queue index for this port. > > > + * For hash params, the pctype in action and pattern must be same. > > > + * Set queue index or symmetric hash enable must be with non-types. > > > */ > > > static int > > > i40e_flow_parse_rss_action(struct rte_eth_dev *dev, > > > const struct rte_flow_action *actions, > > > struct rte_flow_error *error, > > > - uint8_t action_flag, > > > +struct i40e_rss_pattern_info p_info, > > > struct i40e_queue_regions *conf_info, > > > union i40e_filter_t *filter) > > > { > > > @@ -4516,7 +4569,7 @@ 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; -uint16_t i, j, n, tmp; > > > +uint16_t i, j, n, tmp, nb_types; > > > uint32_t index =3D 0; > > > uint64_t hf_bit =3D 1; > > > > > > @@ -4535,7 +4588,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev > > > *dev, return -rte_errno; } > > > > > > -if (action_flag) { > > > +if (p_info.action_flag) { > > > for (n =3D 0; n < 64; n++) { > > > if (rss->types & (hf_bit << n)) { > > > conf_info->region[0].hw_flowtype[0] =3D n; @@ -4674,11 +4727,11 @@ > > > i40e_flow_parse_rss_action(struct rte_eth_dev *dev, if > > > (rss_config->queue_region_conf) return 0; > > > > > > -if (!rss || !rss->queue_num) { > > > +if (!rss) { > > > rte_flow_error_set(error, EINVAL, > > > RTE_FLOW_ERROR_TYPE_ACTION, > > > act, > > > -"no valid queues"); > > > +"no valid rules"); > > > return -rte_errno; > > > } > > > > > > @@ -4692,19 +4745,40 @@ i40e_flow_parse_rss_action(struct > > > rte_eth_dev *dev, } } > > > > > > -if (rss_info->conf.queue_num) { > > > -rte_flow_error_set(error, EINVAL, > > > -RTE_FLOW_ERROR_TYPE_ACTION, > > > -act, > > > -"rss only allow one valid rule"); > > > -return -rte_errno; > > > +if (rss->queue_num && (p_info.types || rss->types)) > > > > Should the line above be > > > > if (conf_info->queue_region_number && (p_info.types || rss->types)) > > > > to allow RSS configuration of types and queues in a single rule, for ex= ample: > > > > flow create 0 ingress pattern eth / end actions rss types udp end > > queues 2 3 end / end > > >=20 > For the conf_info->queue_region_number and rss->queue_num, In the old > codes, if there is eth or vlan, the conf_info->queue_region_number will = be > set as 1 in the function parse pattern. > And in the parse action function it will check the conf_info- > >queue_region_number. > If conf_info->queue_region_number =3D=3D 1, it will do some things and re= turn. > It will not do the things but do others while conf_info- > >queue_region_number =3D=3D 0. > And after parse it will call the function i40e_flush_queue_region_all_con= f() if > conf_info->queue_region_number =3D=3D 1 While call the function > i40e_config_rss_filter() if conf_info->queue_region_number =3D=3D 0. >=20 > So what I changed is only when conf_info->queue_region_number =3D=3D 0. >=20 > Btw, in i40e, the queue configuration is for a port, it can't be for one = rule or > one type. > So I don't think it is a good idea for allowing RSS configuration of type= s and > queues in a single rule. Would you suggest two rules as follows? To configure the queues: flow create 0 ingress pattern end actions rss queues 2 3 end / end To configure the hash: flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4 end k= ey_len 0 queues end / end (above rule is used on the ice pmd) Regards, Bernard