From patchwork Thu Jan 27 15:39:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 106622 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9CC19A0032; Thu, 27 Jan 2022 16:40:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A923742845; Thu, 27 Jan 2022 16:40:07 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2047.outbound.protection.outlook.com [40.107.93.47]) by mails.dpdk.org (Postfix) with ESMTP id 1F8C74281C; Thu, 27 Jan 2022 16:40:05 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EWBFqVXxAdsmHjn9/fSu/XHuSk3/iuyFGD3XDBbnbYMgn5aawlyJSLdxRpVjUell/vktFP1XwsrFQp8ZioWojNip5RKTGaFwW0qo5CupvWo2HSNvfum5FqhCPx5Hk83+udxRrUlq6VluHwG3o6ktqmzA682TnXwfzcgSUDY/U7TnWebL41wJWebHVNJd1YV0+iOxLBuwexIduoBxUjO7wlcdo9DuyckyKpkToPVoi3g+pka0qeeDmZUJUzOiIDBFgO2rTScD8P4c1bKye9f5dfvUo2eStgQkzK+zhvZn2KzTWTOVHjLAK0jSwg6gunijJf+kI8yO2bxleaQ0LC+9pg== 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=txcwG8Boz71CGNpoaQVbi/AloBiRXnW869ETbtuxyog=; b=QrJf9Gs7twLGur/3tub8PetIghPu0mOY3jreNPFqOGTzpqo7RC29u7HXWlOQsVqywzBSB91IkOGAPaef0ZJZI3n4uBL5v/wa3QLICkWByBpChB7rbJSdZkuy8w2KSXt0uL4+cyopGDD5zNqME5MyqK4CYjMXIBfpK14wqIZH6QyLd9y+yKc30oDa6k/NfDL8o8BzG0vV7F8JNo2AdDdL7lhaHeySJ9a7S3jGk9BkKW+PzdjXo3n0z6wU8FAcXF2EKSvKFZeybaHI/whz+1bW0TGV9pKxaqrtks5UxlCvkGwBvDQZHcmLNNGEWVIkgjuCrHkgDIAs3PcKiAgkYPaOgg== 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=txcwG8Boz71CGNpoaQVbi/AloBiRXnW869ETbtuxyog=; b=EUje9v5jdTlwZi5VFA9P52VRDwj3pGNOcik37Q00YgtayVEkVIZDtOIdSt/TKIzKSdCXW3YusDMebyUX9dwGcqmnsjS8SdOifeh3+ef2SUtVN//U9VApFKTg5zUgoreo/rxN2InCou6pA0YCPrDtJUAnnhZphFrmDn4tvpyEDiuvNwJhFrNeQYsRCw5tyoJi/hSAZkUdPjG2OlwlYOj3oIGJuxWdqXIXGX0/SGprtIx6SObr5cFp3dZPkeGjunRyN6dg09/qKpbRhfqJP18eqn38VWASNBQIEsGn7kQTnnXer/2y1HFsbeQeMdJMGEo34YHM9KogbLyccQwNMQUqrA== Received: from DM6PR02CA0126.namprd02.prod.outlook.com (2603:10b6:5:1b4::28) by BL0PR12MB2482.namprd12.prod.outlook.com (2603:10b6:207:4a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Thu, 27 Jan 2022 15:40:03 +0000 Received: from DM6NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b4:cafe::18) by DM6PR02CA0126.outlook.office365.com (2603:10b6:5:1b4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17 via Frontend Transport; Thu, 27 Jan 2022 15:40:03 +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 DM6NAM11FT030.mail.protection.outlook.com (10.13.172.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4930.15 via Frontend Transport; Thu, 27 Jan 2022 15:40:03 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 27 Jan 2022 15:40:02 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Thu, 27 Jan 2022 07:40:01 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9 via Frontend Transport; Thu, 27 Jan 2022 07:40:00 -0800 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Subject: [PATCH 03/20] net/mlx5: fix wrong place of ASO CT object release Date: Thu, 27 Jan 2022 17:39:33 +0200 Message-ID: <20220127153950.812953-4-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127153950.812953-1-michaelba@nvidia.com> References: <20220127153950.812953-1-michaelba@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9619fba3-8cda-47cc-a1e3-08d9e1ab4926 X-MS-TrafficTypeDiagnostic: BL0PR12MB2482: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: 6CCcwO6pVzjw+9wuhn+dsbaTbNXt87RUvqsqT4jkZpVVPN1mkfIyomot5i2bmFXC4QeXwccz2zY9JaMk0p+c+wtD7jn4Hm2mCQsuXkU5bBhwifK866Gtt1v9KG0N5k+NnnnbWS80NzM2TGu5P5gfqKX3jXVxyqb6bE+Sni7iM+SqHpkocpcKGZ4fd/B+lEo1zXuBpeVZ6TFUyIIOJDwBxX1aj0p5PF3uM/Uleu+Bdkk6ZqSFGIdvsPnigLJn6PTvCCvvJ3F9bQlPzgxo404hAzcZyqmhs76wftg8dyP9WlNK5yHsBdEUG0BDTbveobp5fhSGOUEUpx74IHw9k+U6lq+WoW3PqcC/W/zn67W44Y/PXArAey9wQpn7nhkX8IcFW9No38f8TmHdL8y/78nxhpcEYdl0WfALgVj2axpFuc6ByTAelcvCzaHVqdd//HzeOdi0LYKgWYeGLb4FasaK1+EetnHLMhd7FCPlaBKqYQTtheQ7JBuOQ9wP3He+iUVKYZDU1PThtKxfoaawvc2c1IM5z8uHN1+uOqpewrkuAH9PlaxZMrpjnc/dcwopjFjFSQOSwMxgDS6UWyorMsAv55mG2a+0m2jXCPR3rA2+/2QaqxCscv3LmkGuJ/1/2NGj1qGGcoIQapURFJN0C1qrMwyrRJBqjzBQgGY/zP4u7Aty0b3w6HlX58hImYc4+n7njJBHYwHOvnkBjPtHxUwVxQ== 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)(46966006)(40470700004)(36840700001)(5660300002)(83380400001)(36756003)(2906002)(82310400004)(4326008)(8936002)(8676002)(70206006)(70586007)(450100002)(6286002)(2616005)(1076003)(426003)(336012)(186003)(86362001)(81166007)(26005)(55016003)(47076005)(40460700003)(36860700001)(356005)(6666004)(7696005)(508600001)(316002)(6916009)(54906003)(36900700001)(20210929001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 15:40:03.1155 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9619fba3-8cda-47cc-a1e3-08d9e1ab4926 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: DM6NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2482 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 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 67eda41a60..d1d398f49a 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);