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 C7B6141C89; Mon, 13 Feb 2023 14:38:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B44F642D10; Mon, 13 Feb 2023 14:38:24 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2047.outbound.protection.outlook.com [40.107.243.47]) by mails.dpdk.org (Postfix) with ESMTP id 1144F42C54 for ; Mon, 13 Feb 2023 14:38:23 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D+3VxTrBVzJl2a6YbZm3kv9AyE2xPxS87La4kLUdvtJIX16Py9mmyaFjxikqKfFPEhfPXe58l4rG6/aP3U2fqhhrqJFQqlzxzoz0xPUjeakr0c3gFcvMINICzeU5/LyKrXSmpEzU4w6KnRh7L/AcvmaVOWmtnGfMkQUiZDiS3RUhlzJCKXPeM8voa2xQlksHEJjRkFkkQ1ioh2TFUiSL9J7qkw7MfHBqxys9LgMu7WOqktVUn2rR3iJy6wvAoXT1nGE2w2DhpqjHg0EJejUljVwids1x1LQPDxH2Q6BgF2dP84OQ9dnSIBRcjaAL48y3Ll1+JtdHf+nsE8ntSihZKw== 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=3YycRqNjSW+mqSMhA47dv4i56OXdhOUmBOOAiQkVi1s=; b=IJf9/fN+AkwjSQm4PRr+tZavICQXyLh6Tet3b9/r8UgVwLcAuz6Q2A5621VYGtXHNIiCfpn1UibULzH6zqdhRvBEe5kM3enCizhsUdqlmB5oe0RRMI9S7JpCduCFzqU9Pfv2erru71ZYFVLgSt/Q9Bo6Gx4OHNTij316ExfCBQ3LqqLN7kyMtIOZfiDRTH/9zDMm1ViTCydn/jvaVPETOfoq5tFGA45+X4jSZpPznQOZgjLz20Wbmey2t9JWvbn9sijsFdkbf7LAUgx8jlDaxBLIDE/4RcF4NY4y8asZPm/y5BstiyXFEiXfAmttaq10VGsNZwhEjFWun3n+4GGCgw== 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 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=3YycRqNjSW+mqSMhA47dv4i56OXdhOUmBOOAiQkVi1s=; b=o7qUuXi/sTqxNucETpyIEw263d34owMXD43VuidSL0F6aPpCtIbwpYHU+ynvEyqqskqrPwvjtosU270xs5JqduxJh3d3cNJo7BdCCKeTinzO5sUqiMXJ2sr22ItIsr9dozyjQiKLw6utHygqiAZXXJAeL5x7u/+6NVkFaP/dx0Uf46dEQdCipCGE+V6e2mQlKtlyDUKyWvQYu1jU30fsgXCDpK057CzsRo4lye5JG1p1200/tjgclePLSVms0Bk7m4NMzzYvWI8MWW4yPr0pJfFiDW1cWVrA/MkgJ6w6WBYenJBTTxGjaL2DBmqbYhPP9+Cq5fbchhiFqk+l3HcVRw== Received: from DS7PR03CA0327.namprd03.prod.outlook.com (2603:10b6:8:2b::35) by CY5PR12MB6108.namprd12.prod.outlook.com (2603:10b6:930:27::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Mon, 13 Feb 2023 13:38:21 +0000 Received: from DS1PEPF0000E636.namprd02.prod.outlook.com (2603:10b6:8:2b:cafe::ee) by DS7PR03CA0327.outlook.office365.com (2603:10b6:8:2b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24 via Frontend Transport; Mon, 13 Feb 2023 13:38:21 +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 DS1PEPF0000E636.mail.protection.outlook.com (10.167.17.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.8 via Frontend Transport; Mon, 13 Feb 2023 13:38:21 +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.36; Mon, 13 Feb 2023 05:38:05 -0800 Received: from nvidia.com (10.126.231.37) 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.986.36; Mon, 13 Feb 2023 05:38:03 -0800 From: Viacheslav Ovsiienko To: CC: , , , Erez Shitrit Subject: [PATCH v4 1/5] net/mlx5/hws: free FT from RTC ID before set the new value Date: Mon, 13 Feb 2023 15:37:36 +0200 Message-ID: <20230213133740.27005-2-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230213133740.27005-1-viacheslavo@nvidia.com> References: <20230206095229.23027-1-viacheslavo@nvidia.com> <20230213133740.27005-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E636:EE_|CY5PR12MB6108:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a35213a-1d4a-4053-752e-08db0dc7929e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DEGC3JfTGiu2p7padu42kpX6uaQ78gtlzlLSdfas/SHDiAiCddmfCgQphGO9p0Fnt8KQ28dpnLt4F6aTkA6Ozr1oLh5fBQmVUpG4qTAM67auKu32Kq4PG9LJ6w9HcnerXISp/yzFZfl2owwHe04EZHqB+cSzqMpxLe9rUMk0gqyk1gFv0kBI8H7UPKHlKjDUn+Ro/niXv1HQvEwbGf1XP4qzcPPguRs3UP5ovH9kcm3AJek8VRAl8xogtlVa2dP1J/GTcpWkw6FilorhoXJIULkEEIyFsnPuEsbdpsimAGdEHEazvAWeIAAaFE0rKrO+fnuP0lhHUpNAU+xTBupcrz2sRl4modNhS3P0SylXr6eQTfEYCHKb+VVU5IAJx8BiBqRoCj/SQUWIMMyWdSFcYGiNTdRg+wdhrkEpyQQ2Wr3dCu9m9M12pOoTqkW3j0/8TZTCzjjhxR33q+OHFHUbnu4oKDdFpB2XLOVhWrL5nlzqf1SOSOBYW71QslBQB4/qARddOZZqAtIEdp44d/8U2VYv8/QHf1ljKQ/KD8p3MKa+UwB41T8gqYfPoAhHBBToAqMG/vj7ovLd0EywKYn49jnNIYGSaylawmrxzRfF0rE4zzMw8MrRNz3QGgNwfeZPpoRXapzvuQg4bZ6TWiGpCA0yaXXgQbiOTkc5wpTTpl00ROueEQkxvi4/f+HHa6kXqnIy/IV/wCCno/xRWQ10Qg== 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:(13230025)(4636009)(346002)(136003)(396003)(39860400002)(376002)(451199018)(36840700001)(40470700004)(46966006)(55016003)(83380400001)(36756003)(6666004)(82310400005)(40480700001)(2906002)(356005)(1076003)(40460700003)(7636003)(36860700001)(82740400003)(16526019)(7696005)(478600001)(26005)(107886003)(186003)(316002)(54906003)(6286002)(5660300002)(8676002)(41300700001)(4326008)(336012)(8936002)(47076005)(86362001)(2616005)(6916009)(70206006)(426003)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2023 13:38:21.1005 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a35213a-1d4a-4053-752e-08db0dc7929e 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: DS1PEPF0000E636.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6108 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: Erez Shitrit While matcher is being connect/disconnect in shared gvmi flow we set the first ft in the table to point on the first matcher, The FW is increasing the refcount on the first matcher RTC because of that no matcher if it is the same RTC that was set before, and when we will try to release that RTC we will get the following syndrome: 0xaa0093 - destroy_rtc_object: rtc in use or doesn't exist. In order to resolve that we clean the current pointed RTC from that ft and only after that setting it to the new RTC value. Signed-off-by: Erez Shitrit Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/hws/mlx5dr_matcher.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c index 5508cfe230..6af493d87a 100644 --- a/drivers/net/mlx5/hws/mlx5dr_matcher.c +++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c @@ -334,6 +334,24 @@ static int mlx5dr_matcher_disconnect(struct mlx5dr_matcher *matcher) return ret; } + if (!next) { + /* ft no longer points to any RTC, drop refcount */ + ret = mlx5dr_matcher_free_rtc_pointing(tbl->ctx, + tbl->fw_ft_type, + tbl->type, + prev_ft); + if (ret) { + DR_LOG(ERR, "Failed to reset last RTC refcount"); + return ret; + } + } + + ret = mlx5dr_matcher_shared_update_local_ft(tbl); + if (ret) { + DR_LOG(ERR, "Failed to update local_ft in shared table"); + return ret; + } + return 0; } -- 2.18.1