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 42CE6A00C4 for ; Mon, 14 Feb 2022 10:35:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3943241157; Mon, 14 Feb 2022 10:35:35 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2089.outbound.protection.outlook.com [40.107.236.89]) by mails.dpdk.org (Postfix) with ESMTP id 44B7241150; Mon, 14 Feb 2022 10:35:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aTEjHurCSFy4Dnq+hXgG2tCQI895fXTdrFZVBQVCcIFFzwRB9kOOEp16YZLwWpfJPjIY8ENoUFMhnWQv5VB/vGbpxCH3b0g5Vln6m8UJQyiEUYaXIkex9fy8EycSo8leMPDU6pYaCqD4cyudbvN2lAZHGF1DYSQv2SU8b/eXNI/RSpD/I3oMKETAgPfPYUVBeLAyUbWei/PthRJ0OVEgo1Fny4kWjf+HjLlxTQhlF9rl/YKrUb4w+BvXL7q7K49OH9blkchQpwFCuo5KnAQSDkA+SsxOQ8+rq+A1Bq176nif/G4HL0qyp223g2OBxwOonEL8/0iokOnNulBfLB0LlQ== 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=W6a/XJL9mwqjiU1JWyyy5fmnuNmEVcbADUz8HCC1dQ0=; b=At2Hl2UGuunCmfTlsI1I4yOlfoRIN/3TGjAri/gKQIVEHAYJCw9rTGRiArM08p1haeX8+HNo92QKbqYjTagT/sv+oHVQMtp8Hgw4BxDyOpOghr6eMovuiGzimOwb9J43QeOESY/mmdW7enLN5ai74nA/As31/VDhj6zkoE6r2yvg/scjjqSzbFytTIaRPZcRRve9b8B1W6lIq0nepkqXRdxlnaNEKiwIhP9ThRJ2n3CgYeD88dz/2WBNiam5vo1mYiFTjMNPJawcUVOSshgkuKGGS1/mZHPkfhkWS0MxgJ3rygEolhOFZtUkP/N6JGUnB8TaQLIv7d3zn12mJpSn8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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 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=W6a/XJL9mwqjiU1JWyyy5fmnuNmEVcbADUz8HCC1dQ0=; b=tGdvGSK4t+I5rA6mxBCuZmlBNKrTeUeJmDBynqqWFNxx3J26vtaMehh7XY8PZfYU+tL1U2YWOzb1zF6gb2x5HlPQ/+nUqIx1PHLPmpfZQ3fYR6dcKKPYEFnEO78QHYZpKQNwvpO/V6tlmKfm4H/+AkbQAobyK3+ajxRdVM90YiKMoIDp+yvsb8ukcKPRL4lH0qraN+bqcBvtwkIUJZUC6wblC1hlGOzXskcxR+Hno6nEJbnxU0h9mavzC5vXnxVx9bT5T7n8jFqel8vKulYky6I/KRLuFOeKA3rLDTihyQHMkanun8sqP6ON1FJ4JG8WfpZKC6Y7YlDvPrTg58UcQA== Received: from BN9PR03CA0623.namprd03.prod.outlook.com (2603:10b6:408:106::28) by DM5PR12MB1626.namprd12.prod.outlook.com (2603:10b6:4:d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Mon, 14 Feb 2022 09:35:31 +0000 Received: from BN8NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:408:106:cafe::6e) by BN9PR03CA0623.outlook.office365.com (2603:10b6:408:106::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 09:35:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT059.mail.protection.outlook.com (10.13.177.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Mon, 14 Feb 2022 09:35:30 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 14 Feb 2022 09:35:30 +0000 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.9; Mon, 14 Feb 2022 01:35:29 -0800 Received: from nvidia.com (10.127.8.13) 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.9 via Frontend Transport; Mon, 14 Feb 2022 01:35:27 -0800 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Subject: [PATCH v2 03/20] net/mlx5: fix wrong place of ASO CT object release Date: Mon, 14 Feb 2022 11:34:54 +0200 Message-ID: <20220214093511.1592698-4-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220214093511.1592698-1-michaelba@nvidia.com> References: <20220127153950.812953-1-michaelba@nvidia.com> <20220214093511.1592698-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d0f056c-9333-40fb-3b98-08d9ef9d57b1 X-MS-TrafficTypeDiagnostic: DM5PR12MB1626:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vSedBpO6VBp8F2VgKkeOp0uY35hsl4SEn50qsOsHRVPlstYF8a8exK7VhUhPtOfg+xVpRqVlnIqyNh69yZf7Y+xRG4X1ooNZLaAhEwIjz9YPm7QRbdqGNDW62fdP8WYdmecUnSK0tGqznzRDt4b1eaqmbARq4w9/aKe/Xpp0sEHs7ObGqax95ykhgnZJ6ykB0AFubbDx9x/OhqstpT11gU7o3622DUjLSMNBA8EwbOEFb1kYFxbm9Qml40G4rYWp20aL3WcsrUuhfp0MZgeCyM9c05yiGbTV/0mhpZfhJ03oZuSacfVycu1M0Y4D/bztyNuT0m7Gvl8LdAvMr4dkJ8JoxiGWvm8zbf0Hpw0C7AdOu2MTUseCB4pEKXjRyYF9ci/4sN8/52DYSaXTJz70bPz08yxCBZBr4rizzREw03x9dszBrwdmcPwY1zi+leBZrjVZ6TooS+FQiV+vcclkYskggrghlqTpFPMvWTlEI7LxsA/uB6cgGGuAn5hI3dsUCFvaTTEmSrzR+eRySgEZMQDrlvbnz/bNnmDYvrsATj52AEYCkgKUBlSXKiA9aZ5jzQNB2uFDIvdn5IgZmWZPJjKcBPEEuvduaJ3sQShZkX0lgA0uJUmBifUatq15A4l01oIbrskptkKoeHGj+qgeo2bGLP+OQ8g3pO2oeyZ1r+I6N/E7kR4QNb1Qq2I3T0STZJGA+QUDQT69V7IvbjNSDw== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(426003)(6286002)(83380400001)(186003)(2616005)(336012)(26005)(36756003)(55016003)(1076003)(6666004)(2906002)(47076005)(81166007)(40460700003)(7696005)(86362001)(8936002)(508600001)(70586007)(8676002)(4326008)(5660300002)(450100002)(316002)(54906003)(356005)(6916009)(36860700001)(70206006)(82310400004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2022 09:35:30.7897 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d0f056c-9333-40fb-3b98-08d9ef9d57b1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1626 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 The ASO connection tracking structure is initialized once for sharing device context. Its release takes place in the close function which is called for each ethdev individually. i.e. when there is more than one ethdev under the same sharing device context, it will be destroyed when one of them is closed. If the other wants to use it later, it may cause it to crash. In addition, the creation of this structure is performed in the spawn function. if one of the creations of the objects following it fails, it is supposed to be destroyed but this does not happen. This patch moves its release to the sharing device context free function and thus solves both problems. Fixes: 0af8a2298a42 ("net/mlx5: release connection tracking management") Fixes: ee9e5fad03eb ("net/mlx5: initialize connection tracking management") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 5571e90677..cde8d022cd 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1321,6 +1321,8 @@ mlx5_free_shared_dev_ctx(struct mlx5_dev_ctx_shared *sh) * Only primary process handles async device events. **/ mlx5_flow_counters_mng_close(sh); + if (sh->ct_mng) + mlx5_flow_aso_ct_mng_close(sh); if (sh->aso_age_mng) { mlx5_flow_aso_age_mng_close(sh); sh->aso_age_mng = NULL; @@ -1594,8 +1596,6 @@ mlx5_dev_close(struct rte_eth_dev *dev) if (priv->mreg_cp_tbl) mlx5_hlist_destroy(priv->mreg_cp_tbl); mlx5_mprq_free_mp(dev); - if (priv->sh->ct_mng) - mlx5_flow_aso_ct_mng_close(priv->sh); mlx5_os_free_shared_dr(priv); if (priv->rss_conf.rss_key != NULL) mlx5_free(priv->rss_conf.rss_key); -- 2.25.1