From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 25B5BA0C41; Thu, 16 Sep 2021 05:03:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D31B4003F; Thu, 16 Sep 2021 05:03:22 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id A67DD4003C; Thu, 16 Sep 2021 05:03:20 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10108"; a="244847408" X-IronPort-AV: E=Sophos;i="5.85,297,1624345200"; d="scan'208";a="244847408" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2021 20:03:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,297,1624345200"; d="scan'208";a="471203686" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga007.fm.intel.com with ESMTP; 15 Sep 2021 20:03:16 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 15 Sep 2021 20:03:15 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 15 Sep 2021 20:03:15 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 15 Sep 2021 20:03:15 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 15 Sep 2021 20:03:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K/J+saEkrl40oC2eOmvgEDMJHqqota2tsCuRaUwwIlJegHVfh/XIDXTJhpoZVtWeYk/KOuFNEa2aYMXW0GglFBn/lKBCNYO28fRh4pJdis1OtsjBgLEClWMHrKIvcfdSwPKR5ypPcQ9JtT+wA66glSEGgWzJ+1Ol9bH2qCLH1ObXDXAki3ZPzFOvi8C3Zb66+4GbXpA62X4A/7DGUIXnMtk1JDaeYtCcyPy4jDQIkXjm7PPTVLKmCXilrVU23D1BpSe5QQhWsJtnmxHCGlwsiBQIGDHl2evMkV3lImnV9YKzaD/7tQ6kCPAhZ3TzFQ8YOfcDRk6zKsLDNjkBXTVDyQ== 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; bh=d2GglpAk8IDYjW60eDQUCz5HHW+qcPYv2JM/e9WaaD4=; b=l5YDsPLmHSdXuJwsoWyRpMd/KG+0aWhp0jHpmq7O7rKFlWgnWymcZDasgUklg4avoHL0cV6EK1e/sXe5LqCl1tHCWImXCsUsumARyLb5fwdtiKiRfZgNb9eu/H68OulSA1FhXZ6+kdR1z8z2Irs5/jhZDYbcZfJ1OT9KZZsolujq0FKkPnj4ESsXcgID7cwPVwMRbB02BXT4Qp+kUJbQzj2fXH4/9Cg7giAhicEAlwZSzgWKkBJwk/qv5EOu/F2OvD+oEUXa+Rxg4F3tXAijz2uVOLQGmEBKY1x18NESegloTPKN1w2WTrDMSgOf90WLFftMEJVsJYIp+hqMuK0VeA== 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=d2GglpAk8IDYjW60eDQUCz5HHW+qcPYv2JM/e9WaaD4=; b=Xz+TnR68Looalwld0Po3z/NJw4AwgfoBZkA7lBKukUS/4Smcuio6ronbU5HXETUO5ce0c9w3axZCfQpKc3bMxnOn9BY2Ml28EkkZF8VjMdVb6W8IQ1xxs0IaDC6TyPupeLs0cPO0yPEG8+QMjww+8gV3kSVk++vwLnFSH05J4Bc= Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22) by DM4PR11MB5437.namprd11.prod.outlook.com (2603:10b6:5:398::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Thu, 16 Sep 2021 03:03:14 +0000 Received: from DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3]) by DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3%3]) with mapi id 15.20.4523.014; Thu, 16 Sep 2021 03:03:14 +0000 From: "Li, Xiaoyun" To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= , "Maxime Coquelin" , "Yigit, Ferruh" CC: Andrew Rybchenko , "dev@dpdk.org" , "Xia, Chenbo" , "amorenoz@redhat.com" , "david.marchand@redhat.com" , "michaelba@nvidia.com" , "viacheslavo@nvidia.com" , "stable@dpdk.org" , Shahaf Shuler Thread-Topic: [dpdk-stable] [PATCH 2/3] app/testpmd: fix RSS hash type update Thread-Index: AQHXqIOHoDVnoalHfUulnYhJYwaL3aujIOQAgALZfXA= Date: Thu, 16 Sep 2021 03:03:14 +0000 Message-ID: References: <20210910091734.7023-1-maxime.coquelin@redhat.com> <20210910091734.7023-3-maxime.coquelin@redhat.com> <7548b2d2-fd23-4a1a-59d7-b3424912afcc@redhat.com> <85036fee-62f0-5d61-b451-65ee428ee2bc@oktetlabs.ru> <1daeb2f2-2122-c546-3eb4-f0d7fba035f0@redhat.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0cf07801-edc3-4631-d691-08d978be8651 x-ms-traffictypediagnostic: DM4PR11MB5437: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2276; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fheIPQVfSWZ6tfQd+67R5TIWNSvMabMFEYbz6VsfjOLs6D9ZhNQpYN6Ocf6mi97/GzUsKCent5lmWfnHji+k1z24HHGaY60GXRb4Kp2T/wUckCwD5utbXzfAlkIMlwxcq2BKO9Z8fKkKv6xfAWm7NArPfm6B62WfwXTJOUkCM+MysZrz5L13zWoHwlHi0V6Tup1zdzs5kcDKvt82UbVdN5oE6diOEEx0vxrJaH71le8xBcY3gN0vr9/pmYTIl2FG6ou5LCjGpMjWwpetitJnz863vXqZsoGmmt1OQzY2j3/u26ZNv61xlUUq/nVLh4ShBOIuRgtTzzbLmwP80ZWbzBZKNGLAZ1y0lBvKMfv7tunQwrwVYwZ520W483/l/IZ47vAmiSIooYu/sQt7Sqa5Em9t3XVZROv0TxTaVhYYSdhMM5ZsPCwM5q52L2wb1vvNHfXbWk4Yr4hdAzp+0wkdNe3COopQke//k/qO1wI7oJv3b8a2eYNZKd5Nl8bkxuI8wVyG2hKrczYyq0cr7w4am0CICK8xg/Z8HZjvcmZEbR0pTNDdeLKyIClFny2sv6E+u6yejCZ+xmJn/vMWesJArykfRf7eAgQMFsPDBjeBnxlIaHDg4haJlkndPx7+exeXV/g4uX6fEwqElNvirq0XWQZEYOedv1Ceb4jLyHyKR+5Lajr1uY+ArD1kZ8IDJh/UvG+gJ5mik700+Y6M1UXQVw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5534.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(346002)(39860400002)(136003)(366004)(8676002)(2906002)(6636002)(53546011)(186003)(6506007)(38070700005)(66476007)(66556008)(66946007)(64756008)(33656002)(5660300002)(7416002)(26005)(7696005)(8936002)(66446008)(76116006)(52536014)(38100700002)(110136005)(54906003)(66574015)(71200400001)(15650500001)(316002)(478600001)(122000001)(55016002)(9686003)(4326008)(86362001)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?QVurjlV8VMF3Eq0j6x0tDUGfjIEldvO/NjmXqArbqvyqP7APJlUnVOurX5?= =?iso-8859-1?Q?Xy+VeSaAEwNGB+3VFPJcT3Mtp5YWdZ2tI4qsQtR9MXjyCxv9Xqyq+V+ZKZ?= =?iso-8859-1?Q?E3IsmwLoI1bC62gmmJviXe9VZJU/jVldvUns35siymgMTGANLl5g8QPt9D?= =?iso-8859-1?Q?LuKimVDuI6EjJH56bxsNi40UlyOMNu+NXvgs3FFh9FbvhYzPhlIaUj5Afr?= =?iso-8859-1?Q?mv5QDGOIYHJ4gDSngBzIhgRdNsG2ICvHL82t1GE6E17HomVnGN0OBu6Nzc?= =?iso-8859-1?Q?N3j+7/LRqzRjC4Sk2BSiioOMRSNeRS7hH7yyp0yaQQ2kcYdMElM2sIpLdH?= =?iso-8859-1?Q?sK/zcg/PQKdCGwmNy43WdqiIp6Zvk0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QDCo9445uTlI6xatMSl7RZhFZZPqX13+kpQgUz0Ds5nGG5qSycM7N0w?= =?iso-8859-1?Q?lN3acS2n/wxFo3kwzWguupe57BK3FAIWH+U5X1m528708rp6d+qfYEcEvF?= =?iso-8859-1?Q?C3nlAugYFo?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5534.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cf07801-edc3-4631-d691-08d978be8651 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2021 03:03:14.1359 (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: s8l9tdURcaTA7XL3UcxD6JKQyHSEHezFm/DNaurRidV+3nEmFz6fzucdWmHbvvb0BnC332vWjjtM9El8xltZfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5437 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH 2/3] app/testpmd: fix RSS hash type update X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: stable On Behalf Of N=E9lio Laranjeiro > Sent: Tuesday, September 14, 2021 15:20 > To: Maxime Coquelin ; Yigit, Ferruh > > Cc: Andrew Rybchenko ; dev@dpdk.org; Xia, > Chenbo ; amorenoz@redhat.com; > david.marchand@redhat.com; michaelba@nvidia.com; viacheslavo@nvidia.com; > stable@dpdk.org; Shahaf Shuler > Subject: Re: [dpdk-stable] [PATCH 2/3] app/testpmd: fix RSS hash type upd= ate >=20 > +Shahaf, >=20 > Hi Maxime, >=20 > On Mon, Sep 13, 2021 at 11:41:04AM +0200, Maxime Coquelin wrote: > > Hi N=E9lio, > > > > On 9/10/21 4:16 PM, N=E9lio Laranjeiro wrote: > > > On Fri, Sep 10, 2021 at 01:06:53PM +0300, Andrew Rybchenko wrote: > > >> On 9/10/21 12:57 PM, Maxime Coquelin wrote: > > >>> > > >>> > > >>> On 9/10/21 11:51 AM, Andrew Rybchenko wrote: > > >>>> On 9/10/21 12:17 PM, Maxime Coquelin wrote: > > >>>>> port_rss_hash_key_update() initializes rss_conf with the RSS > > >>>>> hash type and key provided by the user, but it calls > > >>>>> rte_eth_dev_rss_hash_conf_get() before calling > > >>>>> rte_eth_dev_rss_hash_update(), which overides the parsed config > > >>>>> with current NIC's config. > > >>>>> > > >>>>> While the RSS key value is set again after, this is not the case > > >>>>> of the key length and the type of hash. > > >>>>> > > >>>>> There is no need to read the RSS config from the NIC, let's just > > >>>>> try to set the user defined one. > > >>>>> > > >>>>> Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash > > >>>>> commands") > > >>>>> Cc: stable@dpdk.org > > >>>>> Cc: nelio.laranjeiro@6wind.com > > >>>>> > > >>>>> Signed-off-by: Maxime Coquelin > > >>>>> --- > > >>>>> app/test-pmd/config.c | 8 ++------ > > >>>>> 1 file changed, 2 insertions(+), 6 deletions(-) > > >>>>> > > >>>>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > > >>>>> 31d8ba1b91..451bda53b1 100644 > > >>>>> --- a/app/test-pmd/config.c > > >>>>> +++ b/app/test-pmd/config.c > > >>>>> @@ -2853,18 +2853,14 @@ port_rss_hash_key_update(portid_t > port_id, char rss_type[], uint8_t *hash_key, > > >>>>> int diag; > > >>>>> unsigned int i; > > >>>>> > > >>>>> - rss_conf.rss_key =3D NULL; > > >>>>> + rss_conf.rss_key =3D hash_key; > > >>>>> rss_conf.rss_key_len =3D hash_key_len; > > >>>>> rss_conf.rss_hf =3D 0; > > >>>>> for (i =3D 0; rss_type_table[i].str; i++) { > > >>>>> if (!strcmp(rss_type_table[i].str, rss_type)) > > >>>>> rss_conf.rss_hf =3D rss_type_table[i].rss_type; > > >>>>> } > > >>>>> - diag =3D rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf); > > >>>>> - if (diag =3D=3D 0) { > > >>>>> - rss_conf.rss_key =3D hash_key; > > >>>>> - diag =3D rte_eth_dev_rss_hash_update(port_id, > &rss_conf); > > >>>>> - } > > >>>>> + diag =3D rte_eth_dev_rss_hash_update(port_id, &rss_conf); > > >>>> > > >>>> I'm not 100% sure, but I'd say the intent above could be to > > >>>> update key only as the function name says. I.e. keep rss_hf as > > >>>> is. That could be the reason to get first. +1 The intent is only updating rss key. That's why to get_rss_conf first. At least for all intel devices. RSS key is a global value for all rss_hf. And since the intent is to only update the key value. I don't think this pa= tch makes sense since you're changing rss_hf which will break current test = cases. And before 8205e241b2b01c, the command is what we want. port_rss_hash_key_u= pdate(portid_t port_id, uint8_t *hash_key) only updates key. But if mlx has the configuration of config key for each rss_type then the c= ode should remain to the current code in which keylen and rss_hf will be ov= erridden to the correct value intel wants and mlx has their own configurati= on for specific rss type. But to be honest, I checked mlx5. I don't see they have this kind of config= uration. Need to confirm with their driver maintainer though. But anyway, from my point of view, I prefer to revert what 8205e241b2b01c0 = does and remove rss_hf, rss_key_len setting in this command if mlx doesn't = have key update for specific rss type. Otherwise, remain what it's like wig= ht now. BRs Xiaoyun > > > > > > True, > > > > > >>> I think that was the intial purpose of the command, but patch > > >>> 8205e241b2b0 added setting the hash type as mandatory. There are > > >>> no other command to configure the hash type from testpmd AFAICT. > > > > > > Also for the same initial purpose, some NIC have an hash key per > > > protocol, by default it uses the same key for all of them but it can > > > be configured individually making for example key0 for all protocols > > > expect > > > IPv4 which uses key1. > > > > Thanks for the info, I have looked at most drivers but didn't found > > one that support this feature, could you give some pointer? >=20 > Well, I have done the modification at that time for MLX5 PMD, since I lef= t DPDK > in 2018 I don't know if they still support such configuration from this A= PI or if > they fully moved to rte_flow. >=20 > > Given how the drivers impl=E9ment the callback, do you agree with the > > fix, or do you have something else in mind? >=20 > I cannot answer if this get() is mandatory, this predates my arrival on D= PDK > (original commit written in 2014), looking at DPDK state on commit > f79959ea1504 ("app/testpmd: allow to configure RSS hash key"). > Maybe someone from Intel can help, eventually you can contact PMD > maintainers to review this patch. >=20 > Regards, > N=E9lio >=20 > > Thanks, > > Maxime > > > > >>> Also, even without 8205e241b2b0, the function was broken because > > >>> the key length was overiden. > > >> > > >> I see, many thanks for explanations. > > > > > >=20 > -- > N=E9lio Laranjeiro > 6WIND