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 BFFC342DD1; Tue, 4 Jul 2023 12:48:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ABD1942BFE; Tue, 4 Jul 2023 12:48:16 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2058.outbound.protection.outlook.com [40.107.102.58]) by mails.dpdk.org (Postfix) with ESMTP id DEBA840042 for ; Tue, 4 Jul 2023 12:48:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GR6RI9RRLZTOSaK3pnaFvE9nEqzLEj0kqPiNAAd58MVm+lOwO9QE24So7KygqQS9vXe7B1UgtmArVoasaXFiP9FfmtMsYpWVYfIFf/u+uNos07iQWnyjpfsk49CE4gw2+5EFAhiGqh+3Zeq8Rw5g2XPJGZGrrT1V91ADO+TCfPPwKpdK/Rk5UEwcNIec2Xg1IpboxJdsxGMpnmnAsSbfkGfMsoLwdP54wnfBcQwJWX4lrYnBoFhxBj6xqHwoWPQVWju4jf6S5gfu519CeaD/uhiCEG/yWjc343Pxqk3GMgAi2c59/AxavTMSgvJ4yb4c6PwirWG4Q0PpzZbnqEq1Ew== 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=gm3OfJB2c6Xm49//4qkdG229nUMf+J2PwTEP1tXv+0gQNLLbqATWlEMmUYqzrPmyvTtmVGknYRs9ueqyYNi0v6bHNTA7IM31UDwu9HctrkbyT6l0yJrvRzfyl+SMYjWflHslAGR/lZ+Gcw2efZ0tkQ8XlfoCa/o0KAFs0/wqq9TQOcQ7LMHYFN6tKOIVbeeDyPWhCbZ83UWmV0NFVDutCqtiy/YzAFGjDrbfB+HZreVQqsSJU/GIaj/byuiGRGgr07IHZGqr89nzi82hOUVrXzglxmHBU4yvesRuLlLNKutN1IIuVqLw4GMCEvgIds5h2rHWR8vNu61ybCmPGKPgOw== 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=Y+OWWyZmIx2v94WJ+b+fw5+Hn66LP/JKQhu2/7nqEQkFs5yY8gz16bF6wvyPvZvFFGTrMXHG+ZnX01IhEtbrB1Irf/Ck23ZY02KJDlkkyPS+dmex5e2AD4xSlQhe1oBfBcRBgLwvumPRS1pvIhiH8PbxQMR4QFwNI7G2H1MTPTh0kG4u2TJDXQ3uY5OCGeY7nz7e8epMuH1CP4exu2DCA6FdeufOph6qAWrFKKsMLkqIActyI+qCso3rgmmViQPofpHor3TS4NN5SFuRmwN9CrAJu6Go8l95gYTOMm9T87SpZzp5tQ5Iag8zDxLKZbU/pb0k6FBNj/DB0LEOSQmN6Q== Received: from MW4P221CA0015.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::20) by CH3PR12MB9249.namprd12.prod.outlook.com (2603:10b6:610:1bc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Tue, 4 Jul 2023 10:48:13 +0000 Received: from CO1NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8b:cafe::8) by MW4P221CA0015.outlook.office365.com (2603:10b6:303:8b::20) 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 10:48: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 CO1NAM11FT049.mail.protection.outlook.com (10.13.175.50) 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 10:48:12 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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 03:48:01 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Tue, 4 Jul 2023 03:48:01 -0700 Received: from nvidia.com (10.127.8.12) by mail.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 via Frontend Transport; Tue, 4 Jul 2023 03:47:59 -0700 From: Itamar Gozlan To: , , , , , Ori Kam CC: Subject: [v1 2/5] net/mlx5/hws: allow destroying rule resources on error Date: Tue, 4 Jul 2023 13:46:42 +0300 Message-ID: <20230704104645.19800-2-igozlan@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230704104645.19800-1-igozlan@nvidia.com> References: <20230702045758.23244-4-igozlan@nvidia.com> <20230704104645.19800-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: CO1NAM11FT049:EE_|CH3PR12MB9249:EE_ X-MS-Office365-Filtering-Correlation-Id: 0468fde2-caae-421d-4f80-08db7c7c2a3e 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: U5b7HeqmsCMHH7srzemfWP1d3f30w6HDGOh2d2y19x0yaOQLQviwo1zJwWlsNlFoZR21U4U9A1Nhh5SCgJdUGeWXXXwqls1icd2/lz5MQDs/5jpbUNDL/ZdSV+u88Wdcavp5NAHJDxgBn7ZhKJYUVsanP3n7TaieiL3B8YMLVI0Rk+yXDGzKzrk5uut1p67HT57p4KaMpwI1OSAl0v185qUJt4NFJ62KBUs/gsKlOYj0p51J3mtz94knhZppinNdbADolAqaNvaUIsl4EMAnEh4OE3qW0SCPpk804MtfUxsCNXuLtCPK5QyEnVf7/WxIfvtYZSaUfAqQPNQ4j6iitZ2p1FJXQed07TWK7CSl0UYVdSDPpfE1l7jlIBso/+1fF/3l1ZPLXt5Gpc+//Z8ZyUXG4ApCfbptC2VlWJhwYcyivH5t+Vc7wnoOtQ95zNh5a3BpcyuVNyy2fTkZh6eg2QJq4tK4NjLFCjGXvwZGPGxQW61/mXGT8qTRgfx+ZUl0QakFboMEOwrzklxxnF0IxPx50pTOOjHvIHzAWcbxtdxADdgg0oETclI6Mj0Q4QKTz+pqHMWsTVy/vMb5NLfZPcXbIh/PTzmKnmhAcIdTcg8LSmXv6wpJxuardjukXSxvAZiA5Z+RTiTIq0rvm0g+OiPDNlynjKvlIX/94eWJlH+Uhs+raIL5PWF3DTMqgr6RnvXooM7jEQaLu+lXtSLgh2xkHZrC9GS54g+oQguodUEy7yHnIcbvIFPp7wGaWMR+ 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)(39860400002)(396003)(136003)(376002)(346002)(451199021)(36840700001)(40470700004)(46966006)(41300700001)(8936002)(8676002)(110136005)(36756003)(40480700001)(7696005)(55016003)(316002)(5660300002)(2906002)(6666004)(6636002)(4326008)(70586007)(70206006)(40460700003)(426003)(336012)(478600001)(82740400003)(82310400005)(186003)(86362001)(6286002)(2616005)(356005)(7636003)(47076005)(83380400001)(1076003)(26005)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 10:48:12.8010 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0468fde2-caae-421d-4f80-08db7c7c2a3e 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: CO1NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9249 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