From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20048.outbound.protection.outlook.com [40.107.2.48]) by dpdk.org (Postfix) with ESMTP id 9BD1F1BB1F for ; Thu, 10 May 2018 16:25:41 +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; bh=xGUDAalxwhyGebdxUsJr3Vp2Q4S/qy4zCxa1bqqLG0M=; b=AB/k6OPGOyinlmShzUR+NBRITmBqVeLAdXIQF5RVPlMvY1lPAyt2A5a/6DJmnujVipz/2+z+F25f6/eH2ZRLVZxA2/2c+3+hL+HhsIl/NnZ8mv/q8KwgyJw1J4MTGiKulVRU61p7MLkEedB7xIGyP9R0j5u/GUMd3rYhrOFg2fY= Received: from HE1PR0501MB2314.eurprd05.prod.outlook.com (10.168.34.19) by HE1PR0501MB2508.eurprd05.prod.outlook.com (10.168.126.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.18; Thu, 10 May 2018 14:25:38 +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.0735.021; Thu, 10 May 2018 14:25:38 +0000 From: Ophir Munk To: Shahaf Shuler , "dev@dpdk.org" , Adrien Mazarguil CC: Thomas Monjalon , Olga Shern Thread-Topic: [PATCH v2 1/2] net/mlx4: advertise supported RSS hash functions Thread-Index: AQHT5+Th1bRxxws0wEGH0iRVOEl126QobVMAgACYV1A= Date: Thu, 10 May 2018 14:25:38 +0000 Message-ID: References: <1525794195-25082-1-git-send-email-ophirmu@mellanox.com> <1525904821-17728-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: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; x-originating-ip: [85.250.111.138] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0501MB2508; 7:hBWrHerxPuF/9+vqKjGuyuaklOznC+0hLpZ7YuY2FNDEjzSSZaJCceKsswUSnL+I6Hz1WRgMERHyrDPHt8OvxySD3WHviE28VsQFjDqfwHfMyesgSt7wIQBKiMSOjnnslT36ti8Q539akUIenUoQluIwDUAAkgTaC0480tYsPVjfWMzGxoCaBxYc056oWezIZalgtqOH+8xHj5jY6NBtvt+eL//VdjisJKbn0cpqBJ1mz030JDU3npDOg9pPbkur 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)(2017052603328)(7153060)(7193020); SRVR:HE1PR0501MB2508; x-ms-traffictypediagnostic: HE1PR0501MB2508: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR0501MB2508; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2508; x-forefront-prvs: 066898046A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(39380400002)(396003)(39860400002)(13464003)(189003)(199004)(76176011)(54906003)(110136005)(316002)(2501003)(102836004)(7736002)(476003)(53546011)(25786009)(8936002)(105586002)(97736004)(106356001)(99286004)(14454004)(6506007)(26005)(3846002)(68736007)(6116002)(446003)(486006)(229853002)(5250100002)(86362001)(11346002)(81156014)(6436002)(3280700002)(2900100001)(33656002)(53936002)(4326008)(5660300001)(3660700001)(81166006)(55016002)(478600001)(66066001)(305945005)(8676002)(2906002)(6246003)(74316002)(9686003)(107886003)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2508; 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: DWIh88Xanx3LztFUAoGTEbWyxiU1+kHafxUj8iSi2x7STg9eajoR8svZJJ+kqGJERKHcvIKYGTuDKo8DUYogmSMKT91vF7gM/UpUDklq9UrwUHOR+JLWnAjBglGiRkN+QYEhJsahNi5IUf//RdkVX/axutLUtpeDAVcv6UV1oegSYK12ajyn03GUXFV8t3oh 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: 05daceab-f95b-4ea1-06c6-08d5b681e6f8 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05daceab-f95b-4ea1-06c6-08d5b681e6f8 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2018 14:25:38.3125 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2508 Subject: Re: [dpdk-dev] [PATCH v2 1/2] net/mlx4: advertise supported RSS hash functions 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: Thu, 10 May 2018 14:25:41 -0000 Hi, PATCH v3 was sent > -----Original Message----- > From: Shahaf Shuler > Sent: Thursday, May 10, 2018 8:20 AM > To: Ophir Munk ; dev@dpdk.org; Adrien > Mazarguil > Cc: Thomas Monjalon ; Olga Shern > > Subject: RE: [PATCH v2 1/2] net/mlx4: advertise supported RSS hash > functions >=20 > Hi Ophir, >=20 > Thursday, May 10, 2018 1:27 AM, Ophir Munk: > > Subject: [PATCH v2 1/2] net/mlx4: advertise supported RSS hash > > functions > > > > Advertise mlx4 supported RSS functions as part of dev_infos_get callbac= k. > > Previous to this commit RSS support was reported as none. Since the > > introduction of [1] it is required that all RSS configurations will be = verified. > > > > [1] commit 8863a1fbfc66 ("ethdev: add supported hash function check") > > > > Signed-off-by: Ophir Munk > > --- > > v1: > > Initial release > > v2: > > Split into 2 commits following reviews > > > > drivers/net/mlx4/mlx4_ethdev.c | 3 +++ > > drivers/net/mlx4/mlx4_flow.c | 49 > > ++++++++++++++++++++++++++++++++++++++++++ > > drivers/net/mlx4/mlx4_flow.h | 1 + > > 3 files changed, 53 insertions(+) > > > > diff --git a/drivers/net/mlx4/mlx4_ethdev.c > > b/drivers/net/mlx4/mlx4_ethdev.c index 9a76670..8fbb781 100644 > > --- a/drivers/net/mlx4/mlx4_ethdev.c > > +++ b/drivers/net/mlx4/mlx4_ethdev.c > > @@ -544,6 +544,7 @@ mlx4_mac_addr_set(struct rte_eth_dev *dev, > struct > > ether_addr *mac_addr) > > return mlx4_mac_addr_add(dev, mac_addr, 0, 0); } > > > > + >=20 > Remove this extra line. >=20 > > /** > > * DPDK callback to get information about the device. > > * > > @@ -587,6 +588,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, > struct > > rte_eth_dev_info *info) > > ETH_LINK_SPEED_20G | > > ETH_LINK_SPEED_40G | > > ETH_LINK_SPEED_56G; > > + info->flow_type_rss_offloads =3D mlx4_ibv_to_dpdk_rss_types( >=20 > I think better to ident mlx4_ibv_to_dpdk_rss_types to the line below alon= g > with hw_rss_sup >=20 > > + priv->hw_rss_sup); >=20 >=20 > > } > > > > /** > > diff --git a/drivers/net/mlx4/mlx4_flow.c > > b/drivers/net/mlx4/mlx4_flow.c index 397a150..41dac16 100644 > > --- a/drivers/net/mlx4/mlx4_flow.c > > +++ b/drivers/net/mlx4/mlx4_flow.c > > @@ -134,6 +134,55 @@ mlx4_conv_rss_types(struct priv *priv, uint64_t > > types) } > > > > /** > > + * Convert verbs RSS types to their DPDK equivalents. > > + * > > + * This function returns a group of RSS dpdk types given their > > +equivalent group > > + * of verbs types. > > + * For example both source IPv4 and destination IPv4 verbs types are > > +converted > > + * into their equivalent RSS group types. If each of these verbs > > +types existed > > + * exclusively - no conversion would take place. > > + * > > + * @param types > > + * RSS hash types in verbs format >=20 > Missing period >=20 > > + * > > + * @return > > + * A valid dpdk RSS hash fields supported by mlx4 (may return 0) >=20 > DPDK RSS hash fields supported by mlx4. is enough. >=20 > > + */ > > +uint64_t > > +mlx4_ibv_to_dpdk_rss_types(uint64_t types) { > > + enum { IPV4, IPV6, TCP, UDP, }; > > + const uint64_t in[] =3D { > > + [IPV4] =3D IBV_RX_HASH_SRC_IPV4 | > > IBV_RX_HASH_DST_IPV4, > > + [IPV6] =3D IBV_RX_HASH_SRC_IPV6 | > > IBV_RX_HASH_DST_IPV6, > > + [TCP] =3D IBV_RX_HASH_SRC_PORT_TCP | > > IBV_RX_HASH_DST_PORT_TCP, > > + [UDP] =3D IBV_RX_HASH_SRC_PORT_UDP | > > IBV_RX_HASH_DST_PORT_UDP, > > + }; > > + const uint64_t out[RTE_DIM(in)] =3D { > > + [IPV4] =3D (ETH_RSS_IPV4 | > > + ETH_RSS_FRAG_IPV4 | > > + ETH_RSS_NONFRAG_IPV4_OTHER), > > + [IPV6] =3D (ETH_RSS_IPV6 | > > + ETH_RSS_FRAG_IPV6 | > > + ETH_RSS_NONFRAG_IPV6_OTHER | > > + ETH_RSS_IPV6_EX), > > + [TCP] =3D (ETH_RSS_NONFRAG_IPV4_TCP | > > + ETH_RSS_NONFRAG_IPV6_TCP | > > + ETH_RSS_IPV6_TCP_EX), > > + [UDP] =3D (ETH_RSS_NONFRAG_IPV4_UDP | > > + ETH_RSS_NONFRAG_IPV6_UDP | > > + ETH_RSS_IPV6_UDP_EX), > > + }; > > + uint64_t conv =3D 0; > > + unsigned int i; > > + > > + for (i =3D 0; i !=3D RTE_DIM(in); ++i) > > + if ((types & in[i]) =3D=3D in[i]) >=20 > There is an issue with this logic. Sorry for not noticing in the previous= version. >=20 > Let's say the caps report support for only UDP, no IP. On the logic above= it > will report both ETH_RSS_NONFRAG_IPV4_UDP > ETH_RSS_NONFRAG_IPV6_UDP >=20 > It looks like for the L4 to be valid RSS hash it needs the l3 to be valid= . >=20 > > + conv |=3D out[i]; > > + return conv; > > +} > > + > > +/** > > * Merge Ethernet pattern item into flow rule handle. > > * > > * Additional mlx4-specific constraints on supported fields: > > diff --git a/drivers/net/mlx4/mlx4_flow.h > > b/drivers/net/mlx4/mlx4_flow.h index 2c8dff3..ec990df 100644 > > --- a/drivers/net/mlx4/mlx4_flow.h > > +++ b/drivers/net/mlx4/mlx4_flow.h > > @@ -49,6 +49,7 @@ struct rte_flow { > > /* mlx4_flow.c */ > > > > uint64_t mlx4_conv_rss_types(struct priv *priv, uint64_t rss_hf); > > +uint64_t mlx4_ibv_to_dpdk_rss_types(uint64_t ibv_rss_types); > > int mlx4_flow_sync(struct priv *priv, struct rte_flow_error *error); > > void mlx4_flow_clean(struct priv *priv); int mlx4_filter_ctrl(struct > > rte_eth_dev *dev, > > -- > > 2.7.4