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 D635143C54 for ; Wed, 6 Mar 2024 07:02:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C94204281D; Wed, 6 Mar 2024 07:02:46 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2042.outbound.protection.outlook.com [40.107.244.42]) by mails.dpdk.org (Postfix) with ESMTP id 0985C40156; Wed, 6 Mar 2024 07:02:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=amoFwNK0uveGsU3TVPLguqW7jQg2105b7KW7+M9vdPasLES+W6yWNi9VFGB2Zhim8z4eBezgeAc42QgkTUS0Dcxf2sjKwF9gv/+rgV0giqBZltdcFQc14wypMepXLCuJ4Dl796TMOEI0fWKVbDTjVzfEDLzFqxBavKWRpQ4bdmnbRTG8NXSkMcwzYwRGxOiPRbAQg4cm0+0jel71f/aUODbdAH8FSkcS1Y8JaEY58RovtKnj2x3RZwFstsKjuU+hIbGKjMtaqVcrcU+S7kX0DkSowAbpkINa8L6qxZH/N1hwE4Qb/C7gVLOppVd7/BCGjR3HlG7hFWy/AqAjqeZFRA== 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=a8eHUDq7lneoVQuBRHqAOux7E3JcnKAm0EMXdtvALwA=; b=LzTHeH1RjYXXALwO17NbVoqlahnAn5XXK/zbobPqmgCatFwbKFCD7H1CtQtOmzcDc5QR1mGcWozjA85uosbko8gWntaln9i4ReEm/tdXrp7fsH43Ku87c/R8xIKh8l0DUUfBM6kBy7UdoN0s/pR8bvm5ZC92IeQ9krbea5QysJZ6IbuX0Ei+TlQr3eGR8Q4bcoejXf7OnY5xwwwq22E0WxhsGk1iIJEr40Der4o6pBzf3CCfvlqwBcPW7Ro82ei2oYZZtAW1bRK/1+1c6w2GRcDXd2uRWNkuZ2P5KYjpkSvQ9ooHvCXKHqom5Q3tcvsWmY8S1OufQjAPKbT3GR8znw== 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=a8eHUDq7lneoVQuBRHqAOux7E3JcnKAm0EMXdtvALwA=; b=SxbET/35nFodFvSFbRtED4PvLAwvGMiRdUy5pcorKD65oR/kn+8YbFDq2/0YigaUwJYIDRY+axm96uEjtT7T0DLNGVfhJ2XLpE2Cve0BpdTDMaJeZmCDueCzOUcZ1pstljUEpIyft5rrwt3G1/ah+rWkWJ3MEG4jiguAv8kTjWp8VLms0f7NiXkvVXzPnUmpeKPpUy5nLyqG1TyGNgCqfaJAv6Vb/AHVmfEhSpUfVK5Elg7Jf/tvcBRzMUL4wuydwSQpcD2GtER4APHKaNWGxNppwNW5rtR/5aTGsB0prM0hptyKLwISqaQr/ls0INDt3BcYI2n9LzRDoXJlAGr2eg== Received: from MN2PR20CA0049.namprd20.prod.outlook.com (2603:10b6:208:235::18) by CH3PR12MB7665.namprd12.prod.outlook.com (2603:10b6:610:14a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Wed, 6 Mar 2024 06:02:39 +0000 Received: from BN3PEPF0000B073.namprd04.prod.outlook.com (2603:10b6:208:235:cafe::1d) by MN2PR20CA0049.outlook.office365.com (2603:10b6:208:235::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24 via Frontend Transport; Wed, 6 Mar 2024 06:02:39 +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 BN3PEPF0000B073.mail.protection.outlook.com (10.167.243.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Wed, 6 Mar 2024 06:02:39 +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, 5 Mar 2024 22:02:20 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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, 5 Mar 2024 22:02:20 -0800 Received: from nvidia.com (10.127.8.14) 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.1258.12 via Frontend Transport; Tue, 5 Mar 2024 22:02:17 -0800 From: Maayan Kashani To: CC: , , , "Dariusz Sosnowski" , Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad Subject: [PATCH] net/mlx5: fix mlx5dr context release ordering Date: Wed, 6 Mar 2024 08:02:07 +0200 Message-ID: <20240306060211.36943-1-mkashani@nvidia.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B073:EE_|CH3PR12MB7665:EE_ X-MS-Office365-Filtering-Correlation-Id: 85a13b7d-3ba6-41e3-bf17-08dc3da30767 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3yB9alHqVArNrlm48jhlrkk+yPgS3nDI0L2IXGYtP8/FunMnqA65ekJyVpaKGd5qURnm8hZVimLwUQlt1Vuvt/C3BIOK3PEJPpBnThw2dbqIc/Ioz4tvRRkREDuXd8jybpHf8vLIO926M8YS6v+p154yuhpEZSmUJm89+NFl9Wfxyi3Hetn2szR897tJvgzF0/EN0kgNXD5OksFaAdVQAcf/gLSEhjK3K6Hinpted+pnWFE0Dyz/AHF04FAhbpyHc5Bf3cc4MBIWQdB11gFuH2cq4+F5t3L6wkthUMnMbhRLdxRYcdM3F2HqWY3TxodG+plbnb/bQgeWkxV5MmmvhQ+oDSbqGEZaBjG6LtThQjs4eMbbhazMDgwz8955wdSTn9AaRpddiBW5Jp/UgaZF9Dcwm7ApWxzjWKOxOpvZc2Ehz/4FLMXFEeR6GzRH78bB0/3ytz0NGCspaED4wYuuRz/z7kPAcKiFVYDJ5mdqKGSOp5IDA+f5VZkE5XnhMZEGeGspYVRbP6mmzF+yX9zR7chlko4ppT4fp2u+KJefMIBHGqcgtV2nRoMTxIGiEaMYfgzp6qkf6w0Df0QrnRN3dMAFghC85gv5BKyao+vRODMUWDwPkmQ7FsKIbdzkc+9t4Hd440gwbmxB2EgZFTiyhLPhOoN8QvnCkyAHbkMOTy3l9OMY35dKm3doZRbldMfTWDKI6RyFr0V8ZNxdsk1xh4YiMU9ZlbtatjTR1FYLvftUqL6lEoGNzyHssOuBSV7r 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)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2024 06:02:39.0939 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85a13b7d-3ba6-41e3-bf17-08dc3da30767 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: BN3PEPF0000B073.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7665 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Creating rules on group >0, creates a jump action on the group table. Non template code releases the group data under shared mlx5dr free code, And the mlx5dr context was already closed in HWS code. Remove mlx5dr context release from hws resource release function. Fixes: b401400db24e ("net/mlx5: add port flow configuration") Cc: stable@dpdk.org Signed-off-by: Maayan Kashani Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5.c | 7 +++++++ drivers/net/mlx5/mlx5_flow_hw.c | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 39dc1830d1..8b54843a43 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -2355,6 +2355,7 @@ mlx5_dev_close(struct rte_eth_dev *dev) mlx5_indirect_list_handles_release(dev); #ifdef HAVE_MLX5_HWS_SUPPORT flow_hw_destroy_vport_action(dev); + /* dr context will be closed after mlx5_os_free_shared_dr. */ flow_hw_resource_release(dev); flow_hw_clear_port_info(dev); if (priv->tlv_options != NULL) { @@ -2391,6 +2392,12 @@ mlx5_dev_close(struct rte_eth_dev *dev) mlx5_hlist_destroy(priv->mreg_cp_tbl); mlx5_mprq_free_mp(dev); mlx5_os_free_shared_dr(priv); +#ifdef HAVE_MLX5_HWS_SUPPORT + if (priv->dr_ctx) { + claim_zero(mlx5dr_context_close(priv->dr_ctx)); + priv->dr_ctx = NULL; + } +#endif if (priv->rss_conf.rss_key != NULL) mlx5_free(priv->rss_conf.rss_key); if (priv->reta_idx != NULL) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 4216433c6e..f52093a59a 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -10707,13 +10707,11 @@ flow_hw_resource_release(struct rte_eth_dev *dev) } mlx5_free(priv->hw_q); priv->hw_q = NULL; - claim_zero(mlx5dr_context_close(priv->dr_ctx)); if (priv->shared_host) { struct mlx5_priv *host_priv = priv->shared_host->data->dev_private; __atomic_fetch_sub(&host_priv->shared_refcnt, 1, __ATOMIC_RELAXED); priv->shared_host = NULL; } - priv->dr_ctx = NULL; mlx5_free(priv->hw_attr); priv->hw_attr = NULL; priv->nb_queue = 0; -- 2.25.1