From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6D2AEA0A0E for ; Mon, 10 May 2021 18:21:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 642F84003E; Mon, 10 May 2021 18:21:55 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2061.outbound.protection.outlook.com [40.107.243.61]) by mails.dpdk.org (Postfix) with ESMTP id 57B874003E for ; Mon, 10 May 2021 18:21:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZOVgsdiqY1qkFe1RhyshjByUEypNTTrojUrq/87jp1A5NNbwYyUCaXWR5r3xDXqW/VKfxVBRPT1n7g/tftjNid0ISUY6EUaIrgQ3CpLar8LM+OLVZ94L0IcRHEwdtjFmwjx+IRfLvRfitgxtBLA6RTx7h6zl++zgFxP+MwDj4keDfGWeVizWDptzqbJLm7kenG4aeq7sL8+l9MikTYWr4ZQRbtE74E/YmNic6HJNEzGDTnQKstb7dw0C6voBJDRCczTEC7z/UxlNxKDXx9fkdudjVUV5ufoA2AvfIhyHDDaCkkEd7DP8YkopCWri4S64FOeAtgXYuFh3NA4hzMnWVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jxUVr9Tbo4jxQs33KBxlw1oX0XuSeytJVvxfWpG1VTo=; b=Oy6+BpuSdUsXCWRJkPwukapg6z1QmT6vlPhCy5KDaJSs7Obvyn9j+H953jfOk1aJbOtStTcKud8a6Pwi6TjnVAH/axBarMrdXsVa4bp0HeF8Dyd7hLw0QDOtxHQcisfNdU93vDpEL77p9O3ks2YDOShZtGfnRPl9/fQGg2IoDP4DbXCukpZDiTmz93LZKSaJ57Dxp3N4MsMKrso2wpyFpCPIb/R6/GEc/cYlA+xHuUDV9RrBJWoBzZIaPVT27rai+5F5qLt9bUnAVwtMj3kYXtismDqoq/vVpvQeMUFX47A+5HtYFTZUlOYxzPaxm7qh74kEPt+xKUOqWl8hJXL43g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jxUVr9Tbo4jxQs33KBxlw1oX0XuSeytJVvxfWpG1VTo=; b=R3QgxzKJRRA8ooohkq1tIk1vi9hqdRSU4Ok0yWro8xxUYvfGE9XLsqO2LbM0GgpfNb8kUC94tBsR1erGgGYjifkoNfKh2ZG9DJp1aCK6GBfC6lLvNra7fUlc99p2m2fufw7sqS2RUsJSeYxD/cMcwObuSzaJk2JLICgeohhfC348Mw5UQ2rwFuiQ2OQZJuhD4iI/KJgOpA9+T/DWScDPhTpC01xIjoZT/A+N3AqRYbv8MddgVRSEsz8zO7Myb5+NKe6WOES/+HqdVHkd3Md+k+aSryQ3mM4AzC94Gk7xFMDBEtt0RBospi6RdsWMESDZzssPjE0zql7iJfZcRap4vA== Received: from BN0PR03CA0029.namprd03.prod.outlook.com (2603:10b6:408:e6::34) by BN9PR12MB5381.namprd12.prod.outlook.com (2603:10b6:408:102::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.29; Mon, 10 May 2021 16:21:53 +0000 Received: from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e6:cafe::93) by BN0PR03CA0029.outlook.office365.com (2603:10b6:408:e6::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:21:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:21:52 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:21:50 +0000 From: Xueming Li To: Jiawei Wang CC: Luca Boccassi , Suanming Mou , Viacheslav Ovsiienko , dpdk stable Date: Tue, 11 May 2021 00:02:16 +0800 Message-ID: <20210510160258.30982-187-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b1cab762-d8be-46e6-3fa9-08d913cfb8dd X-MS-TrafficTypeDiagnostic: BN9PR12MB5381: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VTroUCmrZ2ZBH3w/Qdd27Eec1XIYl2DDWiu+ly7yPbKgesLMvQ7NqsfIO8tPkw8d9XdPx1IkX7w+HH2mMrBs8r1yWWO7p7nsMKkETYtnzgb+Zws9T6IE7NjBpSr1KUol1DEA4VgtvbMkwUMuGY9EZbOOo8scKqyGGWxMQOPQH/xSlUJvGW4nuI0fml8+yyYQqGpEaod2pKfNCRDNNTtp+IpkRXyuRfx7ab0Yk67YFR/bri49C/QPAS+A4WKHOKDM4cOtddAYfN7/iBNP0jh6T30OgPLkJ4L1xJMUFcIPjhmeSMLY0puGzGYqYGTHCAmDYHLTOfTdHQUZSkzcaOkYGOhYizGFcOXfix/niq6XbhyZp1KAEEzUtDX7Gb1UbQwCRs8vJM1XNRQlfSgi2hshFaMpyR33JpLWOyLde/aiMWIIaWEaFacH2vJnelYqZsP2W/EEUgavO7in6xZecj4lOh3umkRE+IFlNwhgnAJjT/xCJXb2jhUOUcfC2SDUnt28Hx0koRVscud5OeJtB+U3t7KQuc3ysX8f2VJXZSA0xsNNfkvftwfG6cKvssdpqWXO+aOKsY0If3aukq60HBHTLr2nQp9nMRKAt9cfJXeAp1e2u1ozgKAVY//qhTFRIumkEf+vHKFgRH4nUEYQTEP0bGUw8ibmIQCZH3T9y7H2f2JeqV7Sr9v7dHMyiHm6hVNVdm+rJ3qCyJV6k9zF9CklJDsjJft/TsVUzAu+hYPaJo98T8++PEVYzIr4/dpZYkdPT+HmvMZ6T7sGDsFeWuN7MQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(39860400002)(136003)(46966006)(36840700001)(186003)(70206006)(70586007)(7696005)(356005)(86362001)(47076005)(966005)(426003)(26005)(36860700001)(2906002)(478600001)(316002)(6862004)(6286002)(6666004)(55016002)(5660300002)(53546011)(83380400001)(36756003)(82310400003)(54906003)(1076003)(6636002)(7636003)(8936002)(37006003)(4326008)(2616005)(82740400003)(36906005)(336012)(8676002)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:21:52.8082 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b1cab762-d8be-46e6-3fa9-08d913cfb8dd X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5381 Subject: [dpdk-stable] patch 'net/mlx5: fix resource release for mirror flow' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/8e59d734a21524c537a0109fa5460150a2ae8844 Thanks. Xueming Li --- >From 8e59d734a21524c537a0109fa5460150a2ae8844 Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Fri, 9 Apr 2021 15:33:28 +0300 Subject: [PATCH] net/mlx5: fix resource release for mirror flow Cc: Luca Boccassi [ upstream commit ca5eb60ecd5bcd9d4dfed6972ea991d7ead0e9a3 ] The mlx5 PMD allocated the resources of the sample actions, and then moved these ones to the destination actions array. The original indices were not cleared and the resources were referenced twice in the flow object - as the fate actions and in the destination actions array. This causes the failure on flow destroy because PMD tried to release the same objects twice. The patch clears the original indices, add the missed checking for zero and eliminates multiple object releasing. Fixes: 00c10c22118a ("net/mlx5: update translate function for mirroring") Signed-off-by: Jiawei Wang Reviewed-by: Suanming Mou Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index b1c8a95e8a..a1d1579991 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -9024,20 +9024,8 @@ flow_dv_dest_array_create_cb(struct mlx5_cache_list *list __rte_unused, return &cache_resource->entry; error: for (idx = 0; idx < resource->num_of_dest; idx++) { - struct mlx5_flow_sub_actions_idx *act_res = - &cache_resource->sample_idx[idx]; - if (act_res->rix_hrxq && - !mlx5_hrxq_release(dev, - act_res->rix_hrxq)) - act_res->rix_hrxq = 0; - if (act_res->rix_encap_decap && - !flow_dv_encap_decap_resource_release(dev, - act_res->rix_encap_decap)) - act_res->rix_encap_decap = 0; - if (act_res->rix_port_id_action && - !flow_dv_port_id_action_resource_release(dev, - act_res->rix_port_id_action)) - act_res->rix_port_id_action = 0; + flow_dv_sample_sub_actions_release(dev, + &cache_resource->sample_idx[idx]); if (dest_attr[idx]) mlx5_free(dest_attr[idx]); } @@ -9368,6 +9356,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev, dev_flow->handle->dvh.rix_encap_decap; sample_act->dr_encap_action = dev_flow->dv.encap_decap->action; + dev_flow->handle->dvh.rix_encap_decap = 0; } if (sample_act->action_flags & MLX5_FLOW_ACTION_PORT_ID) { normal_idx++; @@ -9375,6 +9364,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev, dev_flow->handle->rix_port_id_action; sample_act->dr_port_id_action = dev_flow->dv.port_id_action->action; + dev_flow->handle->rix_port_id_action = 0; } sample_act->actions_num = normal_idx; /* update sample action resource into first index of array */ @@ -11193,7 +11183,8 @@ flow_dv_fate_resource_release(struct rte_eth_dev *dev, return; switch (handle->fate_action) { case MLX5_FLOW_FATE_QUEUE: - mlx5_hrxq_release(dev, handle->rix_hrxq); + if (!handle->dvh.rix_sample && !handle->dvh.rix_dest_array) + mlx5_hrxq_release(dev, handle->rix_hrxq); break; case MLX5_FLOW_FATE_JUMP: flow_dv_jump_tbl_resource_release(dev, handle); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:31.416433600 +0800 +++ 0188-net-mlx5-fix-resource-release-for-mirror-flow.patch 2021-05-10 23:59:26.640000000 +0800 @@ -1 +1 @@ -From ca5eb60ecd5bcd9d4dfed6972ea991d7ead0e9a3 Mon Sep 17 00:00:00 2001 +From 8e59d734a21524c537a0109fa5460150a2ae8844 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit ca5eb60ecd5bcd9d4dfed6972ea991d7ead0e9a3 ] @@ -18 +20,0 @@ -Cc: stable@dpdk.org @@ -24,2 +26,2 @@ - drivers/net/mlx5/mlx5_flow_dv.c | 25 ++++++------------------- - 1 file changed, 6 insertions(+), 19 deletions(-) + drivers/net/mlx5/mlx5_flow_dv.c | 21 ++++++--------------- + 1 file changed, 6 insertions(+), 15 deletions(-) @@ -28 +30 @@ -index 4914c7085f..07a0ee5abb 100644 +index b1c8a95e8a..a1d1579991 100644 @@ -31 +33 @@ -@@ -10155,24 +10155,8 @@ flow_dv_dest_array_create_cb(struct mlx5_cache_list *list __rte_unused, +@@ -9024,20 +9024,8 @@ flow_dv_dest_array_create_cb(struct mlx5_cache_list *list __rte_unused, @@ -49,4 +50,0 @@ -- if (act_res->rix_jump && -- !flow_dv_jump_tbl_resource_release(dev, -- act_res->rix_jump)) -- act_res->rix_jump = 0; @@ -58 +56 @@ -@@ -10542,6 +10526,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev, +@@ -9368,6 +9356,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev, @@ -66 +64 @@ -@@ -10549,6 +10534,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev, +@@ -9375,6 +9364,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev, @@ -72,3 +70,3 @@ - if (sample_act->action_flags & MLX5_FLOW_ACTION_JUMP) { - normal_idx++; -@@ -12415,7 +12401,8 @@ flow_dv_fate_resource_release(struct rte_eth_dev *dev, + sample_act->actions_num = normal_idx; + /* update sample action resource into first index of array */ +@@ -11193,7 +11183,8 @@ flow_dv_fate_resource_release(struct rte_eth_dev *dev, @@ -83 +81 @@ - flow_dv_jump_tbl_resource_release(dev, handle->rix_jump); + flow_dv_jump_tbl_resource_release(dev, handle);