From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0086.outbound.protection.outlook.com [104.47.0.86]) by dpdk.org (Postfix) with ESMTP id 29A0E23A for ; Sun, 6 May 2018 08:07:01 +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=ZrX4vD2II9jEVQ4C4JNiF0xqyIyboNRs7DOElnteCXs=; b=n6nnd3czDCiGS5oSa4oGJvb7+1514Xl463KIOdErqWLTf0Te9NEgPoTw5jOk6EH9nECEXtjmiOmJ/bC+oZjWh/FiDVrJc6ARrxd5wGI9JQNYPwWEs9mWt28KhCDzi3LEOwGlwmh6SmKjZGQKHuw74oRz+0gQo/yYf2Rg6LRIpxM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (141.226.120.58) by AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.16; Sun, 6 May 2018 06:06:59 +0000 From: Shahaf Shuler To: bluca@debian.org Cc: stable@dpdk.org, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, adrien.mazarguil@6wind.com Date: Sun, 6 May 2018 09:05:58 +0300 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [141.226.120.58] X-ClientProxiedBy: LO2P265CA0008.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::20) To AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) X-MS-PublicTrafficType: Email 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:AM6PR05MB4422; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 3:uJqAk5CyKrLuQYgHsPVAkzUH2pzL3nUnVxlcL22I6n1vhYk/7SZn95HB8x6amGzqzydkwMZKPYxupt0oa/a4Xf9h99oDi6zYsBJtT8b7xI37+8FmjUgm0aKoykALfagcQ3qsfDJvRphg1L8JkW0/n59w99litwTTOrgu7A8NM6F9OQVagyViF1idi0QXspek3CGDi9ABhKHt1rAOkHiePQgDX/hRK7EwM5VXDuTsXhB83ZkML6hv6vjz/YMMAFxB; 25:yyER65eDMQjfP+J9YRpnZEyg3faPknfdVYRgmjjlrdd7/8WedUiTm3JLxL74FjVpBVlHvFykAmw48mzLRPTU8zlkC+NSmQnCAUbi4Iw5R0zkS5tiCPDpS7UHT7wWIk8aT/XobBGknsEFPH5e0VeUse+QBv/74mZ9o7waOxPfZNERwI0vbVmJHz8Cq26D8znX4gBpjEfVIfE/ssUeGkXlpAXfqE9J/oPlo3TM7JBhLr669HCBPPrvLIH50FYrwobzKsYLBxDoHIAs569FpkS6XnkhNZISJ5j/99wpF7ylXzF1CVI8mmflVcqdwc5Jaomjr7E2CVD/aC4rq/Azdmlrag==; 31:0vunjJFaCQVjx4YQFvbYUANY5Gb8zQSYRHrjK+Bbch8/7nemtDtZk7XDQzQ3e9TGpweRmYGi5QIxqs/rt2xRMbobDEkaFIT1sbVqS2UJV4dUZyJFPBKwLaHp6jNZ6p5eQA8TZdMiHjyrSUsCH3sfU3u4ucK+6bzKAf0KApUiS6I2J5SLFNFCMzjOd8Th88GsiNEwi8ZnTq86zTsqvLKtMmKvVZw0DTj0plvN5kL31Wc= X-MS-TrafficTypeDiagnostic: AM6PR05MB4422: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 20:UkYcU9Fpj6Vxy3Z9ggxe1JApzIm5xXSLW3ihWouiVqli7Sa+q2Rc/O2jl+3LJzycziAUySYp7EYizl2N91W3tWXyhaThueI4cYAs1jwwoDl+9cePsAwPuTPd0Q0VS6VIK7sKipZNPK/uMc4ip0EpdYYTVnfG5EqQYHjQq2MC3BaAjgf2n677yGJNfarvih+90PBCuJc8W5bXh1mw2i2lmrrDJRepfqOEgk+i0S/QoTmL1wzADqQ6Ywhzx1STsq9Xe+eQpCQeAeRBA9qnIdjV3xPzXaa8DFAAKfxv8zqGlZ3SGjxgRYBZmGO9hkK3/kRu0HuN5a0fRpdiJer4izbqKjfwLyFbqYxn2dznVVTn+YFjzaHCKHKzoI5tR4XX4rIWH+vbALUN7OGlhuA66xSQ6ta3816PAtqPsO7RZ75OBrAwQMy6V9zG4rmaG1YaPSiN/mqpT7/CLL9ZJcPAQB0N6DwLLy8xsDP09blb89Y+E6btpHFKhDrwIBRBfL8YQ4Cw; 4:XzepezFpsaRdf/3kEV7bLVrlGMlFDeubh/y7J2jJORwyxtEaqxxbYEWian5XVdo6AhKK/yMpDcTTYWJHxkGa9GSNuodeBrKlKqdwNI+GP9ftZP9EARO2m5NrXbbumSsz3Ygt9FvGq4yurPVmP0bXRpuNdQWybF+vKHTlqjAByMcSFT3B+1aIrVzU57v7WOfu516xNyd+tn5oWVML7S48hXSO/5pE9WWoqcUUtf7W9pC4LyRGaNIlZg3re2ABrvFXpwy3v+mwarEGMy+s0zKhOA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:AM6PR05MB4422; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4422; X-Forefront-PRVS: 06640999CA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39380400002)(396003)(346002)(39860400002)(189003)(199004)(105586002)(8676002)(16586007)(8936002)(316002)(2351001)(53936002)(86362001)(2361001)(6116002)(3846002)(106356001)(118296001)(66066001)(36756003)(47776003)(81156014)(55016002)(2906002)(50226002)(4326008)(68736007)(305945005)(7736002)(81166006)(50466002)(25786009)(486006)(5660300001)(476003)(2616005)(48376002)(69596002)(16526019)(26005)(59450400001)(386003)(97736004)(956004)(186003)(478600001)(7696005)(52116002)(6916009)(21086003)(51416003)(446003)(11346002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4422; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR05MB4422; 23:6nO9yEk2+buo50hBE6EbiQc+CrrIZjQPXZiMmb8j3?= =?us-ascii?Q?gUFdaKGQ097O1OvzhhxjShvZ7IP8v64V4Wfat2D1SVODYZNXIoI7PGlx1d5G?= =?us-ascii?Q?qamfGoEEKfwuj+iZhGhKbe4m3vmjJi99xvcJUpX2te23mjdgzdEYgIbDXPaS?= =?us-ascii?Q?H0Z5Ez/j0DcqRg2GE0ru7Q3bgfVDoj/stBbrHY/csGAYmJCuBjjplLtRMvlQ?= =?us-ascii?Q?SUoweme8YhbR0ZtMmMw9JSrCigRtyDiMJalV6UL7VpraEnIKAeshfQYfAyYq?= =?us-ascii?Q?f7hwpNZtIdcw0T1vsNUeXzB94BN52jRqPgPZbEYegA9vxj2tvPQ6F2Pfq6F0?= =?us-ascii?Q?tyP4jlfUMLnafXyNFGie9hzEO3s9BMbeBzTQod0RpuUPZ020FwvV1bQdaw4r?= =?us-ascii?Q?yObFy+8//SCnNOqHztJLnNFtkxcCJupgu3TQcewTIIlTXRukq1UM4vhJ2UPO?= =?us-ascii?Q?Fz2JI1C4L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ymdVN/Wk6UaxgFTVxe+xKXG7xahPZR2KukvE6JJjJuHSTvTI2ORp8zsXLceS8kxgR+nkgaEKDAX/T0Ek+DBGv/giWlvXGMyrpPoF4bxXkofEK/z7mLn5crMwa6U8fcXaAX5LymVK6KdxFN1sD2fk25DE+VC8m4XPPgI1tt/DHU7/RGdP1rbn0N7X0rT X-MS-Office365-Filtering-Correlation-Id: 78ba2e85-e312-410a-c4c3-08d5b3179447 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2018 06:06:59.0675 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78ba2e85-e312-410a-c4c3-08d5b3179447 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4422 Subject: [dpdk-stable] [PATCH 29/33] net/mlx5: fix flow director rule deletion crash X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2018 06:07:01 -0000 From: Adrien Mazarguil [ upstream commit 6f2f4948b23643d279f38d38f988b122f393270f ] Flow director rules matching traffic properties above layer 2 do not target a fixed hash Rx queue (HASH_RXQ_ETH), it actually depends on the highest protocol layer specified by each flow rule. mlx5_fdir_filter_delete() makes this wrong assumption and causes a crash when attempting to destroy flow rules with L3/L4 specifications. Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") Cc: stable@dpdk.org Signed-off-by: Adrien Mazarguil Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_flow.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5bae8ee885..c03a37506d 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2881,13 +2881,13 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev, if (parser.drop) { struct ibv_flow_spec_action_drop *drop; - drop = (void *)((uintptr_t)parser.queue[HASH_RXQ_ETH].ibv_attr + - parser.queue[HASH_RXQ_ETH].offset); + drop = (void *)((uintptr_t)parser.queue[parser.layer].ibv_attr + + parser.queue[parser.layer].offset); *drop = (struct ibv_flow_spec_action_drop){ .type = IBV_FLOW_SPEC_ACTION_DROP, .size = sizeof(struct ibv_flow_spec_action_drop), }; - parser.queue[HASH_RXQ_ETH].ibv_attr->num_of_specs++; + parser.queue[parser.layer].ibv_attr->num_of_specs++; } TAILQ_FOREACH(flow, &priv->flows, next) { struct ibv_flow_attr *attr; @@ -2898,8 +2898,8 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev, void *flow_spec; unsigned int specs_n; - attr = parser.queue[HASH_RXQ_ETH].ibv_attr; - flow_attr = flow->frxq[HASH_RXQ_ETH].ibv_attr; + attr = parser.queue[parser.layer].ibv_attr; + flow_attr = flow->frxq[parser.layer].ibv_attr; /* Compare first the attributes. */ if (memcmp(attr, flow_attr, sizeof(struct ibv_flow_attr))) continue; -- 2.12.0