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 6B7CE43CE8; Mon, 18 Mar 2024 19:11:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54F1340289; Mon, 18 Mar 2024 19:11:27 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2084.outbound.protection.outlook.com [40.107.212.84]) by mails.dpdk.org (Postfix) with ESMTP id 25FCE4027F for ; Mon, 18 Mar 2024 19:11:25 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m5gJ8cyduP3ril9bVJjfaWo7RjSE2kfeMdYu6skjpN/+1rpn7kqcB77iq0livbq6JMThTmBdr/3uYWBOGVTajj6SGBmWVaUv99qfgAsBtX9YMKC5F3w0x9IscITb61qYlZRD3YpkpZ8HZtWmiFixh1ZjqgolQs2uI1NjfxjgJuVakupZFnCKR/6Nf9ppyIb5ocAwl9yXW3ROy7/M3XH7Y7VhpCap4sWlW/U5kSZzqSyICkPc8XHl1cQ5GePMEIUcqTyj3mk1k2l/6bkNNTwAYRg29Tsmnjl0E9vkhOtjm2xArvS2byYX7RXquZ3mMx+81ze+zifHU35I7xEI7NQwQQ== 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=GFzZBv5uQGx30tAQZwC56hJn4hYNH3XwvzJvVFNPlcw=; b=FSDp2TlU6DDMLPKvPajGsWbNfvxCiR17TmuNoN0a94HfCaXQ/cmChr+hkXRy05Rc21eS+Bb4uxZgrCEzm7KuEWGoKp9LeUmsvETS6hhyPweDFBPr5yXg1pAYjwvgP2ap7En32pXUCmIguu7VSP6dWEPTUCz2wEBArs4CgxB0P0nb8RIat+nCf+RTagskgyAaMxTDWscD4TSufOP7s28/ianj3QKrul6TkUih4QSAzY63sPLVr6ylfx7zyB3wBvb/VKA4sAMJBxrF6ivg2wIMgDM7EQWGiTK/nss5J1RhLa9743ReEBWeq+BYGD55pMR2J/xrLKNW97nuYaZ40Hu2lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=GFzZBv5uQGx30tAQZwC56hJn4hYNH3XwvzJvVFNPlcw=; b=WfeXuAx1NwUWUQzZLlyl/qikuTcgTvFQ4fANXFhWjeoS7/PPpBTKOpDZhgdfBMQaLkbFYUatShCsnwEnTskzhOYXLYxIcu6pkaob35mPNS1IHeZov+vst788GCDGybyyCtMJC6joh1FvGQ5emXjfI8gx79OeIWE/KdJOHoN0XKm6eFTXTFZT8jjChD8Wf2L2aso1Bce4bVJtOIa4FSLH370GtkGuMkDuQocp8eQGAJqF/M6nLJ/a3EyPTcwmJOuP8DR5OsRqID9w5neYZfJu11ZCLK8x8tkcmuTW/kR2BiGEJr0udt/vC06b1+2PG7TJUG3K19IY0RkVwqiVRU2Cnw== Received: from SA0PR11CA0057.namprd11.prod.outlook.com (2603:10b6:806:d0::32) by LV2PR12MB5991.namprd12.prod.outlook.com (2603:10b6:408:14f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26; Mon, 18 Mar 2024 18:11:22 +0000 Received: from SA2PEPF00001508.namprd04.prod.outlook.com (2603:10b6:806:d0:cafe::ef) by SA0PR11CA0057.outlook.office365.com (2603:10b6:806:d0::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26 via Frontend Transport; Mon, 18 Mar 2024 18:11:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SA2PEPF00001508.mail.protection.outlook.com (10.167.242.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.10 via Frontend Transport; Mon, 18 Mar 2024 18:11:22 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 18 Mar 2024 11:11:01 -0700 Received: from nvidia.com (10.126.231.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; Mon, 18 Mar 2024 11:10:58 -0700 From: Gregory Etelson To: CC: , , , Dariusz Sosnowski , Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad Subject: [PATCH] net/mlx5: fix sync meter action Date: Mon, 18 Mar 2024 20:10:45 +0200 Message-ID: <20240318181045.272879-1-getelson@nvidia.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001508:EE_|LV2PR12MB5991:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e3726fb-68f3-4ecd-9dff-08dc4776d135 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HvL1ohNzzOki3J2VYoOozlzGPENGXXL9VwxNUJ4xch8HNUiljN9rpnuYO74yZVr/Om+BCcJ+PwCnM6/rAwX1qSHhLw2F/fgvRyTuUkXLn0tlaGdHFyVLja5iOioot7HXDCHL2L1ZhiCF0HTy849shm2TjmIgZo8OespIU+8wQYYTvhNNCdOjxJffYxGAdzaXlh1IrD09qe9DxA2wtSuDbaaGnhzVMuit2RVW5RTnPrJXg6vVr+kKZm/4U9ni1Z4vIZtRxPFkspC6qGDwvyRTXwniCzzeZcIe1I1PMp0ZuBGUCeiRlfcYCDFlBRQ/iy3ffLAjHu8bwv/btT9luTu9MU4wsrYvirc2iX9pWmqVFvY7FKBfoHhc00uAuN8Wve1Fu8SdC+xCVzj5E6+p2iTJ45D1PAKtyhIafx6pVTj+8S+jVyefYd6wowVRSCT2SaXne4JTSnpb/fBw7HYbtSYDQapcdTR0nLB3yP2uSFCj3uqvPLr6Y77D+MvNDzQLlZEb/zgWqFnbX+cYk+h1XeKS5gXX/KXgGvFGTpDOOHvfnGDC/SiEXe4OE8KoV99tj4bSBTPxUTaZtYqTZPFPopZAckPVtNYMCLrhcQcjpjXgFvQZqeXPTLsZ2k+dChoXavThW5k7zvdu3NwXqc2DKY59pm92CPwev9wawwLWwKu9T4wcAhekebzNOElJKLkmqR0RZF05NooouYfawr96NaZTqAZt0tzaocId7WFi9qAjCdoW5Nkz1wBYmrpBZADg3tk9 X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(82310400014)(36860700004)(1800799015)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2024 18:11:22.0026 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e3726fb-68f3-4ecd-9dff-08dc4776d135 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001508.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5991 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: tag: 415806: Memory - corruptions (OVERRUN) Coverity issue: tag: 415804: Control flow issues (DEADCODE) Fixes: 4359d9d1f76b ("net/mlx5: fix sync meter processing in HWS") Signed-off-by: Gregory Etelson Acked-by: Dariusz Sosnowski --- 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