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 0A15042D88; Thu, 29 Jun 2023 09:27:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B55A42C54; Thu, 29 Jun 2023 09:26:47 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2062.outbound.protection.outlook.com [40.107.223.62]) by mails.dpdk.org (Postfix) with ESMTP id 13570406B7 for ; Thu, 29 Jun 2023 09:22:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bnE+EFK3TyfgL1ATHixaJLb1DI7mnQnkarAYA8ND941Ll3oLKZIXUTHBz028OUiuFSaMb5Jj/lljgephsCSxrXgaRDUWCmY+l9/SXx/Bli7ssnQHrhAbw0NgOnT2gsG6dD2vIYMDx1+Q97H6h116Uvs8rJc7d3bnFiY2lPgb1MKoWV/nGO78oA/Z/NXjyFWzbxVVxa4KBqSEGeUxPtFjNuQglPSQMTtnYpukrwOaeqOTuvJu+wLOIwa0/x4kM6/oWy5ye4CiARatoGOXi/6EAjUcCN5lmviTjCsnCP3IV7eHtf1r0LNIIG/XBbB8EwYgkh4oCcQnysuLtFZXvGKTXQ== 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=N9m8jzzCXe9j6gJoF++zWbO3318ayuGAd2JAI114/+0=; b=Lk1DPUeNVdQP/qdQzBQdjGnq92aQk7cWjftEqC6qVbX4HpV9S56SzOWVCHvpGboU3ZXB9kjTjT1yZYnTET93Ty/RgQqSJFcSHBhYIDi9c1TYSwXmQbV2oaVQSX8NVY329A0+atLfpbamn1E1P1WwG3b5h8gk4AOIgKxE4s8psN9i0OMhquqFtml1q6yrMG0lAn+xnH8YEJAzq8QYwZM2gNk98mjdNvEloGMPZE8da5w0QJhU3xPi6PBdsOse3/qQdQVUH1wwoxSq6hL7CwN0gRHDCf1t7B/ly+vFbc+YCRXx83NXRyyS9Abh4YlF5FOAQuvmseuK54dOtIAcCeQl6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net 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 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=N9m8jzzCXe9j6gJoF++zWbO3318ayuGAd2JAI114/+0=; b=sm4xuASCJOiIFSWvcn4eD07olEFZHy1T9NucrEhl7MJ8EbnFNDPFm/atQzb7cYNIkgcxONn+LQD78O84tl2zdDnvGQsOxG2LNvAYe7EmZwIfi+slcIeADpP90kHh8TaF11mP7v11TcQay5z03p3eGQJSoj2DCy87UTBX/7usCzWaKE/H/uvJnqgnHenE0C0XvVhwSMG0XhTFX7WW2iZ0iQi+gV+WWUQVkEK82sSiLfxkau51zGaM8TrWEY+WgQ7Eo7gAIS4iTbdfXNWDOFI+cy7pC5a9jcAw2mMj1nyUUCOakeYpzGHbfDiyPZ23ikeBqPB3UTCRpBf2JKAQZc2YoQ== Received: from BN9PR03CA0609.namprd03.prod.outlook.com (2603:10b6:408:106::14) by SA3PR12MB8021.namprd12.prod.outlook.com (2603:10b6:806:305::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Thu, 29 Jun 2023 07:22:07 +0000 Received: from BN8NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:408:106:cafe::dd) by BN9PR03CA0609.outlook.office365.com (2603:10b6:408:106::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.34 via Frontend Transport; Thu, 29 Jun 2023 07:22:07 +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 BN8NAM11FT012.mail.protection.outlook.com (10.13.177.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.49 via Frontend Transport; Thu, 29 Jun 2023 07:22:07 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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.5; Thu, 29 Jun 2023 00:21:53 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Thu, 29 Jun 2023 00:21:52 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Thu, 29 Jun 2023 00:21:50 -0700 From: Itamar Gozlan To: , , , , , Ori Kam CC: Subject: [PATCH 2/5] net/mlx5/hws: allow destroying rule resources on error Date: Thu, 29 Jun 2023 10:21:22 +0300 Message-ID: <20230629072125.20369-2-igozlan@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230629072125.20369-1-igozlan@nvidia.com> References: <20230629072125.20369-1-igozlan@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT012:EE_|SA3PR12MB8021:EE_ X-MS-Office365-Filtering-Correlation-Id: 333b0bc0-d84b-49ae-e927-08db78718bbc X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S6qV+VRvpOIS6PGafjuZ0nfWTh+8VUVEdGEHWW2jEiAtCJ332epaeIF7P2W8zJQ9XMLJJkuSao79CJ2sEr395I9fdN0VJ8yDmYCc+k5P/1ouYgadRXVwpy0Pq+1crILheMLRr3cgAy+YxPbhO7WTi+awOhiKysCbPsiViVN5a/wkJS9bbo6jwM/F3TDaXqS1hD1Z0evFx4iITn+X40NRsXL9Sc1CAiTqNaBhlkxzpxlNE0LYcEfdZ7PKt8y90s2WhMBjo9nlSCyQ2Oy8qXD4fhGn9deN8o8WnZXTCR/IpbRWTgCJtxR1PIaZJP8SrTji2j6pMCHU2JjayjFJ3KrdS5QNmDX177UITVITwth//cJ0hFKAgOpHtfcjY9oTOVA+PVvX/+EaKQjzALrEcIVRwJlu5flNssvxbZQuD42padr1oq9RGTS1vN1fFWF65Cvj8xPjHPtlWsoRe3w08+8lnf9meFXJZG0geqmWc2ptbQg6rkNF8AxJdNTwqsYy2+LKmXBfvW5QxSKHeVbzu/kPljgIgRFfqkGHDsEkcm+mQoHbeG6SZJQeHpINeeqyA6OvnTK3k9287J6UaPwvoajKo9Y8FwrAs67j5QTSYEmbhPCzkYHqXTBGgdW1UGMPdWizXhGMcSOs0GOFHw70uzyyc/+A5h8PFLwe+fpHn8kuEX5sUQwlpfDspVF19+i/h3+EJR9BUngu8Uj25GoK+EdtY+O/S9GljptW6daq/eXihZMeM8+gLmmJ8qrZXVY/2Qel 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:(13230028)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(82740400003)(356005)(47076005)(83380400001)(426003)(36756003)(36860700001)(86362001)(7636003)(478600001)(110136005)(70586007)(7696005)(40460700003)(6666004)(2616005)(4326008)(6636002)(41300700001)(70206006)(316002)(8936002)(55016003)(8676002)(1076003)(6286002)(336012)(186003)(26005)(82310400005)(40480700001)(5660300002)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2023 07:22:07.2233 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 333b0bc0-d84b-49ae-e927-08db78718bbc 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: BN8NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8021 X-Mailman-Approved-At: Thu, 29 Jun 2023 09:26:43 +0200 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 From: Alex Vesker In case the send engine is in error state API should provide a way to free rule resources and provide a fake completion. Otherwise there is no way to release these resources. Signed-off-by: Alex Vesker --- drivers/net/mlx5/hws/mlx5dr_rule.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c index 071e1ad769..931c68b160 100644 --- a/drivers/net/mlx5/hws/mlx5dr_rule.c +++ b/drivers/net/mlx5/hws/mlx5dr_rule.c @@ -521,6 +521,11 @@ static int mlx5dr_rule_destroy_hws(struct mlx5dr_rule *rule, queue = &ctx->send_queue[attr->queue_id]; + if (unlikely(mlx5dr_send_engine_err(queue))) { + mlx5dr_rule_destroy_failed_hws(rule, attr); + return 0; + } + /* Rule is not completed yet */ if (rule->status == MLX5DR_RULE_STATUS_CREATING) { rte_errno = EBUSY; @@ -533,11 +538,6 @@ static int mlx5dr_rule_destroy_hws(struct mlx5dr_rule *rule, return 0; } - if (unlikely(mlx5dr_send_engine_err(queue))) { - mlx5dr_rule_destroy_failed_hws(rule, attr); - return 0; - } - mlx5dr_send_engine_inc_rule(queue); /* Send dependent WQE */ -- 2.18.1