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 9598E42DAE; Tue, 4 Jul 2023 18:06:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F9C442BC9; Tue, 4 Jul 2023 18:06:17 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2075.outbound.protection.outlook.com [40.107.93.75]) by mails.dpdk.org (Postfix) with ESMTP id 34CDF40042 for ; Tue, 4 Jul 2023 18:06:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uyy2yDjMZhh8KsQVW0xkYriKsiYPV2h8TYhnWONvdLgqmSZRgDKIb6xvW1rIv1DyfH8/39q8VQMrUEpLKY4QGPTRTUVrt1zDrGlQsOImcgNbwnyprOAmiIk/mUx3JmTddw4BrgRjOPI07tOlZhprQ6zQTMMZtlY/XfJ3Aj0+q8jnGb41LdzAFrJ+U9ET4OEuCRgstH+q143Y0hP4a3DVqbIOjilnlNBjiVd+z5Lhi5Ozgo4inaYgchnuE+4YBzEKGYw5plVeBzYNPFv6csGcQguKus1NgQQi1oKt2NxAu4K8PxyEb2or0bq2NLRfmB+y8+4ZKZSTxKF0lK1RfGB6Fw== 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=MZqltVc9C7tFlZcBGBqtk9ARhPSKmqbrdkkyMwpcY9A=; b=A8yAw/QnJ524FkQTne/TS5Co23Cq1u/tfjBh/jaFflG3w4RWsMM8xIwMGDuurPIssej2NX7H5ox+sVm8ablS8nZaYqOAGAluCoGhpep7iaNSkP+q5PIcnMclnhdXq3q4oO3ygr8dp1M2Sn7I/anDaQQKNUbtxLeJz3tiD5zPgxlvHQNfy6inY6Wd+goi634hb0kl+cuHJAZLWskDCM56sNBuTo5DunMCgADIn6A4LrunO90fm7P5AUMvrIKbxveAHZ5nC5izOThMzM750voAME6T8wsHuv3BCs/TGv36KAOQ/ykScWJ5BTgM7y+3ycDLxubWSW9+GLNxc7A0E1tLSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=MZqltVc9C7tFlZcBGBqtk9ARhPSKmqbrdkkyMwpcY9A=; b=FNNJgKISitiIzFa1gkZ6LK1s6gLKfocGA8n8GuE84bcWXvlSL1yyIcUSFOKEqa4eQEeMSuPcOCm2e1JIBybQwUSEYwDgt2yrHRQxL7b4wA5DjqtUcDKfpYhBufH8p2/0Q4+p2wB6M8+CGgbZDAAVQ2w78A7qol9EKFAlwZAegKNmhVl5+AzYv31dlwnBQYwpdSdOu4XMo5vVgd8/FV0G0ADpIgYWRq9pyeuYkLPhQ9J9/JFdU6S/WXu1U9T3mAKwGNp++tplm/2LZ5iQQphNGA3+RvhEj4K+OVG7fSjnh4R++lcd7oqBQN86D43ANKXmvvxetIllID1O/MuiMinj6Q== Received: from DM6PR02CA0151.namprd02.prod.outlook.com (2603:10b6:5:332::18) by PH0PR12MB5403.namprd12.prod.outlook.com (2603:10b6:510:eb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul 2023 16:06:13 +0000 Received: from DM6NAM11FT109.eop-nam11.prod.protection.outlook.com (2603:10b6:5:332:cafe::73) by DM6PR02CA0151.outlook.office365.com (2603:10b6:5:332::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.31 via Frontend Transport; Tue, 4 Jul 2023 16:06:13 +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 DM6NAM11FT109.mail.protection.outlook.com (10.13.173.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.44 via Frontend Transport; Tue, 4 Jul 2023 16:06:12 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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.5; Tue, 4 Jul 2023 09:06:04 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.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; Tue, 4 Jul 2023 09:06:04 -0700 Received: from nvidia.com (10.127.8.12) by mail.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.986.37 via Frontend Transport; Tue, 4 Jul 2023 09:06:02 -0700 From: Itamar Gozlan To: , , , , , Ori Kam CC: Subject: [v3 2/5] net/mlx5/hws: allow destroying rule resources on error Date: Tue, 4 Jul 2023 19:04:50 +0300 Message-ID: <20230704160454.4187-2-igozlan@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230704160454.4187-1-igozlan@nvidia.com> References: <20230704104645.19800-5-igozlan@nvidia.com> <20230704160454.4187-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: DM6NAM11FT109:EE_|PH0PR12MB5403:EE_ X-MS-Office365-Filtering-Correlation-Id: b2cf3c99-dd17-43d2-8cb3-08db7ca896cc 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: ymcvAQywv+gUDIzO1K2NRDgX8Df6YTUTvy5lVfUKdGYVhrVuCpTvXQ38IN/1yxxdKDdI9EHIUIv5eBs7yKE/exKiMCaVu2pSLSon8xabspAVMA10A1PFlal6/p/ld9dyRknbG8JSIxylO9b8PXqmmviHzdKDNbvY5v9/Pn9+vMhSNspfVoOreu3XrPCz37aaxu3wT8mk2Gs3Xups7RXVVbPPo9E74QowN4lCLBR3McJo4xVusxx78g0z4lzrP04ui5hL6u02NAwMAQhlFutJ6kFmwLPekvGNXbpxfPEdo7X1wQXs8ULqATFwQOvXrujH8EWWLX4lIREmq2c2fvKwIyLrVrdoEBQ6aw/ctGWlvF6yf8sn2Abl3SlNSYZvOnXsYOWKyQWMru8XlWkBj4Mhs5WdgscmPkMm7ES5U/snVlL86kpcWq4DzRYTXOHFqMGu5X/wsi0oEhsXmWYB+krTuhWw0jFRgYkJ1192ZcPr5PWfihThLlJ3318szex/kqQO2TxMC50QYpAkXeKqwfJGySImb+/8wHvLlXJyV6zJMDJnHAbuoAnEGIe2FY75hlS7tPoPPpj58oznuRWAG9U/E2xotnd3gWuj9ihY4gn/8hnxmYQ3ZgHHs/f817P5XJUNELMCwtjRPjIWKEmUopknr47BSIfubFbW5iJgerPnL2tjCO+caunJkSImr/9+IeDsXWK3Y4E22L7x+c84UnsUgQCByCkIvz3BABuwRshEgio7JZ0mylqRtLfegy5d0rEH 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:(13230028)(4636009)(396003)(346002)(136003)(376002)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(110136005)(2906002)(478600001)(26005)(6666004)(86362001)(7696005)(41300700001)(8936002)(8676002)(5660300002)(36756003)(316002)(40460700003)(70586007)(6636002)(55016003)(4326008)(70206006)(40480700001)(1076003)(82740400003)(7636003)(356005)(47076005)(2616005)(6286002)(186003)(82310400005)(336012)(83380400001)(426003)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 16:06:12.7832 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2cf3c99-dd17-43d2-8cb3-08db7ca896cc 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: DM6NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5403 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 Acked-by: Matan Azrad --- 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