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 B0D9CA0597; Wed, 8 Apr 2020 10:24:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 360BC1BF99; Wed, 8 Apr 2020 10:24:38 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id F12D22C12 for ; Wed, 8 Apr 2020 10:24:36 +0200 (CEST) IronPort-SDR: dRzUaqmQpLcMyiYOWYUyg3ycEb8DqlhnSaPhjkgD9uN8UWrddb/5pK3/ROMq2EOTg6u5kamDvE ZS+iuTmhLyeg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2020 01:24:35 -0700 IronPort-SDR: J9lTCgYjQ9UYNY6BFf8C1Wdcdw7SyfE7/RLoioxydLzELqPQrQfYQdWAuE+V7MY96EHAikf8l3 dwWGAheNZOqQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,357,1580803200"; d="scan'208";a="275372845" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 08 Apr 2020 01:24:35 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 8 Apr 2020 01:24:35 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 8 Apr 2020 01:24:34 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.57) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 8 Apr 2020 01:24:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Biuo1IdxTVR2HtfofIrFnQrqTfmbzSwrLxc9PieOhNUjbIuEYBFATr51SyLcMpLc5umRalDlKAC2S7ktDNhMqMDQvUmkJd3BtgGLnIo1RG8R3e8HXAyqwo8nyJLrEXjzKasM92R7aTH6PqUIG9jejVysz04aNLT9rE5nNzqFoqmTDAq24X5qknzZZ6a88cajDrpH8tPM69v2rAlccsv20a0XjU1gzgeI24Z3U+gl1zd34mLVy3lmnUeZZ6tgg9s5vTIHQ3Uk1+khtuE6KqrJ7pHtha7K4pt3xDEj/2tENaj7clqJ18LUh/gEjd2sCJWN/HxYQuFCMJggdZ660oHvTQ== 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=XDmrWetA6QFY6C33vys/ONlZR5wuhqtsAUAHFxX6O6I=; b=X+t5HBhNFeHX1c4rPvTPVH+WSibrxFUfGo+4ICbrcQpfdjPVnjsi25Tj52ik0sd3UKJOYywoJHnR6zdhTHOoaKhF+4xC54KrTuVrXH/A2qc3JXxYe8KLFKyHcrOLBiCxkQzHS12wW7ozOQArErexGljUkzgqW8K9M4e03/KK3ESf8T7dTCeKvIx/MV5Iwj/x08Y2FUuHQeYi2blQTa4NceK+jlgs2ZXxOpYq4nYapHHYcmOoIX5hceq0ngx2gCjeY6JSO0egPeGEifWzcutYNy8C1Atz6mhyl2ATEwc6GMUw1xHbwUiGpPhiqTg9IENnO4u9s58ajELTKGl2YdvSVA== 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=XDmrWetA6QFY6C33vys/ONlZR5wuhqtsAUAHFxX6O6I=; b=U0cidLtfRTK5Y4yH8Fq2VhIshWCKzldE3LtqbxLzkrpdJe9u9jeImPyU4Xkn09GFhNsR324rgExSAjQdGgv0U/YtmJzT9nVq1A6WEXReQ/r6+jOgJcvy3GITbRPDJbvncacZ2Rk7Io12suzTTdBboO/gZuo+RPHBVfaHcmCNWc0= Received: from DM6PR11MB2537.namprd11.prod.outlook.com (2603:10b6:5:cd::16) by DM6PR11MB2667.namprd11.prod.outlook.com (2603:10b6:5:c1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Wed, 8 Apr 2020 08:24:14 +0000 Received: from DM6PR11MB2537.namprd11.prod.outlook.com ([fe80::7c08:b4ae:e9c2:a4fa]) by DM6PR11MB2537.namprd11.prod.outlook.com ([fe80::7c08:b4ae:e9c2:a4fa%6]) with mapi id 15.20.2878.022; Wed, 8 Apr 2020 08:24:14 +0000 From: "Iremonger, Bernard" To: "Di, ChenxuX" , "dev@dpdk.org" , "Zhang, Qi Z" CC: "Yang, Qiming" , "Xing, Beilei" , "Zhao1, Wei" Thread-Topic: [dpdk-dev] [PATCH v6] net/i40e: implement hash function in rte flow API Thread-Index: AQHWBmkKeRfafp9HD0SszindqzmA7KhmByLQgAjj4ACAAAVbQA== Date: Wed, 8 Apr 2020 08:24:14 +0000 Message-ID: References: <20200318014710.13577-1-chenxux.di@intel.com> <20200330074025.67783-1-chenxux.di@intel.com> <4a1f49493dc54ef0b3ae9c2bf7018f0d@intel.com> In-Reply-To: <4a1f49493dc54ef0b3ae9c2bf7018f0d@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.184] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b14e9ef4-133e-49b7-9dec-08d7db9638eb x-ms-traffictypediagnostic: DM6PR11MB2667: 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:1186; x-forefront-prvs: 0367A50BB1 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2537.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(376002)(39860400002)(396003)(366004)(136003)(346002)(6506007)(55016002)(53546011)(107886003)(6636002)(4326008)(5660300002)(186003)(7696005)(2906002)(110136005)(64756008)(66446008)(316002)(71200400001)(33656002)(76116006)(81156014)(9686003)(66946007)(66476007)(66556008)(52536014)(26005)(478600001)(81166007)(54906003)(86362001)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AT31BDJMY99VD6XAjUCKjLV4OmS51yjEkc+l6ULwlVK/dM/EUDG1NxWDFfjOWtyLNYX0YaZejfd3xh8/Vpe5hjajh/k2qxQn44vR2DMTcMkvuz4p4Y4OmhtCPrnrdLfjhwSbk0ToHUcxbsd3PtnoGdWX2yQLk9dg21j8LkwSqnNuj+Sls3fHt66Y5uGNaqR3+zcvWC2iudWb2tZ4U4xyio14Kh7H2I9wGtX5UewFFNAaU/eK0UIi5EUFV0dqrk6u3VODsITIjPRPg6+WfWOc5XFd/kYGBP0+Tik28KPF8Ta/8m3zTSO17rbEaG17IzsjMSt44/fAZz72rQKAdJAZzkOoWxqIR3TSrOqPGjuCQ/8/LxPRSd7H2y/wuLFjS2czwJSuP//5fxuoRVFXsJE7uMDUNzrXcLeZ1eGG/sajKvz0VLXmfHCp+bbDSO336nWB x-ms-exchange-antispam-messagedata: QYUlDscarrPTb8k7ij1pgC7PIS21DaFAt1wD2scg3W3IdAONqAHNvZkKERCp10085pNIvPqiqvjAVVp8dRy47/eXx6cjpdPVWnleX58YCC6aRy9LVFbjC8CO+aEINhvPvbZxHY34Uzd2ZLVsFjFhiQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b14e9ef4-133e-49b7-9dec-08d7db9638eb X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Apr 2020 08:24:14.1058 (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: JOZRHvlIYOCSHoHorg1dji6Ie5ICZpQAjigAzRl38CKZRtaMkjySKg5TdRvU7VjcXapuqmtNgeq5ZjrRv5j2yQAaHyYAsReXUKp4QPzd4ew= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2667 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v6] 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, > > > -----Original Message----- > > > From: dev On Behalf Of Chenxu Di > > > Sent: Monday, March 30, 2020 8:40 AM > > > To: dev@dpdk.org > > > Cc: Yang, Qiming ; Xing, Beilei > > > ; Zhao1, Wei ; Di, > > > ChenxuX > > > Subject: [dpdk-dev] [PATCH v6] net/i40e: implement hash function in > > > rte flow API > > > > > > implement set hash global configurations, set symmetric hash enable > > > and set hash input set in rte flow API. > > > > > > Signed-off-by: Chenxu Di >=20 > [snip] >=20 > > > -struct i40e_rte_flow_rss_conf *rss_info =3D &pf->rss_info; > > > > > > -if (!add) { > > > -if (i40e_action_rss_same(&rss_info->conf, &conf->conf)) { > > > > > > The function i40e_action_rss_same() is no longer used. > > Should it be removed from i40e_ethdev.c and i40e_ethdev.h? > > >=20 > It seems like no one use the function. > However I check the commit of the function and find the > commit(ac8d22de23) is so large. > I don't know it is ok if remove it. Best to check with Qi or Beilei if it is ok to remove this function. >=20 > > > > > -i40e_pf_disable_rss(pf); > > > -memset(rss_info, 0, > > > -sizeof(struct i40e_rte_flow_rss_conf)); -return 0; > > > +ret =3D 0; > > > + > > > +for (i =3D RTE_ETH_FLOW_IPV4; i <=3D RTE_ETH_FLOW_L2_PAYLOAD; > > > i++) { > > > +if (!(pf->adapter->flow_types_mask & (1ull << i)) || > > > + !(types & (1ull << i))) > > > +continue; > > > + > > > +conf.op =3D RTE_ETH_INPUT_SET_SELECT; conf.flow_type =3D i; > > > +conf.inset_size =3D 0; for (j =3D 0; j < RTE_DIM(inset_type_table); > > > +j++) { if ((types & > > > +inset_type_table[j].type) =3D=3D > > > + inset_type_table[j].type) { > > > +if (inset_type_table[j].field =3D=3D > > > + RTE_ETH_INPUT_SET_UNKNOWN) { > > > +return -EINVAL; > > > +} > > > +conf.field[conf.inset_size] =3D > > > +inset_type_table[j].field; > > > +conf.inset_size++; > > > +} > > > } > > > + > > > +if (conf.inset_size) { > > > +ret =3D i40e_hash_filter_inset_select(hw, &conf); if (ret) return > > > +ret; } } > > > + > > > +return ret; > > > +} > > > + > > > +/* set existing rule invalid if it is covered */ static void > > > +i40e_config_rss_invalidate_previous_rule(struct i40e_pf *pf, struct > > > +i40e_rte_flow_rss_conf *conf) { struct i40e_flow_rss_filter > > > +*rss_item; uint64_t rss_inset; > > > + > > > +/* to check pctype same need without input set bits */ rss_inset =3D > > > +~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY | > > ETH_RSS_L4_SRC_ONLY | > > > +ETH_RSS_L4_DST_ONLY); > > > + > > > +TAILQ_FOREACH(rss_item, &pf->rss_info_list, next) { if > > > +(!rss_item->rss_filter_info.valid) > > > +continue; > > > + > > > +/* config rss queue rule */ > > > +if (conf->conf.queue_num && > > > + rss_item->rss_filter_info.conf.queue_num) > > > +rss_item->rss_filter_info.valid =3D false; > > > + > > > +/* config rss input set rule */ > > > +if (conf->conf.types && > > > + (rss_item->rss_filter_info.conf.types & > > > + rss_inset) =3D=3D > > > + (conf->conf.types & rss_inset)) rss_item->rss_filter_info.valid > > > +=3D false; > > > + > > > +/* config rss function symmetric rule */ if (conf->conf.func =3D=3D > > > + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ && > > > + rss_item->rss_filter_info.conf.func =3D=3D > > > + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) > > > +rss_item->rss_filter_info.valid =3D false; > > > + > > > +/* config rss function xor or toeplitz rule */ if > > > +(rss_item->rss_filter_info.conf.func !=3D > > > + RTE_ETH_HASH_FUNCTION_DEFAULT && > > > + conf->conf.func !=3D RTE_ETH_HASH_FUNCTION_DEFAULT > > > && > > > + (rss_item->rss_filter_info.conf.types & rss_inset) =3D=3D > > > + (conf->conf.types & rss_inset)) rss_item->rss_filter_info.valid > > > +=3D false; } } > > > + > > > +/* config rss hash enable and set hash input set */ static int > > > +i40e_config_hash_pctype_add(struct i40e_pf *pf, struct > > > +i40e_rte_flow_rss_conf *conf, struct rte_eth_rss_conf *rss_conf) { > > > +struct i40e_rte_flow_rss_conf *rss_info =3D &pf->rss_info; > > > + > > > +if (!(rss_conf->rss_hf & pf->adapter->flow_types_mask)) return > > > +-ENOTSUP; > > > + > > > +/* Confirm hash input set */ > > > +if (i40e_config_rss_inputset(pf, rss_conf->rss_hf)) > > > return -EINVAL; > > > + > > > +if (rss_conf->rss_key =3D=3D NULL || rss_conf->rss_key_len < > > > + (I40E_PFQF_HKEY_MAX_INDEX + 1) * sizeof(uint32_t)) { > > > +/* Random default keys */ > > > +static uint32_t rss_key_default[] =3D {0x6b793944, 0x23504cb5, > > > +0x5bea75b6, 0x309f4f12, 0x3dc0a2b8, 0x024ddcdf, 0x339b8ca0, > > > +0x4c4af64a, 0x34fac605, 0x55d85839, 0x3a58997d, 0x2ec938e1, > > > +0x66031581}; > > > + > > > +rss_conf->rss_key =3D (uint8_t *)rss_key_default; > > > +rss_conf->rss_key_len =3D (I40E_PFQF_HKEY_MAX_INDEX + 1) > > > * > > > +sizeof(uint32_t); > > > +PMD_DRV_LOG(INFO, > > > +"No valid RSS key config for i40e, using default\n"); > > > } > > > > > > +rss_conf->rss_hf |=3D rss_info->conf.types; i40e_hw_rss_hash_set(pf, > > > +rss_conf); > > > + > > > +i40e_config_rss_invalidate_previous_rule(pf, conf); > > > + > > > +return 0; > > > +} > > > + > > > +/* config rss queue region */ > > > +static int > > > +i40e_config_hash_queue_add(struct i40e_pf *pf, struct > > > +i40e_rte_flow_rss_conf *conf) { struct i40e_hw *hw =3D > > > +I40E_PF_TO_HW(pf); uint32_t i, lut; uint16_t j, num; > > > + > > > /* If both VMDQ and RSS enabled, not all of PF queues are configured= . > > > * It's necessary to calculate the actual PF queues that are configu= red. > > > */ > > > @@ -13000,6 +13208,7 @@ i40e_config_rss_filter(struct i40e_pf *pf, > > > return -ENOTSUP; } > > > > > > +lut =3D 0; > > > /* Fill in redirection table */ > > > for (i =3D 0, j =3D 0; i < hw->func_caps.rss_table_size; i++, j++) { > > > if (j =3D=3D num) @@ -13010,29 +13219,215 @@ > > > i40e_config_rss_filter(struct i40e_pf *pf, I40E_WRITE_REG(hw, > > > I40E_PFQF_HLUT(i >> 2), lut); } > > > > > > -if ((rss_conf.rss_hf & pf->adapter->flow_types_mask) =3D=3D 0) { > > > -i40e_pf_disable_rss(pf); > > > +i40e_config_rss_invalidate_previous_rule(pf, conf); > > > + > > > +return 0; > > > +} > > > + > > > +/* config rss hash function */ > > > +static int > > > +i40e_config_hash_function_add(struct i40e_pf *pf, struct > > > +i40e_rte_flow_rss_conf *conf) { struct i40e_hw *hw =3D > > > +I40E_PF_TO_HW(pf); struct rte_eth_hash_global_conf g_cfg; uint64_t > > > +rss_inset; > > > + > > > +if (conf->conf.func =3D=3D > > > +RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ){ > > > +i40e_set_symmetric_hash_enable_per_port(hw, 1); } else { rss_inset > > > +=3D ~(ETH_RSS_L3_SRC_ONLY | > > > ETH_RSS_L3_DST_ONLY | > > > + ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY); g_cfg.hash_func > =3D > > > +conf->conf.func; g_cfg.sym_hash_enable_mask[0] =3D conf->conf.types > & > > > rss_inset; > > > +g_cfg.valid_bit_mask[0] =3D conf->conf.types & rss_inset; > > > +i40e_set_hash_filter_global_config(hw, &g_cfg); } > > > + > > > +i40e_config_rss_invalidate_previous_rule(pf, conf); > > > + > > > +return 0; > > > +} > > > + > > > +/* config rss hena disable and set hash input set to defalut */ > > > > Typo: defalut should be default in above comment. > > >=20 > Yeah ,I will fix it >=20 > > static > > > +int i40e_config_hash_pctype_del(struct i40e_pf *pf, struct > > > +i40e_rte_flow_rss_conf *conf) { struct i40e_hw *hw =3D > > > +I40E_PF_TO_HW(pf); struct i40e_rte_flow_rss_conf *rss_info =3D > > > +&pf->rss_info; struct rte_eth_rss_conf rss_conf =3D { .rss_key =3D > > > +pf->rss_info.conf.key_len ? > > > +(void *)(uintptr_t)conf->conf.key : NULL, .rss_key_len =3D > > > +pf->rss_info.conf.key_len, }; uint32_t i; > > > + >=20 > [snip] >=20 > > > -- > > > 2.17.1 > > Regards, Bernard =20