Message ID | 20171105154449.93962-1-shahafs@mellanox.com (mailing list archive) |
---|---|
State | Superseded, archived |
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 760D71B2CA; Sun, 5 Nov 2017 16:45:13 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0051.outbound.protection.outlook.com [104.47.1.51]) by dpdk.org (Postfix) with ESMTP id C8E3B1B2B7 for <dev@dpdk.org>; Sun, 5 Nov 2017 16:45:11 +0100 (CET) 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=n1QNFtDuqwhf21J+ENXkp3ymJ5FVDc5Mg6nXQ1c8L88=; b=MvEgB7KdF+gpWSXzveSt5PRd9kl1FH3uPuPUp+9MiscfB2BP14AU+hbtuwDIxr0i4i+NP1suWrkKqHjVb0WySr9tNYBO03RlBMU9yZQAk4KMPVPv/YZPb4A364MOlYqsfCXgTPZ9kEYOfpReBEJW7vy4qFP8+bKb5/s/RbFLfls= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Sun, 5 Nov 2017 15:45:09 +0000 From: Shahaf Shuler <shahafs@mellanox.com> To: nelio.laranjeiro@6wind.com, yskoh@mellanox.com, adrien.mazarguil@6wind.com Cc: dev@dpdk.org Date: Sun, 5 Nov 2017 17:44:49 +0200 Message-Id: <20171105154449.93962-1-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: VI1PR08CA0125.eurprd08.prod.outlook.com (2603:10a6:800:d4::27) To VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 801e4fd8-c513-44de-7160-08d524643278 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:VI1PR05MB3149; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 3:hcQTzzXpPjJmaWqMsm+ps7BzKXrcpgfyrt4EQ5Yvqca3THcO7s1edrp3pvbh3OURkvnrCafYzjoVFJRPQPO4mNdxs2G+GBziMeoMLzKco1x4BRmA+QIgGxmn8iOoorLF5Mfm1TVirnmJRd3NmuxYHLzD5uDabcTHUyCwb2xP1buyhNIuT480LuMSF/cvnxVBkhbAE+nJAqc/R1P2HSzm6dUwHCIqtvUsVDhqvr7HameCaXosDIZMk+TrOnnAcfZU; 25:h2WutaAwV2HrAE3EFewby73wP1hoqiaHX4sosWG231vAflRizFrYuY53A9PddLxqwU0Scr/J2YaX42RuO90Fxufc/a5lPYt4VpHCEF9VVr8JS5Tm1YwxFf8pSgjy1lWq/Iif9ef1CwcMY5NZ41bLaniUrWP6kpZgLUQktYfLi2G2htG6o3XYuqzKpSQN7hyWSjwDk3VADw2pzkK6NKvhLMdhTRZNm2nMnkNUwB2oz7YcD8zorbzch5ZTtsofnxmcQFpk+PW7w0NvrGwyiYaojXoAwZNXlgMlq49pYFJLVv1/z5vJhgCt/sYSnXKH8gzljxS14GvVs6HMX7cwcAH0cw==; 31:36IDEJ6TjTn3GuIy+JtLuWJt8IpaeYchZ5ze3Ljza/K9mFnhnNN0JW0w8BqEUxIDba5WaR/72HvYNGAo9iSB93bSsYVNXSFVTlM7fpDrrmVLl0ciSrio93v/Au7kFyKiFP4CzXu2/QLT8E2N5p+r8ehuJH/xisaNZUT71llEZ+UrwIV1Y503KpGtnwDHw6swOG3JgwM9rkBUhcmK9JBrnO5c3ntsBxrRsc1g/cx7V0A= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:lz1z3De6TE7vnjocAUdHX4ZUmcueRrpHrj9sYsQk32ZD4r8IXboAwDZBQ3Q+JmxNG3dg5otqsmMGLQtvRRf7FxqsRuG0Z61gdzP3dgMQLZMoScmXBwr5NdnJhEvEmH7AIwPw4HOVg76mhyabkdIBN0AelprsOhe5Jv6Tghju2XNeYCZdgoLqKYuDSnmoXiP/XFV9MPbTCxidoMClfXTGeJKR7viPqlvAzz1xlxj/FqVlma1oe1702pvLfENEM3M5O7q1/FtX83Ew0rLRoJICYDPfEcDxqFyJSEHazDQgWgrRiy1rMjWt1ZV+dDAiE0X+7rcxSDJGZJ/RajV+gj+HeB5EkkbRMfLTNddS+VjmDx3Aux95Zg7eBjnSN66OY7kklccloazjwa+HxTH7VLu+C9qOKQ1qIP2FY+CCdemSmzIzHlufLbay3gdz4R9e8FI7mGd+Opy+XYtIdIyG3TaY1eDkoeh5yPcedHjvqz707kSxvsOJgtAPVd8FX0GYto3X; 4:gMyueiTUN7ipOyWBRHQG8GGDDmp5IMSdktiMcMwDjCJal71zvRjuv6I/Q0z7Pl4Jh+B0k+4jKSLX2DmsEPyXBfhkoOHnwcwln2HoYhErvKVl9d5VqtTVu6XPgBh0ojUfEBPG1aG+2vkUJcD5g+ZNT60nS/BzQaWkp0K/QZrsiqCi6ivuIxBRx+DiI6gts8tjfr4S5nL1NJSKnqPoUAlsfBbsA4ARCLISrJJTLOCoyx9Qwh2CQb+2JGeGuHYUEwZLwp7hrdhvHmBYBhOLCQznJg== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: <VI1PR05MB3149E2ABE8BA01FF55526901C3530@VI1PR05MB3149.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(3231021)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR05MB3149; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR05MB3149; X-Forefront-PRVS: 04825EA361 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(189002)(199003)(16586007)(8936002)(36756003)(2906002)(8676002)(5660300001)(81156014)(81166006)(50226002)(101416001)(316002)(50986999)(3846002)(21086003)(189998001)(1076002)(4326008)(53936002)(106356001)(16526018)(305945005)(7736002)(6116002)(33026002)(55016002)(478600001)(5003940100001)(575784001)(69596002)(86362001)(105586002)(47776003)(68736007)(66066001)(48376002)(50466002)(25786009)(6666003)(97736004)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3149; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB3149; 23:Fdk3T8qkkR+VxFOA/YKM6A7CmU5+KZmKcE6OPbKOU?= N0yk2OdOQB7LbfrOeTZ0LA5LvjeDw/Lhjkzc0w06eAAKA3eSeSl6AMckh4YL5t5oDUJ8Q0BHhZ0soowu6WGsgBxPeTd1m6RfGBAnZrryZrJtn259Sq8rSKUrtHbwv4PVq8ckkH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X/68nRVgIQOWNyMvSbI2YMBS37B4S0OPuhH1bho4vbxa4vQHQdFC+79YcFkNCeRfIFPkXBzBs+G2Dk6+F6hx2ff7WjMj4weDjWhJBwXa0UgZttJ0bbC3jqA4qe7udoKI9AM7QDWqe/dpdKwOkYyySPpmW+21AapLSk7Hra227dzupPUG5Mm1Ba9Eu5FX4XZtu/+L3SDoKiuXdIoJTt0YsIuK1ihbjYdezuE6JZjhTITi3ETJ+loPy+hiwQMhk=; 5:/V0RduusEY9x/yLacQFe6nfTK31By15Piws5qms5b6ldojaGtbGpnWVzDQqss1O/5gsps1tdn4ess5At8LY1gSUwdxsNvX0OOzTBSFnBPGpPDpIHqOMUNSfjCNtoIpyEtL4Gi1/rgSTYP3K1dLnD3x+WKd/ewLyEC0P6wNz9v/A=; 24:K0dpahXHvWxM2HlS0v0+OkTVylLDaAb1QEg3xTspkQM98GhEfnC/0PWzjaqXQnYuirULTI2juCDHzbMTHyqcu03w6FBYovjgfDsDCWG1YgA=; 7:yW5fpN+3Hrlz42FgTraHRA3qJOzSyzz7JLFnDNfdF2vdrNu3f5sOCCua3uSpPy8H6cIbUVMCIgV6cXSPQLwInujqiTBCURN4GyQnv82e8RZ1w0qgWH2huAlw7Hcm+A26WQRs76sMDISS9cEXlGdGAn/+XbqchCLniv53VTJ+JDYcRrvjPd2WOCeGF0UnU4KBDSUrpyLokdKfXRV6rQ3fdrxZDmEbj/OAKd9KtVQFxHyKNw6ozKs+dnadV/NPStuI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2017 15:45:09.9408 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 801e4fd8-c513-44de-7160-08d524643278 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3149 Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow creation on port start X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/Intel-compilation | success | Compilation OK |
Commit Message
Shahaf Shuler
Nov. 5, 2017, 3:44 p.m. UTC
While the PMD avoids from creating hash RXQ with no hash fields and
array of queues after the port was allready started, it lacks such
protection when re-creating the flows after the port restarts.
This may lead to inconsist behaviour for flows depending if they were
created before or after the port start.
Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
Cc: nelio.laranjeiro@6wind.com
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
Comments
Hi Shahaf, On Sun, Nov 05, 2017 at 05:44:49PM +0200, Shahaf Shuler wrote: > While the PMD avoids from creating hash RXQ with no hash fields and > array of queues after the port was allready started, it lacks such > protection when re-creating the flows after the port restarts. > > This may lead to inconsist behaviour for flows depending if they were > created before or after the port start. > > Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow") > Cc: nelio.laranjeiro@6wind.com > > Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> > --- > drivers/net/mlx5/mlx5_flow.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 5f49bf5ff..b0a196a4b 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -2290,22 +2290,27 @@ priv_flow_start(struct priv *priv, struct mlx5_flows *list) > continue; > } > for (i = 0; i != hash_rxq_init_n; ++i) { > + uint64_t hash_fields = hash_rxq_init[i].hash_fields; > if (!flow->frxq[i].ibv_attr) > continue; > flow->frxq[i].hrxq = > mlx5_priv_hrxq_get(priv, flow->rss_conf.rss_key, > flow->rss_conf.rss_key_len, > - hash_rxq_init[i].hash_fields, > + hash_fields, > (*flow->queues), > - flow->queues_n); > + hash_fields ? > + flow->queues_n : > + 1); > if (flow->frxq[i].hrxq) > goto flow_create; > flow->frxq[i].hrxq = > mlx5_priv_hrxq_new(priv, flow->rss_conf.rss_key, > flow->rss_conf.rss_key_len, > - hash_rxq_init[i].hash_fields, > + hash_fields, > (*flow->queues), > - flow->queues_n); > + hash_fields ? > + flow->queues_n : > + 1); > if (!flow->frxq[i].hrxq) { > DEBUG("Flow %p cannot be applied", > (void *)flow); > -- > 2.12.0 I would suggest to modify directly the mlx5_priv_hrxq_get() and mlx5_priv_hrxq_new() to handle this and update the comment of both functions, as the two places where those are called are tricking the queue numbers the same way, it can be directly handled by the function itself. Thanks,
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5f49bf5ff..b0a196a4b 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2290,22 +2290,27 @@ priv_flow_start(struct priv *priv, struct mlx5_flows *list) continue; } for (i = 0; i != hash_rxq_init_n; ++i) { + uint64_t hash_fields = hash_rxq_init[i].hash_fields; if (!flow->frxq[i].ibv_attr) continue; flow->frxq[i].hrxq = mlx5_priv_hrxq_get(priv, flow->rss_conf.rss_key, flow->rss_conf.rss_key_len, - hash_rxq_init[i].hash_fields, + hash_fields, (*flow->queues), - flow->queues_n); + hash_fields ? + flow->queues_n : + 1); if (flow->frxq[i].hrxq) goto flow_create; flow->frxq[i].hrxq = mlx5_priv_hrxq_new(priv, flow->rss_conf.rss_key, flow->rss_conf.rss_key_len, - hash_rxq_init[i].hash_fields, + hash_fields, (*flow->queues), - flow->queues_n); + hash_fields ? + flow->queues_n : + 1); if (!flow->frxq[i].hrxq) { DEBUG("Flow %p cannot be applied", (void *)flow);