From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 33593A0540;
	Wed, 15 Jul 2020 09:14:50 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 3BFB21BF9D;
	Wed, 15 Jul 2020 09:14:49 +0200 (CEST)
Received: from EUR01-HE1-obe.outbound.protection.outlook.com
 (mail-eopbgr130078.outbound.protection.outlook.com [40.107.13.78])
 by dpdk.org (Postfix) with ESMTP id 5676F1BF80
 for <dev@dpdk.org>; Wed, 15 Jul 2020 09:14:47 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; 
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IZByJtNHBpFf90c3jq/aJIN0CjeMJxQNwqKZP0PjKZE=;
 b=jpjjRo3SD03G46esVRxZaXV9NFOCOTa++44pqT2Ru7nyFlvdQ40e81xnsZ04HWzc/91QvnyHLXlvczTNSwLytoq5pepgloahg3NVY0jRd9EOBb/FCf+ZI390ljMv39yyT+j/sb88SG/meNNwPmEj6cIIR7llx1AI9YmQbqJ0iCQ=
Received: from AM7PR02CA0023.eurprd02.prod.outlook.com (2603:10a6:20b:100::33)
 by AM0PR08MB3124.eurprd08.prod.outlook.com (2603:10a6:208:5e::29)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Wed, 15 Jul
 2020 07:14:46 +0000
Received: from AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:20b:100:cafe::ba) by AM7PR02CA0023.outlook.office365.com
 (2603:10a6:20b:100::33) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22 via Frontend
 Transport; Wed, 15 Jul 2020 07:14:46 +0000
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none
 header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM5EUR03FT015.mail.protection.outlook.com (10.152.16.132) with
 Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.3195.18 via Frontend Transport; Wed, 15 Jul 2020 07:14:46 +0000
Received: ("Tessian outbound 73b502bf693a:v62");
 Wed, 15 Jul 2020 07:14:46 +0000
