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 690D243CFA; Tue, 19 Mar 2024 12:25:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E53A2402D1; Tue, 19 Mar 2024 12:25:30 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) by mails.dpdk.org (Postfix) with ESMTP id 669C340298 for ; Tue, 19 Mar 2024 12:25:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M1kJmB4ZjzWZyYc79uLmRbCY6zyNWC++tYxqJ+/yzW7mosJQRn5imyIQwAXOWszut5etaQSbcSFGK3bjm5IWVXH4bPNAhWRIj4IhxZ9sQ4/7xSZk+gdv+2NX9MP0LNZiVc9Q/Xv7LIuKVxvDf9Yf5dofrQ1TJ7OHesWJsVMcSkbk6G4pt4yy4JQFwU/XaQkKBvBv3r/FW+mS1q6RPjwarKwCPWX8ejbP4CcONWWwcVJTdq8BMNgTUzIMNdR/5I/MOeQQ9B02T2V8ENZpI6idJFxhD5qm4iQexO8EUXFpT8RVvkRtiTAIdCTWyQUBaiJYw7C0zDBAQSbWvctfhLPxVg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=giUJmdPfu8U4rqogS5yEIOWRuzYO/X3bMEszdBtO1os=; b=DcWIactYPyH/bEK4uWV7kANdeK8C6DIedXF1w3e43J1h1EmxXeH5EPgy2/O1KE4TvEUx6sLckxFsmRk+TY48uLeQuUUNiszn+mInxb/h/okeSNtWieRkyB9xB4GzLe9/LE5pFCMisU+xLrDbqzUFatvAFjTlKyougpeppJ9n1KQ1ZFxnyQSTKuSXNNpkDaiNfMAIVvnLA+ssa8PJqrPd5A1fIYCwVX7T7ka2VOs9lj7eq/M7llRQLsw5foR4xKtdv269914oUpCov6Q79LW8G00SbFHHlEGrp0mQTM54BuSuQ9Ywaym1tG2QRNO2JGqaBWtK10oSOfjLlf7orVOBdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=giUJmdPfu8U4rqogS5yEIOWRuzYO/X3bMEszdBtO1os=; b=m35o/URKw0Igi6adl0nEAvATAg4Q3zsGlIFC9YPSTCQi2cczi8ZhkEsYTmWcTAQq/io1xCj3AjEH3ZE0eZNpcmt55LrOud1lEgFc7YjBUwgk1t736CJqTpECrbwDr9PPfXoB/i9Rp2+rlrhm/rO1nvBFpujY/SPL/1W/QxFic1uhAwGEk+a5P9Wxs1Klbk4D8LXFo6ORUMWIrZa1Um+n4AzVNi+GDbxyXXtma614DA4h2XgMvHcHrInsXUt06wt0L01knusG/6nO+CnPsWNBMh0wbEDPTOfrJk40tuu1jF0EBZtE/KegiSqbNN5kZXSxXz8uisHszWIoX9UnbVMdXA== Received: from SA1PR03CA0010.namprd03.prod.outlook.com (2603:10b6:806:2d3::26) by MN0PR12MB6222.namprd12.prod.outlook.com (2603:10b6:208:3c2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26; Tue, 19 Mar 2024 11:25:26 +0000 Received: from SA2PEPF00001506.namprd04.prod.outlook.com (2603:10b6:806:2d3:cafe::90) by SA1PR03CA0010.outlook.office365.com (2603:10b6:806:2d3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.27 via Frontend Transport; Tue, 19 Mar 2024 11:25:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SA2PEPF00001506.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.10 via Frontend Transport; Tue, 19 Mar 2024 11:25:26 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 19 Mar 2024 04:25:12 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Tue, 19 Mar 2024 04:25:09 -0700 From: Gregory Etelson To: CC: , , , Dariusz Sosnowski , Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad Subject: [PATCH v2] net/mlx5: fix sync meter action Date: Tue, 19 Mar 2024 13:24:55 +0200 Message-ID: <20240319112455.329350-1-getelson@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240318181045.272879-1-getelson@nvidia.com> References: <20240318181045.272879-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001506:EE_|MN0PR12MB6222:EE_ X-MS-Office365-Filtering-Correlation-Id: 475ac9bc-32ba-4146-2b84-08dc48074655 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F2nwXAaqzIY3FkKXCD6rlbZEdDS6/N3Vv3EWgKHVHALkb979PZQIL7fKtKxlbSg+nCZux14Hzifjs1Co5kOJyQiWH8UXYJzUoG2Gy9YEKQ9vVx6eL7wY2uFrrCiKbwXzTs7xtBHfzOl6Ym6nojyq6x2lyxTYdQykoPl+xySoqFJtzQJ9iNwEbuRLaYSWmTWcput3VBob/q+6+r2jrAVtOYkkwjuJLO79QGQ6J0y6rppZ0OuormJtjy+I7+kQBKK0xAUkd1zA1BIBNVW9oZxExh0/zE3CuDHaUyhN/VIh7vBNohakOD2Ehe0MpYnZBxSYjGpH9l64WV4CTjGCIVtFrw6ywcxGgAHfPnePXKi5WZ/XbGwRPOHZDARDHHblO8Sj1L56Kiqg68MNBpZSsNjV2TSPMqliyaCIKBIpQXQVe5tyaj9GP13ckcHt4crfHy1Q8IQmY3WSxtQZAWowF6ihpYktGZyXfRnLHrT+LZuMHsJpwyHWJcuVU+ud6u181f6zvJcRom0LM605PZeh+dxUV+JRlvMJ3SE3faMxunqfbEMqA6BQaIDCJWQZMJViOegjGsl2+vh87n7VXY9ynAqMrrRAEaSQfipAv4wB/bChC52vFwiUwKwjbQkfMgykWqlTJoSAyefCc/Ea8lB4gxNxEVrHBoLrSCnBKQsUa9n1ahFn4ItO3HAkpTZIHIHnroauGOvtdkSr/qB/ZLkn0w9iTQwY5jZ1HIwONaJUtyGH+xAPfNhc3wdyfO1DxNDQfmML X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(376005)(82310400014)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2024 11:25:26.0475 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 475ac9bc-32ba-4146-2b84-08dc48074655 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001506.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6222 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org PMD implements sync METER flow action as async. Queue selected for sync operations is `MLX5_HW_INV_QUEUE`. That dummy queue value is translated into `CTRL_QUEUE_ID(priv)`. Async job allocation converts INV queue into the real value, but job release does not. This patch fixes the queue value provided to `flow_hw_job_put()`. This patch also removes dead code found in METER_MARK destroy handler. Coverity issue: 415806 Coverity issue: 415804 Fixes: 4359d9d1f76b ("net/mlx5: fix sync meter processing in HWS") Signed-off-by: Gregory Etelson Acked-by: Dariusz Sosnowski --- v2: Fixed Coverity tag. --- drivers/net/mlx5/mlx5_flow_hw.c | 5 +---- drivers/net/mlx5/mlx5_flow_meter.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 35f1ed7a03..9ebbe664d1 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -11494,10 +11494,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue, NULL, "Unable to wait for ASO meter CQE"); break; } - if (!job) - mlx5_ipool_free(pool->idx_pool, idx); - else - aso = true; + aso = true; break; case MLX5_INDIRECT_ACTION_TYPE_RSS: ret = flow_dv_action_destroy(dev, handle, error); diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c index 4045c4c249..ca361f7efa 100644 --- a/drivers/net/mlx5/mlx5_flow_meter.c +++ b/drivers/net/mlx5/mlx5_flow_meter.c @@ -2265,7 +2265,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, ret = mlx5_aso_meter_update_by_wqe(priv, MLX5_HW_INV_QUEUE, aso_mtr, &priv->mtr_bulk, job, true); if (ret) { - flow_hw_job_put(priv, job, MLX5_HW_INV_QUEUE); + flow_hw_job_put(priv, job, CTRL_QUEUE_ID(priv)); return -rte_mtr_error_set(error, ENOTSUP, RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL, "Failed to create devx meter."); -- 2.39.2