From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00080.outbound.protection.outlook.com [40.107.0.80]) by dpdk.org (Postfix) with ESMTP id B0D502C28 for ; Sun, 7 Oct 2018 13:21:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M+upaDYy7yRDufJ5zuRxp81BCoWTt/xblDQnCQHhbrY=; b=SLc/xA1exA67dPD7v0hj4rRRZiSoOyw8Up3Ukjbun+2JyDZYBkEdghbXyRVnxPyv+aJxp4/rmbk9sWiXgPWofmdGHmkHdMSA60XkpsIgc4/asN1cFCdljIM7gpYReoCH8yDcCEud1nB62xrQaAlmaprK+Tru/e+nzWirdwpQ//c= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4203.eurprd05.prod.outlook.com (52.134.107.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.26; Sun, 7 Oct 2018 11:21:26 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::9821:3dbc:f774:1c28]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::9821:3dbc:f774:1c28%4]) with mapi id 15.20.1185.029; Sun, 7 Oct 2018 11:21:26 +0000 From: Shahaf Shuler To: Yongseok Koh , Ophir Munk CC: "dev@dpdk.org" , Asaf Penso , Thomas Monjalon , Olga Shern Thread-Topic: [PATCH] net/mlx5: set RSS key len 0 to indicate default RSS Thread-Index: AQHUWz/ESBH47HIm1UmG4BuA5+cC8KUN3w0AgAXHJuA= Date: Sun, 7 Oct 2018 11:21:26 +0000 Message-ID: References: <1538588246-21436-1-git-send-email-ophirmu@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4203; 6:WR/KrIJAVNafI1+R4hr/LX5sdWTbyxlayiSBxBLvmw5VKH5CF/3rlTDMy5jcRxoYnEMpAEH11ThcT5d2Y2D/3SfBFX1mzk8dCFztQ022tM2uFOGWRZH8hdCEyHkDu3v6XovIwPEbfDSSGjHD5Q5/WV9nw0w59smXhSg38zEvz9b8+xGQvsLSM/+85IMZ91eQ6nYjtpMHCHPJ3WaY/kYDZqhG3gGkHpp0X0VGjBFPgc1pu1SkQq6umSKL15sz4G69/SerwDrrkFPzaCteN6khzn/AlIrlKd9yvz/HLoY/Cm7BkW+BTN1fSE/3BbBSPgsoLOoyd1Tv71AcOacHGeSreqSybsEf/c9orgs2BYL6qClHQgYqH9lRw3mHLGcT3yCV6L7yQE+pyUm4kUm2hwS8klR9icsp7xEcfNIlZvZYyZGk2QAMJJMgd6Bv5pJ+Y57PNa2g0lkMh3ABMPyee9Ui3A==; 5:Zbm+Ni2KrAIIS6llltyVTgRujxfjfCzkMajrU7DbCzEwee5jAZk7VOwOaxD+ThtRvAvmwNn0pYqEcvDYBlwv4ghrWs9DhQ2HH0nXe3ZGYMTOgiO485fB/yhUTvPdP1c4RsnVggURbWeu6JfwUqMkMWuT/1oDpPuCcjv+QjmBack=; 7:nDVZiJnUEmoE7mpZ24O6Kvv1qJXV7HN5VEhvK+bnWMfi9RJxX/IA7WZWby77cm1/LEX1JDf8NiU1L6iC8Fqmwf/kiJklVW07EOu2/HC/vjZ8EYNvs5VjX8rXVXzGnMbfPddcAho4gCjddxiKuNE8mkMh3PWgBU5D1Z8cOkbGSpSRIIylZ+OUA2NWQo+RHD1vzX+Z30EdIiEiN4y9FW4GBkqUWVMzKBZ7J3c9klI0+Z5F9cwGoa4NEmD++++069oz x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: a47e367a-f28e-4298-6135-08d62c4705a8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4203; x-ms-traffictypediagnostic: DB7PR05MB4203: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991055); SRVR:DB7PR05MB4203; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4203; x-forefront-prvs: 0818724663 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39850400004)(366004)(346002)(136003)(376002)(189003)(199004)(229853002)(25786009)(5250100002)(33656002)(71200400001)(71190400001)(54906003)(5660300001)(26005)(66066001)(186003)(9686003)(55016002)(446003)(4326008)(53936002)(97736004)(478600001)(6436002)(11346002)(110136005)(476003)(486006)(76176011)(7696005)(53546011)(6506007)(6246003)(14454004)(6636002)(256004)(14444005)(8676002)(81156014)(99286004)(81166006)(305945005)(68736007)(86362001)(2900100001)(6116002)(3846002)(7736002)(74316002)(8936002)(106356001)(105586002)(107886003)(102836004)(316002)(2906002)(6346003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4203; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-microsoft-antispam-message-info: pegZWhiQd9Q155WlOxoXtck6rgzuSAqSlDQPaD7lyYXZz01rGWEmPvT9qi6wvbkbrUi2A41Qlel2Ff/dZpbtOeGdxQHN/nxT3/+vkDkRFhgphKKazlVBIP14PW6Ao6uEbH3mrEpxjKVX96fJMa/Ru717pZV/aIDS2ZdBsyRbIPwmzHaStR7Vmp49qE/PjYxyiaBEQABSyNESns7hd10FXhoZrP6AjENdJzDQgWCWfUASlawKEWNBtUYdcMh062vqUCQBKcxvnYOYc+ueJpPZaxQNXGgR/FOsj+aOETN4+fxB+A9Ogld+PvUUE0LB10Cz3zK4HPiZ3N/PdD//uZGHytupDXZYhyt4aJxgg0tTj44= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: a47e367a-f28e-4298-6135-08d62c4705a8 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2018 11:21:26.7103 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4203 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: set RSS key len 0 to indicate default RSS 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: , X-List-Received-Date: Sun, 07 Oct 2018 11:21:27 -0000 Hi Ophir, To add on top of Koh's comment Wednesday, October 3, 2018 9:56 PM, Yongseok Koh: > Subject: Re: [PATCH] net/mlx5: set RSS key len 0 to indicate default RSS > > On Oct 3, 2018, at 10:37 AM, Ophir Munk > wrote: > > > > Applications which add an RSS flow must supply an RSS key table and an > > RSS key length. If an application needs to add the default RSS flow it > > should not care about the exact RSS default key table and its length. > > By setting key length to 0 - the PMD will know that it should use the > > default RSS key table and length. Can you refer where in the rte_flow API this is documented? I couldn't fin= d it under struct rte_flow_action_rss definition.=20 I agree it is better for the PMD to behave this way, but this should be exp= lained in the API, so for this patch to be accepted we need also doc update= in rte_flow.h. In my opinion, it is better for the key to be NULL to request from the PMD = to use the default key, similar to struct rte_eth_rss_conf.=20 > > > > Signed-off-by: Ophir Munk > > --- > > drivers/net/mlx5/mlx5_flow.c | 7 ++++--- >=20 > Please rebase the code on top of the latest dpdk-next-net-mlx. > Actually, it is better to rebase on top of PR#878. >=20 > Thanks, > Yongseok >=20 > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_flow.c > > b/drivers/net/mlx5/mlx5_flow.c index 3f548a9..18eacf5 100644 > > --- a/drivers/net/mlx5/mlx5_flow.c > > +++ b/drivers/net/mlx5/mlx5_flow.c > > @@ -2062,7 +2062,8 @@ struct mlx5_flow_tunnel_info { > > > RTE_FLOW_ERROR_TYPE_ACTION_CONF, > > &rss->level, > > "tunnel RSS is not supported"); > > - if (rss->key_len < MLX5_RSS_HASH_KEY_LEN) > > + /* key_len 0 means using default RSS key */ > > + if (rss->key_len > 0 && rss->key_len < MLX5_RSS_HASH_KEY_LEN) > > return rte_flow_error_set(error, ENOTSUP, > > > RTE_FLOW_ERROR_TYPE_ACTION_CONF, > > &rss->key_len, > > @@ -2106,7 +2107,7 @@ struct mlx5_flow_tunnel_info { > > memcpy((*flow->queue), rss->queue, > > rss->queue_num * sizeof(uint16_t)); > > flow->rss.queue_num =3D rss->queue_num; > > - memcpy(flow->key, rss->key, MLX5_RSS_HASH_KEY_LEN); > > + memcpy(flow->key, rss->key, rss->key_len); In Mellanox devices 40B of a key is a must. If you intended to copy 0 bytes= , it is better to do it in other ways.=20 =20 > > flow->rss.types =3D rss->types; > > flow->rss.level =3D rss->level; > > flow->fate |=3D MLX5_FLOW_FATE_RSS; > > @@ -2948,7 +2949,7 @@ struct mlx5_flow_tunnel_info { > > flow->rss.queue_num); > > if (!hrxq) > > hrxq =3D mlx5_hrxq_new(dev, flow->key, > > - > MLX5_RSS_HASH_KEY_LEN, > > + flow->rss.key_len, > > verbs->hash_fields, > > (*flow->queue), > > flow->rss.queue_num, > > -- > > 1.8.3.1 > >