X-CR-MTA-TID: 64aa7808
Received: from 7559edd4fd25.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 0A5AA59A-D5E9-4247-A755-844A5AECA309.1; 
 Wed, 15 Jul 2020 07:14:41 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7559edd4fd25.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 15 Jul 2020 07:14:41 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=BuXZNiYN5FtTsWRSnK2paqlNB6yZ/89K1lSL7bQarAaHXtk1XbSiI7fdKDluKLvcpkAn/t196CnlRDD+2wz2G86wW23fT3OCDeK+7y9ZdPI2sS6TzZElilFfae+lfn69LYCvSX/Hm4ATwB+318qDYnq0F9arX9HBCG5T6sMZM1fX82AFXPxItowNlqcu9CV+SPdLyXYMBOq3JMIiy0JsuzM38tbmJ2sM8U71dn7WQfzzebNqiZdhQ4Wnd1+SxqnRbpLczpODLbpmChkcHt5qTpHiS3/0A+XSDQYOW6nUEu0KhZ0steY7MJefSYc3y+astgkaA4TvdSECC01t2y53jQ==
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=IZByJtNHBpFf90c3jq/aJIN0CjeMJxQNwqKZP0PjKZE=;
 b=O64diTQInqhhuanwfJcMxpe38NIac2SkeVFUw5Q6Xc5Cz3pJXIhgVNzrSJDFU4JVTkiu8oKSLIU4m3o/OEbz6bY1mPRjJZa81P2k6YgA/foMeDF2+urzcCrW3srUnQCcCdlP6bFTCmWK95f2xBlycgsBZD39rw7D23aXZi8PO38dhqmoG68qmgsE+2+UIkM5hQ4OFinFCw31nFznsyOsmM449j/s5VMCofalV7Nx79kzzapKtUUGs4xs9SykniJsjUkY2b/uqQbdtE5hz+Am4UndwbFBa6Sn1pI7SL5glyevZk0VTALYDbWrMB7D6zdAYkLOZGc4oCc82MRqtljXEw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; 
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IZByJtNHBpFf90c3jq/aJIN0CjeMJxQNwqKZP0PjKZE=;
 b=jpjjRo3SD03G46esVRxZaXV9NFOCOTa++44pqT2Ru7nyFlvdQ40e81xnsZ04HWzc/91QvnyHLXlvczTNSwLytoq5pepgloahg3NVY0jRd9EOBb/FCf+ZI390ljMv39yyT+j/sb88SG/meNNwPmEj6cIIR7llx1AI9YmQbqJ0iCQ=
Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11)
 by VI1PR08MB3568.eurprd08.prod.outlook.com (2603:10a6:803:7f::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.23; Wed, 15 Jul
 2020 07:14:39 +0000
Received: from VE1PR08MB4640.eurprd08.prod.outlook.com
 ([fe80::c2e:9ccb:a690:6863]) by VE1PR08MB4640.eurprd08.prod.outlook.com
 ([fe80::c2e:9ccb:a690:6863%6]) with mapi id 15.20.3174.026; Wed, 15 Jul 2020
 07:14:39 +0000
From: Phil Yang <Phil.Yang@arm.com>
To: Lijun Ou <oulijun@huawei.com>, "wenzhuo.lu@intel.com"
 <wenzhuo.lu@intel.com>, "beilei.xing@intel.com" <beilei.xing@intel.com>,
 "bernard.iremonger@intel.com" <bernard.iremonger@intel.com>,
 "adrien.mazarguil@6wind.com" <adrien.mazarguil@6wind.com>,
 "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, "linuxarm@huawei.com"
 <linuxarm@huawei.com>, nd <nd@arm.com>, nd <nd@arm.com>
Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix the default RSS key
 configuration
Thread-Index: AQHWVffiSXU7HeFBAUunhiwPXaR+/akIOcgw
Date: Wed, 15 Jul 2020 07:14:39 +0000
Message-ID: <VE1PR08MB4640BF90E007CA8576FFFFEFE97E0@VE1PR08MB4640.eurprd08.prod.outlook.com>
References: <1594302456-48256-1-git-send-email-oulijun@huawei.com>
In-Reply-To: <1594302456-48256-1-git-send-email-oulijun@huawei.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ts-tracking-id: 0e0052fd-3d87-476a-9a72-f5e5ad2b5ea7.0
x-checkrecipientchecked: true
Authentication-Results-Original: huawei.com; dkim=none (message not signed)
 header.d=none;huawei.com; dmarc=none action=none header.from=arm.com;
x-originating-ip: [203.126.0.112]
x-ms-publictraffictype: Email
X-MS-Office365-Filtering-HT: Tenant
X-MS-Office365-Filtering-Correlation-Id: 8c8ecb7c-3bb4-47de-b31a-08d8288ec10e
x-ms-traffictypediagnostic: VI1PR08MB3568:|AM0PR08MB3124:
X-Microsoft-Antispam-PRVS: <AM0PR08MB3124DA942882DC8CC41AD744E97E0@AM0PR08MB3124.eurprd08.prod.outlook.com>
x-checkrecipientrouted: true
nodisclaimer: true
x-ms-oob-tlc-oobclassifiers: OLM:8273;OLM:8273;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original: 66hZownyUgneY3DCB4RwEuOw8UVxBsKNSZ22lfhZiP+gr9pvmnW8URHu0t8oYL3ZjhL6qJ9SiI6Vyhywdx/dByAgfFu5kHeVBxbnx6n6Ixw/oAL79E+YDU0gDN/JRNs+SjXM6iSvLFHO6U2sfMs31seQXR7nUi+5/ZxvFt/aWuFdYBMKSCHoH+/pl7TFcEGY6+LK1f4V/vBZsS2bzsZL75VxKw9g618ulL149Y9wdq3D4NBc4DTUD5Kdr4XIX0pxa8nKrKDgpw0AJIBTLsnE81GYcpVD/IzLVFw8Bkb/FVdEtTp5BPLNWLGSdwEiRjy9
X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en;
 SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB4640.eurprd08.prod.outlook.com;
 PTR:; CAT:NONE; SFTY:;
 SFS:(4636009)(376002)(396003)(346002)(366004)(39860400002)(136003)(66946007)(9686003)(8936002)(76116006)(64756008)(186003)(66446008)(54906003)(55016002)(66556008)(26005)(110136005)(66476007)(4326008)(5660300002)(316002)(52536014)(71200400001)(6506007)(53546011)(7696005)(33656002)(478600001)(83380400001)(2906002)(86362001);
 DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata: FFpn7+pOAOq9A9WRBqVBR3xaRnVEaGjPKHDek/8R/2LzeIoaXGubqmTRxJGgsPcRiSUyJ3MZLEEwmiuAw8zFwYRR6QLxrRM3qyrSI0UuyZajJJGuPtICWRq6BqB7pO55xUY9XYWBoJ1i+gWQAjVI4fSD1gwkSAHMuVIbz/uJeicYCsNK+5j9jwlMdcJqaoM54qikSoAFwLqiX5M8ggdiJuWbMpD8GSQcm5TY3mwxeiyN5+XQ8sWxQlkCQftZtjvSYLWEqu2VDfaKGSfKgVlct4841azVJf5Bod1uP7EjfIu3wVHaqyrzL7s1d04MNGjn9jLq4DndEB1LJnLh9/TBjoxHbgtNAc+ZGOmsI7aXXQPiW2mwSX0f99nNO/Ih1Fl+byk+VsmYqUybwVhuoIgrg2YOssyAZa4bIHHZRy4gVjPMGnIH1u4ZcKRWxITT3cKfR8VMAVwzos/jo5QVFH8xau8J8G6wiqVRIlKCbIH/zY4=
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3568
Original-Authentication-Results: huawei.com; dkim=none (message not signed)
 header.d=none;huawei.com; dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com
X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:;
 IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com;
 PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:;
 SFS:(4636009)(396003)(346002)(39860400002)(376002)(136003)(46966005)(52536014)(70206006)(70586007)(478600001)(316002)(47076004)(82740400003)(83380400001)(110136005)(82310400002)(356005)(81166007)(5660300002)(186003)(6506007)(53546011)(336012)(7696005)(8936002)(86362001)(33656002)(36906005)(4326008)(54906003)(55016002)(9686003)(2906002)(26005);
 DIR:OUT; SFP:1101; 
X-MS-Office365-Filtering-Correlation-Id-Prvs: 7f72f6d6-5b6d-4628-b4f6-08d8288ebcf9
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: Dq1rNnh40qxPmijxv2XRUgiRLSWdVgV22idYDEW8RfcOV4d/gzfgkDNHs4GWquPp/LHrs1ve7pilceNx+G9bHAT1uQHPlBfQ+hr4AIuFYwDNXQumVe4C+JKGkJnzMoL5YR/mUKJJBG7078JxMnlHjWVbKDBemzc2a4lPtxaX5aEnqTkMQuZHHH8NA5G7FQcZkN/x2o2DwbpZsXYjTi/b5Gin4+eEnjiF6kA/if0ZId5ew5fnMgvhERf8cNmF7m4RRQbdEv7ESWmGY7q8Q3TC1cxH5PUECKDGJgk9IeHhW3QQX0JELtN5rpLntjQgJjfg1VMRqQAMPcyH1TQmTXe72KPDOld/7rDt/2mH0BbMvu2lt0r/pyUNCummb8YSKlZjjQ9p73syG0u02EL9DiLxzQ==
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2020 07:14:46.1788 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8c8ecb7c-3bb4-47de-b31a-08d8288ec10e
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123];
 Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3124
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix the default RSS
	key	configuration
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Lijun Ou
> Sent: Thursday, July 9, 2020 9:48 PM
> To: wenzhuo.lu@intel.com; beilei.xing@intel.com;
> bernard.iremonger@intel.com; adrien.mazarguil@6wind.com;
> ferruh.yigit@intel.com
> Cc: dev@dpdk.org; linuxarm@huawei.com
> Subject: [dpdk-dev] [PATCH] app/testpmd: fix the default RSS key
> configuration
>=20
> When an user runs a flow create cmd to configure an RSS rule
> without specifying the empty rss actions in testpmd, this mean
> that the flow gets the default RSS functions. However, the
> testpmd is not set the default RSS key incorrectly when RSS key
> is specified in flow create cmd.

