From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30040.outbound.protection.outlook.com [40.107.3.40]) by dpdk.org (Postfix) with ESMTP id 7A5D4CFA0 for ; Tue, 5 Jun 2018 02:41:05 +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=C8NxVZ1OBApcv2W0RBnPD2YL2NEOZvVHosYKK31UFSo=; b=o3+R8ehTVLYK5h4z8jboL7R0FqHVhoDpiDHNLVaL0wU9PN1NDdZqpU1vfHbNpVigqZKHtHXZZpDnZrvdA4Ky4Fc4MKEFB654IDYr26IUlYiM8YZ5Hfffd8UCppkPETHt/wozAgujh83EcC0OYAXHfCGT7rYXda2c6nOOuLFqg7c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.11; Tue, 5 Jun 2018 00:41:02 +0000 From: Yongseok Koh To: yliu@fridaylinux.org Cc: stable@dpdk.org, shahafs@mellanox.com, adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com Date: Mon, 4 Jun 2018 17:40:20 -0700 Message-Id: <20180605004029.14593-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180605002732.13866-1-yskoh@mellanox.com> References: <20180605002732.13866-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: BYAPR07CA0013.namprd07.prod.outlook.com (2603:10b6:a02:bc::26) To VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2045; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 3:+1TZ0Gs9VCNjCxc5pubEal3JwgoO/nQnHAxwlqnb8AbFU6wtFaj8lM0vvXk/VA0h/ok60NpyAWr8xBqrfBEeVkUAPKmdrP/6ORmo2qjzL0fSMXQeUwAG2PFIvelr7HuF+e+nYOspC4EW5SV4Aj6OL8fuMp9oD1bOqxqKwcxHkEzVILbyem4wfwBzFSBZckgMGAfJxPhSgWdZAOoPEDXTpgp76W2UzUfsKLy1ljnaJwH+PZMcdSFhyC1W+nG/HDXt; 25:rdy1K2moD2/DrhmC4ZecKSYRDNCIRrfvt9yOhPTBrsHT2H6ExxYYWPweKkb2CvkReu3umwHaACwjDNsPX4GROmOT3Hsib1YNpKoMN3PWJcxVu4l4c++WSsVr0NHfBHzlvzetohgP9Jb1+AtVdL6Cd0RqsbKwv896CZwXOIBLgnvSYeQB8uVRFT8aAlWqPJPqzRa2PlByt/WKGsCidZJXI2y7Rl7WGtJcu9BM7slwW7f/z6K0uz5msCbG9BvzzoPtwIKoRm4hppmaB5s9qqrDEMdBs7x2YCUs/MKkxt1eTypIBOulUO1EBPdLbJtIctL/EVr+VDcqormGeNi248POFA==; 31:aCK01pjLNIrtswal3vxrlLS3em56Xk9Zqp5U1PU1w6LogESg2+8ga34xTOXh4mKwgg5VEq7xFVqswkzssUlJObLUOjP9tIFLZpiigshlLPhXZYXiqhGXG+u/cj+cShpXmCZGHXrmgR30EClm4TJt5fp/l2dL0Rijrs4PBWSU/BYy6MQUHA4v49CHKLCsvHQpjqfN3zIiAOaZB+Al0b6PUlN3+OnMOIt6vX0RVn7yDYc= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2045: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 20:1qJCJqi7t+oP9bkloFH6jpOMfqSp9loxQiuVMQBsRjHIuugvz2yPzof1yq/a39CLx2SbbvS0XCX9ydqFuwV/7X1GffgmJ9lp8Y6Nxmi43kICOyY8qathkAaizPwEidySZZSm0TYF1CLFW5B3z003E7debidk5HjMuwH2uYLuBT+VFlV6tULU3RTD9jOABvaa0JYHX5WZ4SUROeY1Nw8oNSBK+0Hol5i97iFvD9wOugoxUYQouRLpMXXY3xRip/G5fz89YcMh5GZ5ym0KVOdwptfYwx+9vVEw5rXFWD9Vii3FZfTguzvCd9OaL9irhFLCUsMQHXQOVYBLXaBuZYUUedzIxv+EtenyXtfF+nCPkTvIWT5ccXAPkHQM+Oft9wcmW5MxzgfhU//H3cI5AcwaVPBu6oh3MKVmXOMkdbpsZT6u0qVgBG7FWQNp1hztU375wTA8ZLT9FEA4hl9nU8xtG4fzf4yt/N1++Z8Axyx8YJ1BK1Dxv+Ora91kIqX6adC6; 4:kD1jiBRy/s97O0i/QURWaVZXGd2d6khwq+pjMvfRiFBw6KiUk+GphHPI16/0v6GSejrKlpWPVQXBFBdoRXi9fi3taP2QXd8IcgZjGVdaU8hejcWSU/SiXls9SJyHRqef/Zv+OJ5UwSsSNYYWrC1BpcN7UNza6vs40/xaw55MUS9Omf7CoEOJV+mNXgN0SvbBzaqPv1WO2kVdKEBW6KYrxuuBTWFcamEPxgQUQis567sophwcmh2eLg97iUfHerWoEwytVuJ7AA7BIRRqhU8gUw== 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)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR0501MB2045; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2045; X-Forefront-PRVS: 0694C54398 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(366004)(39380400002)(376002)(396003)(189003)(199004)(5660300001)(8936002)(3846002)(6116002)(6666003)(2351001)(55016002)(97736004)(7736002)(305945005)(8676002)(48376002)(68736007)(2361001)(6916009)(2906002)(86362001)(81166006)(81156014)(1076002)(50466002)(53936002)(47776003)(446003)(16586007)(36756003)(105586002)(2616005)(486006)(316002)(956004)(51416003)(69596002)(52116002)(7696005)(11346002)(386003)(476003)(59450400001)(50226002)(478600001)(66066001)(4326008)(186003)(21086003)(25786009)(106356001)(76176011)(16526019)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2045; 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; VI1PR0501MB2045; 23:z3zPKM3vp6F122Ie6ozHtxEq4tikJua0Vsby56D?= =?us-ascii?Q?i2A3txn7LlRuajy8i++SLxv1O52+sK5c16ZHK0qxnkAAVbenLJvkq/6P04s5?= =?us-ascii?Q?TxpQMY5QJjaGhNGUG3jb/J4z5DGraOvEicToFxhuSKiNn78dUzn34KwYpHAF?= =?us-ascii?Q?BXhitIEEN4MnIwerz71ReK9lfM2RpgB2t/bwx3sblTLMTCpOqMt3wZ+9pxhy?= =?us-ascii?Q?cccuV9GCwVv9bwmN9D5SInMJiGaxJ1sOGv7WSNB6zo4aYW7tOWZj/yGcKL74?= =?us-ascii?Q?/FIp4riK9v3IlklbAbLdYFwtZOapccoMQdeEk+Qf/vO0P7k632lTJJSvNEDw?= =?us-ascii?Q?39BAh5DawXDcdCQxnbbYSPUAs9v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44I948grM/FTMZw6QvYg27blPAPP9y/8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 7:ysL83Ja0WWq4IR9QAc03FzfV4LuZxUn3Dh2Lr9L9iegEM+q9KfBEAHLJ5JdVyFfPMZ8+2oP2dg32Rq3/uoCGY4CdTc2J0lEeNMHnhSIVZVkdZtiMBafqbMLILGj8DuOIrqtENc0SwMA4oVWcSuul0zJpKt74SnXnmNFxjUl/A1JsT/tA0fIqZJIq9cXwlbRew10a94XE6bt2kaTJDrU/ZkFfzyT2ca7rC0fGkFvy8xQj+bI/W3TrAWqGPEy+5Yom X-MS-Office365-Filtering-Correlation-Id: e5aeb1d0-2b70-4906-aa71-08d5ca7d0468 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2018 00:41:02.3358 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5aeb1d0-2b70-4906-aa71-08d5ca7d0468 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2045 Subject: [dpdk-stable] [PATCH v2 50/67] 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: Tue, 05 Jun 2018 00:41:05 -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 46fc7c49e..425fbeb40 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2954,13 +2954,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; @@ -2971,8 +2971,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.11.0