From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0077.outbound.protection.outlook.com [104.47.2.77]) by dpdk.org (Postfix) with ESMTP id 3308F1B22A for ; Mon, 21 May 2018 20:20:22 +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=pjBLEwNvDpP+2CKAMk/3iOX2NWurLrEoKWc6yylkxQ8=; b=sS7PYAlPmy8YvsxIP4zoS6riuoCLZRacRVSTnkfk5tXVjyEFycxrxSqMJRUsyfTsdRnBYbjaK9Pq2OJVzDWZNeLTwWAqYrTK8f4D/ogpjRae/ba+dAm+vqYSjQFAhbUhWanzj8RTA6u0rexnFWyFYgWtk7mQps7Dco5Xvv9579U= Received: from HE1PR0501MB2314.eurprd05.prod.outlook.com (10.168.34.19) by HE1PR0501MB2409.eurprd05.prod.outlook.com (10.168.125.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.16; Mon, 21 May 2018 18:20:18 +0000 Received: from HE1PR0501MB2314.eurprd05.prod.outlook.com ([fe80::1071:70d0:eac1:5d97]) by HE1PR0501MB2314.eurprd05.prod.outlook.com ([fe80::1071:70d0:eac1:5d97%18]) with mapi id 15.20.0776.015; Mon, 21 May 2018 18:20:18 +0000 From: Ophir Munk To: Adrien Mazarguil CC: "dev@dpdk.org" , Thomas Monjalon , "Olga Shern" , Shahaf Shuler Thread-Topic: [PATCH v1] net/mlx4: add an RSS hash update callback Thread-Index: AQHT7c7hwbYHJKAJL0u6zqYYpdYvEaQ6YEeAgAAjh8A= Date: Mon, 21 May 2018 18:20:18 +0000 Message-ID: References: <1526555080-19259-1-git-send-email-ophirmu@mellanox.com> <20180521160825.GU6497@6wind.com> In-Reply-To: <20180521160825.GU6497@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0501MB2409; 7:QGGfPg9m9PFNByN+inpLioOh2VqBaX1fV48wM+qcUjxvBTZsZMk2qxBFLWVpnSYiyUKgJZ6uw9VGIaRQ9+0AAv3U2mzpjFPp6ko7IyRhNXxE4VwNHSGIdTNS09kRjvh9tC7Jf14B0H+c4o9sdHzEnEBOH18PNm7Dz4sLxa/PUKC4C5kbFz0vAO27LEBEjMoZ4nAwZnMajJDO8fu5H1u5tU0RhOKNOZMtc1rBzT6XSKkwhwIsZ9mhsvOde3eBl6Jv x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0501MB2409; x-ms-traffictypediagnostic: HE1PR0501MB2409: 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)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:HE1PR0501MB2409; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2409; x-forefront-prvs: 06793E740F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(376002)(39380400002)(346002)(366004)(189003)(13464003)(199004)(53546011)(54906003)(9686003)(107886003)(59450400001)(486006)(476003)(3846002)(6116002)(25786009)(33656002)(74316002)(55016002)(5250100002)(2906002)(6246003)(97736004)(5660300001)(66066001)(102836004)(4326008)(2900100001)(6506007)(86362001)(229853002)(15650500001)(7696005)(68736007)(76176011)(6916009)(478600001)(186003)(3660700001)(316002)(14454004)(7736002)(105586002)(106356001)(305945005)(81166006)(81156014)(446003)(8936002)(53936002)(8676002)(26005)(3280700002)(99286004)(6436002)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2409; H:HE1PR0501MB2314.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:3; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: MSQZpP8lMX6QhOOL0XPea25MG444u1lj+HEWuxagC3wKu01MmVhmCpJoc020eVst9xBbV0yq//CMzRxPkdgpnBv+hvL6QSPjvivZKjD1Ii5/K7l1AYP9NZyBob48afKppmzjNdorM6Nn17GQupza7lvQbqCfx47mIeJZo+MxvdOrPkvdgyOVUzCMN+WkRvt/ spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: d493bc6c-a0d9-4523-8467-08d5bf47821d X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d493bc6c-a0d9-4523-8467-08d5bf47821d X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2018 18:20:18.8255 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2409 Subject: Re: [dpdk-dev] [PATCH v1] net/mlx4: add an RSS hash update callback 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: Mon, 21 May 2018 18:20:22 -0000 For 18.05 this path can be withdrawn.=20 It has already been suppressed a few days ago. Thanks, Ophir > -----Original Message----- > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > Sent: Monday, May 21, 2018 7:08 PM > To: Ophir Munk > Cc: dev@dpdk.org; Thomas Monjalon ; Olga Shern > ; Shahaf Shuler > Subject: Re: [PATCH v1] net/mlx4: add an RSS hash update callback >=20 > On Thu, May 17, 2018 at 11:04:40AM +0000, Ophir Munk wrote: > > Add an RSS hash update callback to eth_dev_ops. > > > > Signed-off-by: Ophir Munk >=20 > This patch allows applications to configure legacy RSS past initial port > configuration, but doesn't take input parameters into account. Its purpos= e is > to silence errors instead of telling users it's unsupported. >=20 > For this reason, I suggest to either withdraw this patch entirely, or ful= ly > implement legacy RSS configuration by making rss_hash_update more than a > no-op and by adding rss_hash_conf_get, reta_update and reta_query as part > of the same task for completeness. >=20 > > --- > > drivers/net/mlx4/Makefile | 1 + > > drivers/net/mlx4/mlx4.c | 1 + > > drivers/net/mlx4/mlx4.h | 7 ++++++ > > drivers/net/mlx4/mlx4_rss.c | 59 > > +++++++++++++++++++++++++++++++++++++++++++++ > > 4 files changed, 68 insertions(+) > > create mode 100644 drivers/net/mlx4/mlx4_rss.c > > > > diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile > > index 73f9d40..eb89f6b 100644 > > --- a/drivers/net/mlx4/Makefile > > +++ b/drivers/net/mlx4/Makefile > > @@ -23,6 +23,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) +=3D > mlx4_rxq.c > > SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) +=3D mlx4_rxtx.c > > SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) +=3D mlx4_txq.c > > SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) +=3D mlx4_utils.c > > +SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) +=3D mlx4_rss.c > > > > ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS),y) > > INSTALL-$(CONFIG_RTE_LIBRTE_MLX4_PMD)-lib +=3D $(LIB_GLUE) diff --git > > a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index > > 9f8ecd0..7000511 100644 > > --- a/drivers/net/mlx4/mlx4.c > > +++ b/drivers/net/mlx4/mlx4.c > > @@ -261,6 +261,7 @@ static const struct eth_dev_ops mlx4_dev_ops =3D { > > .flow_ctrl_get =3D mlx4_flow_ctrl_get, > > .flow_ctrl_set =3D mlx4_flow_ctrl_set, > > .mtu_set =3D mlx4_mtu_set, > > + .rss_hash_update =3D mlx4_rss_hash_update, > > .filter_ctrl =3D mlx4_filter_ctrl, > > .rx_queue_intr_enable =3D mlx4_rx_intr_enable, > > .rx_queue_intr_disable =3D mlx4_rx_intr_disable, diff --git > > a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index > > 300cb4d..6842a71 100644 > > --- a/drivers/net/mlx4/mlx4.h > > +++ b/drivers/net/mlx4/mlx4.h > > @@ -50,6 +50,9 @@ > > /** Port parameter. */ > > #define MLX4_PMD_PORT_KVARG "port" > > > > +/** Supported RSS. */ > > +#define MLX4_RSS_HF_MASK (~(ETH_RSS_IP | ETH_RSS_UDP | > ETH_RSS_TCP)) > > + > > enum { > > PCI_VENDOR_ID_MELLANOX =3D 0x15b3, > > }; > > @@ -144,4 +147,8 @@ void mlx4_rxq_intr_disable(struct priv *priv); > > int mlx4_rx_intr_disable(struct rte_eth_dev *dev, uint16_t idx); int > > mlx4_rx_intr_enable(struct rte_eth_dev *dev, uint16_t idx); > > > > +/* mlx4_rss.c */ > > + > > +int mlx4_rss_hash_update(struct rte_eth_dev *dev, > > + struct rte_eth_rss_conf *rss_conf); > > #endif /* RTE_PMD_MLX4_H_ */ > > diff --git a/drivers/net/mlx4/mlx4_rss.c b/drivers/net/mlx4/mlx4_rss.c > > new file mode 100644 index 0000000..656a00d > > --- /dev/null > > +++ b/drivers/net/mlx4/mlx4_rss.c > > @@ -0,0 +1,59 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright 2015 6WIND S.A. > > + * Copyright 2015 Mellanox Technologies, Ltd */ > > + > > +#include > > +#include > > +#include > > +#include > > + > > +/* Verbs headers do not support -pedantic. */ > > +/* ISO C doesn't support unnamed structs/unions, disabling -pedantic. > > +*/ #ifdef PEDANTIC #pragma GCC diagnostic ignored "-Wpedantic" > > +#endif > > +#include > > +#ifdef PEDANTIC > > +#pragma GCC diagnostic error "-Wpedantic" > > +#endif > > + > > +#include "mlx4.h" > > +#include "mlx4_flow.h" > > +#include "mlx4_utils.h" > > + > > +/** > > + * DPDK callback to update the RSS hash configuration. > > + * > > + * @param dev > > + * Pointer to Ethernet device structure. > > + * @param[in] rss_conf > > + * RSS configuration data. > > + * > > + * @return > > + * 0 on success, a negative errno value otherwise and rte_errno is s= et. > > + */ > > +int > > +mlx4_rss_hash_update(struct rte_eth_dev *dev, > > + struct rte_eth_rss_conf *rss_conf) { > > + /* > > + * limitation: MLX4 supports all of IP, UDP and TCP hash > > + * functions together and not in partial combinations > > + * Just make sure no unsupported HF is requested > > + */ > > + if (rss_conf->rss_hf & MLX4_RSS_HF_MASK) { > > + rte_errno =3D EINVAL; > > + return -rte_errno; > > + } > > + if (rss_conf->rss_key && rss_conf->rss_key_len) { > > + /* > > + * Currently mlx4 RSS key cannot be updated > > + */ > > + ERROR("port %u RSS key cannot be updated", > > + dev->data->port_id); > > + rte_errno =3D EINVAL; > > + return -rte_errno; > > + } > > + return 0; > > +} > > -- > > 2.7.4 > > >=20 > -- > Adrien Mazarguil > 6WIND