Hi Lijun,

I think it works.=20
When we create an RSS flow rule which doesn't specify any 'rss-hash-key', t=
he 'rss-hash-key' will be updated with the default key.

Step 1:
testpmd> show port 0 rss-hash key
RSS functions:
 all ipv4-frag ipv4-other ipv6-frag ipv6-other ip
RSS key:
4439796BB54C5023B675EA5B124F9F30B8A2C03DDFDC4D02A08C9B334AF64A4C05C6FA34395=
8D8557D99583AE138C92E81150366

Step 2:=20
testpmd> flow create 0 ingress pattern eth / ipv4 / udp / end actions rss t=
ypes ipv4-udp end queues end / end
Flow rule #0 created

Step 3:
testpmd> show port 0 rss-hash key
RSS functions:
 all ipv4-udp udp
RSS key:
74657374706D6427732064656661756C74205253532068617368206B65792C206F766572726=
9646520697420666F722062657474


Thanks,
Phil
>=20
> Now, it uses rte_eth_dev_rss_hash_conf_get to correctly the
> default rss key.
>=20
> Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")
> Cc: stable@dpdk.org
>=20
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> ---
>  app/test-pmd/cmdline_flow.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>=20
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 4e2006c..7eddde4 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -4168,6 +4168,7 @@ parse_vc_action_rss(struct context *ctx, const
> struct token *token,
>  		action_rss_data->queue[i] =3D i;
>  	if (!port_id_is_invalid(ctx->port, DISABLED_WARN) &&
>  	    ctx->port !=3D (portid_t)RTE_PORT_ALL) {
> +		struct rte_eth_rss_conf rss_conf =3D {0};
>  		struct rte_eth_dev_info info;
>  		int ret2;
>=20
> @@ -4178,6 +4179,13 @@ parse_vc_action_rss(struct context *ctx, const
> struct token *token,
>  		action_rss_data->conf.key_len =3D
>  			RTE_MIN(sizeof(action_rss_data->key),
>  				info.hash_key_size);
> +
> +		rss_conf.rss_key_len =3D sizeof(action_rss_data->key);
> +		rss_conf.rss_key =3D action_rss_data->key;
> +		ret2 =3D rte_eth_dev_rss_hash_conf_get(ctx->port,
> &rss_conf);
> +		if (ret2 !=3D 0)
> +			return ret2;
> +		action_rss_data->conf.key =3D rss_conf.rss_key;
>  	}
>  	action->conf =3D &action_rss_data->conf;
>  	return ret;
> --
> 2.7.4