From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0087.outbound.protection.outlook.com [104.47.1.87]) by dpdk.org (Postfix) with ESMTP id 9D42E1B2C2 for ; Mon, 6 Nov 2017 15:00:48 +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=IpktT2PWwK6Uk/ff2v9EgjqmXfkjwM4DgIcCqdfJwwc=; b=IA22hajrIED0BxjUTwGNAxskdubQ+IgwT9GEhbbdMnPDXiZYLBvFNPSJwhdXOyWvpAdFfqUbRRvhQk2vu3/b5+rumoJ+Vq5yPb7Ny9FTrrYUPpRFSaCHX53LrmEHKtDGfRefA3MC5M62WuJitKmmcJpUJtIBCYvFUhgMlnqCm9M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by AM4PR05MB3140.eurprd05.prod.outlook.com (2603:10a6:205:3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Mon, 6 Nov 2017 14:00:40 +0000 From: Shahaf Shuler To: nelio.laranjeiro@6wind.com, adrien.mazarguil@6wind.com, yskoh@mellanox.com Cc: dev@dpdk.org Date: Mon, 6 Nov 2017 16:00:25 +0200 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171105154449.93962-1-shahafs@mellanox.com> References: <20171105154449.93962-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: AM0PR0402CA0001.eurprd04.prod.outlook.com (2603:10a6:208:15::14) To AM4PR05MB3140.eurprd05.prod.outlook.com (2603:10a6:205:3::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 814f19f3-8ed0-4fc8-8b83-08d5251ec3d8 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603249); SRVR:AM4PR05MB3140; X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3140; 3:lonyNUME+7lTibQQVnPP+tQyr2MQpda26q6hRqq1dSYvPXFvZq4KUmx/5tepLmk7yGeZckTwXE0AEi29FTTjIjZkslZkGAqPvsl1z3+oV2/FKg6UuP3ontXRmMwTr3NrGFPSh7hRDKB/rtGQC6KwqXjQ19Byruy8OMtS56hUGx12X23tLnZtUB5UJ487DhtpFn0ps6OSqT8OlzbMgusfkBEnwsgzmgDKE4cP5pqij7E/LqpTXftHKw3afKymrZHl; 25:ldyuV2hbjz0G37PDUB3tDdQJhW1sCF6VuA+SkoJqaU0qHJ6GAjXOsQPXeI8a4fP/yIY/wnvfuEGe9uojES7lK7n+vilfW+JJ/6xp4QUWiFXkXR8pfuHAiIfxqPcmTVcntDW+4dVczCeOD1SO8rhxJ9Q3I0kuL5b5sl/I++8x5+4fZ1Oy8nh+/Ny8wGVGwv4zZlJtHXPbb5oXi2/B0vmJo2EmkAm2zQEdo5SyhbRO74oF9FVQrvYLaJllQntMBNHdwvWbYEyBBbDR19WMJuGtk+Ycft2u1dJ4nGEcLOv67C4L81nrgVql33Q15NJWKv4TEbx4GTviNDLC1WugjdkPTQ==; 31:66hPJzRZt7RjrTunmH47ROMRbHKTZiMKAW6Eo0xe1UhX00Fq4N3YRyarx9qoOkGE9F86joNkxoCX4jYTpZaGQqOE9AYb0khQsjnyWU1V/W5+H4C4ykbynQozeXJDytwXSjyd6QNgHTpI/D3j4MmFK/IAvTvC4DEzgYHq1O9DhuHnbyubtu+9MHq7ii+McARkh28G97S6j9x0I0Ba3N4MGLibxrN6ssLKKm4BCN6Zk2g= X-MS-TrafficTypeDiagnostic: AM4PR05MB3140: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3140; 20:+8cTKvtlmx//MMmEVV2MGBM/nJjxi4OQ6vfLhctW/wLaHLqP1By4eBejWJwhGYn81Kd/ao9kLmLVFTsdLGL66QR93JqSHymrQU9YSYBQBLicmvZi1y+6a9d+LxtSkOnm6jNqUEERgTaELnSOLcXKqGsqZEVh9++wWfy6A0BUBbVjuC1Tj/nFergm69GMTdpAwmahzpI+d5eC/M/7oUn6Zjl34hxj/oAn0BbJr9Ew/upn6JBfm4QsV4JaR6Mm/57+deCGiJcw0+3NmaYjYn6UPM3va927hm1sHICIm7A2fZoYXjccuErAjVFz3i0waq8alyQ8qcNEcX3Fu4V9EG9KzXc6cOItxAzj2IBLeGwaVkNHVQQs/xmVLbuXkR9tLkqN678zknwBqELoMyYyoYHLVfnVQjKvFAzNLygX5WAMYbRPOqgh1Yeg6+vMKd9M1WCxif5+w5fAU8lZqdifydgNp/d1bTTSaC1NOY8ZP+U/oKoPLCdavrKknV/EVYhJY7Vm; 4:i+0un27ZRLgCUV4gvxMvpgoLqm1cvCrcFa1xZA+aFPQIKdY0H8E3+5zUJ1CLkfsRdu8gFRwcXUfh+TTdo++/E4GbijJtBw9IgrsG8yZRjoVT5PU9of4WZOd3jE48Inb9S+QzwYApDKXazDjhsDkIcnNoc7yoUcrWbwVnRGwx1DimgsSQyBTPVXDLlVQW3BPWX1F6N0JEeKA2Az0ByP1ZF0zc9e34ouF0kWnh8heUCXgThhsHkko/a1AbL200SHjJjjcnHfXCjwGg33dfWdwPBA== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(3231021)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM4PR05MB3140; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM4PR05MB3140; X-Forefront-PRVS: 048396AFA0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(189002)(478600001)(7736002)(76176999)(81156014)(81166006)(50986999)(16526018)(8676002)(8936002)(6116002)(3846002)(50466002)(305945005)(33026002)(48376002)(25786009)(68736007)(50226002)(36756003)(97736004)(189998001)(101416001)(16586007)(316002)(69596002)(5003940100001)(55016002)(118296001)(53936002)(6636002)(105586002)(6666003)(4326008)(2950100002)(66066001)(47776003)(33646002)(5660300001)(106356001)(2906002)(21086003)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3140; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; AM4PR05MB3140; 23:p6xRhb4AjPAP2KnYPKsdH5RNi8YEObVWDCB4HXZs+?= =?us-ascii?Q?MZtOY9OM53dwCawRwbr2p2BdNrPdmGvG35sMOQzCFkQApXrYEnGrcDRVUKBW?= =?us-ascii?Q?StJ2+4Tw6FVMbIKv+wQNCMQzWuoqC43E9BBq+yL+LDzLMR8IR50DsrmboVQM?= =?us-ascii?Q?bfCpOT0yvNO7irFLjGXVjUf4qc8sPh+GE5YRcnJWYTJvQ4ivPZIlE4ePpSZC?= =?us-ascii?Q?yFHZocH7i7zCY7B69CK52E6JqL2osKa9Nmb3EjMXbR+lUQiaRXB3zr5n66Y5?= =?us-ascii?Q?Tp2HWKRneUmO6JgGFGKwtcMHEbPq7KHFvTlK/WN2ppoTdYR8++NbmJRsCj1G?= =?us-ascii?Q?uppRupkcHr1W2qE8lpGGHdsaefjyzGUOs15GxVsidZwA+GVvzxaoaI36JZv9?= =?us-ascii?Q?8soKltk2kLnn8fF23TmgKIH6Vs5RuF3Hn355CmkDIHvPcnhegX9Rhs2k7+cR?= =?us-ascii?Q?ToL0WoJ3KT+j/QBuEV097EYgQRhq89AqxfE2RaDduZPSOkxEMQk9hNzf7mbV?= =?us-ascii?Q?cdgpApiVXW4MpSrH5/90/3oaMj68yV03AjOxUhiFc5NgnlXTy6AopIBc223i?= =?us-ascii?Q?lIz7xH9du1QgIpuZjEBCH4h2cal85a/jUtHQMrq+VBDtLBMsiknGx3H+qjcT?= =?us-ascii?Q?cnAMY28LZZWX+CBbL6fyKMvYsRbY5Mg1oA9O4TJhmgFFhx21NP3lRgcTZ8bu?= =?us-ascii?Q?m1B0GNopphxnLHYTBsjXQkvK6g0kSyL0ol8d9i/9ivNFSNoEvd++YaeyKoP5?= =?us-ascii?Q?YcCuyaQDVFX12BDPf/MgyzeNW82VGvhgUHCCHgcnxx2zW1I9XVxVZPVRRQsp?= =?us-ascii?Q?3qy+LXpYdpSCSmvT/COq3bX3nv1ZcnvUY1FmVE902a9iud/5GL0owhS2vOim?= =?us-ascii?Q?uEI3di5aIlbkx9WdgsLXSbE65IbMOru4L+X8hBi917kJHDCJ4PKis6wmev2l?= =?us-ascii?Q?Emi2VKXh+cot8Gm8g9WSoJj3UZRzb7UwELT/cHlifo1vxQliCwwg+7VEIU3R?= =?us-ascii?Q?XS7TeKB2HhfECMGkW5RVHFF9AplVaS0kxmyTlMub47DToHVdtZGdPtl1qnMB?= =?us-ascii?Q?F4BowW6p8sEYQktqHink1XvAKmQNnbViCyq7uDqKLmeRFiuit4gQeajufgSn?= =?us-ascii?Q?4s8QHpmcx0=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3140; 6:u5kceYj+oHlEJhyce8xkwmhs5NGIz3hFu1zfU0LY28ePJGjwTAG+/FK4SP8Jpg5ittaY7UJOHwFpOmyYMfB14EEeiyAvGg0lt2mzN9t9tMLbeo/kr9riKQQt/rHgAy+kwnlt1SfKi5mpmlsGgGSgp3zA0h+SMkY81r0MN45XdCQyapqQXE8Ewd1UTS2y4g5Yf868/Y5OvW3glElLWr/j4hoHrb92Rbq70ctjkdG/Foa4974bE2/2JHiLgnqVgLQU76333tBswMQV2TarveWKDtYr1u2FpJnkt+pFXaTirffOtvTXnHGbN9L5j6bpLh9MlY54hXgw4xp2NyArWQglpYReW1c/KaZpdemhbPDeQEA=; 5:3Be2EQ+BY8GniLLJPsxWE1ZEvKAdwqMFaS93uWc4xNgNeiHc3eEpJMEOqVXouFzzcmk/IfRhjJ3kTQifxrQF3XvDwi4rG7U/+RkudBF2UpUpeM8jlX30x1rsmKgVWFX1PI2VIRJsYHtVnqBiDYgp+wa4So1ic8Dkw//7T3ygQoc=; 24:KKe7l0WexzLf1HYzLNb2OtKNGiCsks58TNcGn4qOMmh4LDfvbKiKmoyCsLi7xtDP5qFT6arn1rNi8SKsAWfz9+6Lpy7xbQ0VXd5tON+NEc8=; 7:U6DiD3BtjxNOJPPMGfC55/iU+kXRTba9B/pROr4ZZA/+FgxxLatWm7g6NpfnHBkGzTxcVzCB94WCedrkYvftpY/LrD8cd8gmQhQKmWbxubHCS9Wjhz47A0wzr3dkUFWbrVN31BxrWMfqWlvUCGDgDh30qK6ZPf7fuyxyfSKylzYQXYpRe7s13plN1Tqm7e8aMYGD3fpLeUlISOdYzpGRQHV5roNfWLGhRn17nhCFi7qAcU+O04Yv8KZVm1srUdny SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2017 14:00:40.3100 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 814f19f3-8ed0-4fc8-8b83-08d5251ec3d8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3140 Subject: [dpdk-dev] [PATCH v2] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 14:00:48 -0000 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 --- On v2: - Fixing the issue from the hrxq_get and hrxq_new functions. --- drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_rxq.c | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5f49bf5ff..bcb06f84a 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1781,7 +1781,7 @@ priv_flow_create_action_queue_rss(struct priv *priv, parser->rss_conf.rss_key_len, hash_fields, parser->queues, - hash_fields ? parser->queues_n : 1); + parser->queues_n); if (flow->frxq[i].hrxq) continue; flow->frxq[i].hrxq = @@ -1790,7 +1790,7 @@ priv_flow_create_action_queue_rss(struct priv *priv, parser->rss_conf.rss_key_len, hash_fields, parser->queues, - hash_fields ? parser->queues_n : 1); + parser->queues_n); if (!flow->frxq[i].hrxq) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index a1f382b1f..18c13b3c7 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1265,7 +1265,8 @@ mlx5_priv_ind_table_ibv_verify(struct priv *priv) * @param hash_fields * Verbs protocol hash field to make the RSS on. * @param queues - * Queues entering in hash queue. + * Queues entering in hash queue. In case of empty hash_fields only the + * first queue index will be taken for the indirection table. * @param queues_n * Number of queues. * @@ -1280,6 +1281,7 @@ mlx5_priv_hrxq_new(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len, struct mlx5_ind_table_ibv *ind_tbl; struct ibv_qp *qp; + queues_n = hash_fields ? queues_n : 1; ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n); if (!ind_tbl) ind_tbl = mlx5_priv_ind_table_ibv_new(priv, queues, queues_n); @@ -1332,7 +1334,8 @@ mlx5_priv_hrxq_new(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len, * @param rss_conf * RSS configuration for the Rx hash queue. * @param queues - * Queues entering in hash queue. + * Queues entering in hash queue. In case of empty hash_fields only the + * first queue index will be taken for the indirection table. * @param queues_n * Number of queues. * @@ -1345,6 +1348,7 @@ mlx5_priv_hrxq_get(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len, { struct mlx5_hrxq *hrxq; + queues_n = hash_fields ? queues_n : 1; LIST_FOREACH(hrxq, &priv->hrxqs, next) { struct mlx5_ind_table_ibv *ind_tbl; -- 2.12.0