Message ID | 1532530059-7319-1-git-send-email-motih@mellanox.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Shahaf Shuler |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2367F2C60; Wed, 25 Jul 2018 16:48:10 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50049.outbound.protection.outlook.com [40.107.5.49]) by dpdk.org (Postfix) with ESMTP id 508BA2BAC for <dev@dpdk.org>; Wed, 25 Jul 2018 16:47:55 +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=SzgYroG+QrUOc04u9Igg6aYxGPXDx1W0AOaajC+AcaU=; b=ce1z838S5YNOD74Ga8N9xGTtfLenYG0vnmcAPPJFgUzYbRnDypw+F9Lt4ajXLgu4yL2b4LeeJQ+fOgVuX1Ra8MEavbekwRoOrNDFp5cl4hdzWGZJIMOQVU3itz1iip2wER2YYqHHt8pKgkouB9TIdzaGACYNfjeUBz9d1Ncauww= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; Received: from localhost.localdomain (37.142.13.130) by VI1PR05MB4448.eurprd05.prod.outlook.com (2603:10a6:803:43::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 14:47:53 +0000 From: Moti Haimovsky <motih@mellanox.com> To: matan@mellanox.com Cc: dev@dpdk.org, Moti Haimovsky <motih@mellanox.com> Date: Wed, 25 Jul 2018 17:47:39 +0300 Message-Id: <1532530059-7319-1-git-send-email-motih@mellanox.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: AM4PR05CA0023.eurprd05.prod.outlook.com (2603:10a6:205::36) To VI1PR05MB4448.eurprd05.prod.outlook.com (2603:10a6:803:43::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c770616b-7274-4ecb-ed32-08d5f23d9a97 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4448; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4448; 3:oPaHDdq/5YgL8kCIsIFi/bC6VGM9D2oGBBTeb9aAchBTzuAm1w+bA9ke4u8xmu0q5e3dHQ7Jgg/xJYdsCS3yPlvu5cBofWJxadXqcdJIoBMVyVK2W5L/d4kSJFlazDJqTYVrS++uOnN2GM3r1s7yETzMU8tVIaYNpe8MHMnXXZf16+Elo7pID8XpfkvJle2BowTwoLLAagVPK8T2UZ4iPqfEHnB3D8w6Iyw9poRzSJZ1dfhConrgF0Pl7G/WaFom; 25:pWUWhgOUvo/6frOKkrX4ayzBbfJ8h8/Yil6KFwcS7gYa0rAaTciwqQ3trBv7N1ZZtAhP004jMjBClFmhMMl0cWedSM+BArThlKvG5K3FNgoFuT946B0sj9EnWOw56QTCBcbxKngMZxutWDjs2rl8/our4DjooWOKk6ZRV9lu3hEaA9JQcZJy6RoGUYN4xQa7kdYsVeF94b5O616z95n0zwmn+mrRE+kBbtBJ+dg4hXQ4QmRHQfAeUptHsB/ZJutBUkx5Lq1JOH0nuc7Ou4FiPPbfButy1UYp9HxnUYsEIzFRrw3jkXzXY/4AbBT/AFpspEcpRKErBVJSeXUtuxTA2A==; 31:HvPr5IBIcL0clNO0YRG2jBuf8nXlLK0R2N7BnUvgSoZh2AtBDdUuVD//f+8kIPAsrKf1qP+IQyI0XNjeXG0p2RrgCFgsdWWbKYwqdyFk1wFs6EVyyXr8O0DaEAXz7DhMV7Mf5pSlelkyvnPmP6Ha610mfNiIglFNaVcVAYwuvcJ0ahspJWQCSYi4AAMOgvWgPZvslt4Mow0UOzOApVFS3yCY8SaeXfxmSI2oIAuP7V0= X-MS-TrafficTypeDiagnostic: VI1PR05MB4448: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4448; 20:U6rCcl5GZr0C+y1Acg6prVuIDj0VJpqUH+K5a9F91mQK5gtjD3Iv3Rs/K7ic50QoUFERF7v0EutGeHEUk3+3IELZfg/lpqI3JD/+X3BT0QtL5vMPxvR9EY6+yKkBHgMMRrWqhghp896p1Q8bkN3dxCykFexIuZBJThFTIYyAQQuQPpbFPdkYIov2LbzpiV8AvJ+FquTF1ejaT3viW6KB2R94ooCi6P1wmIdaIHxJ/CH7fMY2ql7nzA4oYODeZtCfd579lYuVi/IVLaIXAwnz9HP/m9OVA0lQml9UXdr/bxuOfq9ZIYII4EKT/YeD1mujBAeHV1TXeydUEUfI86sc7r+w3IiiZ92lHAGiZv5eHM2uaM7H7X0TI43hBJzB2Oa62m+vjQsLiDUqhip7Nvr8C6FCCfMCNd9T9z0ApWOTXpjdYUHxf7tH+0ksB+FSXEOuj8h45sy8r171xJkYEprp169cCoSPIVLGq7tjtVuDY8f3usNeprUmdAtuzu9Mfb8u; 4:y4P4qLyh1lKvZFmQoLRvmAFQ1nrgjLfwB/hYP8MYvAgsVOqfqCPmnMWmjBG2DWfSFH5HShaaFYnMjebz2VA3FMUkmSx3jYnXImoDPHTLxtIO1kwMGyzFQpB+RXLIZTGT24t/zRdYHkg/Q/JBx7dEYX5hocJMTBXagcEi39b7FQIjEvcjmfGAQ96HA4bhdD8U4YripTLpcHi3REEHcAyIWxkqV+6NKyObWloSEuCIqUoV4Ofv0GhDWo/1x6SGiVcG4ktY9uZKqQASDXr+M5nCLw== X-Microsoft-Antispam-PRVS: <VI1PR05MB4448CF79F498677D94433D63D2540@VI1PR05MB4448.eurprd05.prod.outlook.com> 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)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4448; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4448; X-Forefront-PRVS: 0744CFB5E8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39860400002)(346002)(396003)(136003)(376002)(366004)(199004)(189003)(7736002)(97736004)(478600001)(316002)(105586002)(305945005)(8936002)(37006003)(8676002)(52116002)(47776003)(66066001)(48376002)(50466002)(81166006)(86362001)(81156014)(6512007)(106356001)(2361001)(16586007)(3846002)(51416003)(575784001)(1857600001)(486006)(36756003)(6116002)(6666003)(2616005)(6636002)(476003)(16526019)(956004)(4326008)(25786009)(6486002)(2351001)(53936002)(107886003)(386003)(6506007)(34206002)(50226002)(26005)(5660300001)(68736007)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4448; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB4448; 23:wc8kxXg/sP7v9Ddu35LKsenUPA7FNTeVptVZd13Wd?= pplhnMsvdH75mV1Y/oq+Q2Ful/OANtAS+2iFHA9fWa3MYzqHOUK7oTvnHEpbll0ukWecp0gSAyxxegvtGfq+kABb29XiT8D7c2nnJzZOcgIwdLlAmfcTdQaArVL3LqHnALxFNFjHDVNU7L0s0wb/c3+GDjMJ/aXMhbxJ4FlgmR0sI/pid9ScCfdQQ/V2RWhdlqOlw85XLEuKrVJbzrDy2HM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udELV5onxbcF96YTi8JIfH0AAwKnKwDZKLa6m+spmu2gShaowA7Ei7jPQ0flPwRZSLFz+WaLlX8Uym74bCRpPbFpr+qMUYv87UIx6mIrUoBxlsCfk8/J9grX2J3Alp5UAfv5lv0mgj5arQ6G75D/cZCWu1l/es6GzpwYFRpV1Le9rCBXCEp/JQyuIM1QY8TMmeBM2hQfIDyV+wc SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 14:47:53.7274 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c770616b-7274-4ecb-ed32-08d5f23d9a97 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4448 Subject: [dpdk-dev] [PATCH] net/mlx4: verify RSS supports num Rx Qs being used 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> |
Series |
net/mlx4: verify RSS supports num Rx Qs being used
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/Intel-compilation | success | Compilation OK |
Commit Message
Moti Haimovsky
July 25, 2018, 2:47 p.m. UTC
This patch verifies that the number of Rx queues configured for RSS
is supported by the device hardware.
RSS support in mlx4 requires contiguous chunk of QPs to be reserved,
there is a hardware limitation on the amount of contiguous QPs which
is reported by the hardware. Ignoring this value will cause Rx queues
creation to fail.
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
drivers/net/mlx4/mlx4.c | 3 +++
drivers/net/mlx4/mlx4.h | 1 +
drivers/net/mlx4/mlx4_rxq.c | 6 ++++++
3 files changed, 10 insertions(+)
Comments
Hi Moti Small comment below. From: Mordechay Haimovsky > This patch verifies that the number of Rx queues configured for RSS is > supported by the device hardware. > RSS support in mlx4 requires contiguous chunk of QPs to be reserved, there is a > hardware limitation on the amount of contiguous QPs which is reported by the > hardware. Ignoring this value will cause Rx queues creation to fail. > > Signed-off-by: Moti Haimovsky <motih@mellanox.com> > --- > drivers/net/mlx4/mlx4.c | 3 +++ > drivers/net/mlx4/mlx4.h | 1 + > drivers/net/mlx4/mlx4_rxq.c | 6 ++++++ > 3 files changed, 10 insertions(+) > > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index > c67d2c0..defc0d4 100644 > --- a/drivers/net/mlx4/mlx4.c > +++ b/drivers/net/mlx4/mlx4.c > @@ -673,6 +673,9 @@ struct mlx4_conf { > &device_attr_ex); > DEBUG("supported RSS hash fields mask: %016" PRIx64, > priv->hw_rss_sup); > + priv->hw_rss_max_qps = > + > device_attr_ex.rss_caps.max_rwq_indirection_table_size; > + DEBUG("MAX RSS queues %d", priv->hw_rss_max_qps); > priv->hw_fcs_strip = !!(device_attr_ex.raw_packet_caps & > > IBV_RAW_PACKET_CAP_SCATTER_FCS); > DEBUG("FCS stripping toggling is %ssupported", diff --git > a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index 89d8c38..e6fb934 > 100644 > --- a/drivers/net/mlx4/mlx4.h > +++ b/drivers/net/mlx4/mlx4.h > @@ -95,6 +95,7 @@ struct priv { > uint32_t hw_fcs_strip:1; /**< FCS stripping toggling is supported. */ > uint32_t tso:1; /**< Transmit segmentation offload is supported. */ > uint32_t tso_max_payload_sz; /**< Max supported TSO payload size. > */ > + uint32_t hw_rss_max_qps; /**< Max Rx Queues supported by RSS. */ > uint64_t hw_rss_sup; /**< Supported RSS hash fields (Verbs format). */ > struct rte_intr_handle intr_handle; /**< Port interrupt handle. */ > struct mlx4_drop *drop; /**< Shared resources for drop flow rules. */ > diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c index > 0cd9560..e8bef1d 100644 > --- a/drivers/net/mlx4/mlx4_rxq.c > +++ b/drivers/net/mlx4/mlx4_rxq.c > @@ -338,6 +338,12 @@ struct mlx4_rss * > > if (priv->rss_init) > return 0; > + if (priv->dev->data->nb_rx_queues > priv->hw_rss_max_qps) { > + ERROR("RSS does not support more than %d queues", > + priv->hw_rss_max_qps); > + rte_errno = EINVAL; What's about E2BIG ? > + return -rte_errno; > + } > /* Prepare range for RSS contexts before creating the first WQ. */ > ret = mlx4_glue->dv_set_context_attr > (priv->ctx, > -- > 1.8.3.1 Besides that; Acked-by: Matan Azrad <matan@mellanox.com>
Hi > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Matan Azrad > Sent: Thursday, July 26, 2018 5:36 PM > To: Mordechay Haimovsky <motih@mellanox.com> > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] net/mlx4: verify RSS supports num Rx Qs being > used > > Hi Moti > > Small comment below. > > From: Mordechay Haimovsky > > This patch verifies that the number of Rx queues configured for RSS is > > supported by the device hardware. > > RSS support in mlx4 requires contiguous chunk of QPs to be reserved, > > there is a hardware limitation on the amount of contiguous QPs which > > is reported by the hardware. Ignoring this value will cause Rx queues creation > to fail. > > > > Signed-off-by: Moti Haimovsky <motih@mellanox.com> > > --- > > drivers/net/mlx4/mlx4.c | 3 +++ > > drivers/net/mlx4/mlx4.h | 1 + > > drivers/net/mlx4/mlx4_rxq.c | 6 ++++++ > > 3 files changed, 10 insertions(+) > > > > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index > > c67d2c0..defc0d4 100644 > > --- a/drivers/net/mlx4/mlx4.c > > +++ b/drivers/net/mlx4/mlx4.c > > @@ -673,6 +673,9 @@ struct mlx4_conf { > > &device_attr_ex); > > DEBUG("supported RSS hash fields mask: %016" PRIx64, > > priv->hw_rss_sup); > > + priv->hw_rss_max_qps = > > + > > device_attr_ex.rss_caps.max_rwq_indirection_table_size; > > + DEBUG("MAX RSS queues %d", priv->hw_rss_max_qps); > > priv->hw_fcs_strip = !!(device_attr_ex.raw_packet_caps & > > > > IBV_RAW_PACKET_CAP_SCATTER_FCS); > > DEBUG("FCS stripping toggling is %ssupported", diff --git > > a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index > > 89d8c38..e6fb934 > > 100644 > > --- a/drivers/net/mlx4/mlx4.h > > +++ b/drivers/net/mlx4/mlx4.h > > @@ -95,6 +95,7 @@ struct priv { > > uint32_t hw_fcs_strip:1; /**< FCS stripping toggling is supported. */ > > uint32_t tso:1; /**< Transmit segmentation offload is supported. */ > > uint32_t tso_max_payload_sz; /**< Max supported TSO payload size. > > */ > > + uint32_t hw_rss_max_qps; /**< Max Rx Queues supported by RSS. */ > > uint64_t hw_rss_sup; /**< Supported RSS hash fields (Verbs format). */ > > struct rte_intr_handle intr_handle; /**< Port interrupt handle. */ > > struct mlx4_drop *drop; /**< Shared resources for drop flow rules. > > */ diff --git a/drivers/net/mlx4/mlx4_rxq.c > > b/drivers/net/mlx4/mlx4_rxq.c index 0cd9560..e8bef1d 100644 > > --- a/drivers/net/mlx4/mlx4_rxq.c > > +++ b/drivers/net/mlx4/mlx4_rxq.c > > @@ -338,6 +338,12 @@ struct mlx4_rss * > > > > if (priv->rss_init) > > return 0; > > + if (priv->dev->data->nb_rx_queues > priv->hw_rss_max_qps) { > > + ERROR("RSS does not support more than %d queues", > > + priv->hw_rss_max_qps); > > + rte_errno = EINVAL; > > What's about E2BIG ? My mistake, The description of E2BIG related to the argument list and not generally for too big parameters, so no need to change the EINVAL. > > + return -rte_errno; > > + } > > /* Prepare range for RSS contexts before creating the first WQ. */ > > ret = mlx4_glue->dv_set_context_attr > > (priv->ctx, > > -- > > 1.8.3.1 > > Besides that; > Acked-by: Matan Azrad <matan@mellanox.com>
Sunday, July 29, 2018 11:12 AM, Matan Azrad: > Subject: Re: [dpdk-dev] [PATCH] net/mlx4: verify RSS supports num Rx Qs > being used > > Hi Moti > > > > Small comment below. > > > > From: Mordechay Haimovsky > > > This patch verifies that the number of Rx queues configured for RSS > > > is supported by the device hardware. > > > RSS support in mlx4 requires contiguous chunk of QPs to be reserved, > > > there is a hardware limitation on the amount of contiguous QPs which > > > is reported by the hardware. Ignoring this value will cause Rx > > > queues creation > > to fail. > > > > > > Signed-off-by: Moti Haimovsky <motih@mellanox.com> Applied to next-net-mlx (with commit title change), thanks.
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index c67d2c0..defc0d4 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -673,6 +673,9 @@ struct mlx4_conf { &device_attr_ex); DEBUG("supported RSS hash fields mask: %016" PRIx64, priv->hw_rss_sup); + priv->hw_rss_max_qps = + device_attr_ex.rss_caps.max_rwq_indirection_table_size; + DEBUG("MAX RSS queues %d", priv->hw_rss_max_qps); priv->hw_fcs_strip = !!(device_attr_ex.raw_packet_caps & IBV_RAW_PACKET_CAP_SCATTER_FCS); DEBUG("FCS stripping toggling is %ssupported", diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index 89d8c38..e6fb934 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -95,6 +95,7 @@ struct priv { uint32_t hw_fcs_strip:1; /**< FCS stripping toggling is supported. */ uint32_t tso:1; /**< Transmit segmentation offload is supported. */ uint32_t tso_max_payload_sz; /**< Max supported TSO payload size. */ + uint32_t hw_rss_max_qps; /**< Max Rx Queues supported by RSS. */ uint64_t hw_rss_sup; /**< Supported RSS hash fields (Verbs format). */ struct rte_intr_handle intr_handle; /**< Port interrupt handle. */ struct mlx4_drop *drop; /**< Shared resources for drop flow rules. */ diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c index 0cd9560..e8bef1d 100644 --- a/drivers/net/mlx4/mlx4_rxq.c +++ b/drivers/net/mlx4/mlx4_rxq.c @@ -338,6 +338,12 @@ struct mlx4_rss * if (priv->rss_init) return 0; + if (priv->dev->data->nb_rx_queues > priv->hw_rss_max_qps) { + ERROR("RSS does not support more than %d queues", + priv->hw_rss_max_qps); + rte_errno = EINVAL; + return -rte_errno; + } /* Prepare range for RSS contexts before creating the first WQ. */ ret = mlx4_glue->dv_set_context_attr (priv->ctx,