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 2C23941C30; Tue, 7 Feb 2023 15:03:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A95AE42BC9; Tue, 7 Feb 2023 15:03:03 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2049.outbound.protection.outlook.com [40.107.101.49]) by mails.dpdk.org (Postfix) with ESMTP id 1FD2A42D12 for ; Tue, 7 Feb 2023 15:03:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b0evFLhofgnlAafZw8q9i3aXpJ0M4HOoWz/HuGTWlw2z3RyKKV7Gx70ptCVvuV9gjdix2sPKsx1/q+BOX5vIdb2Ysk7Y7s1ZdhAtv5tT/Pbn5DEwZZEWwYdR+eD/oEuv3WW0c9N1ah5XH7hTgoAKxcHedBbWjkjPtXhMaNiiPL7h39HThjOnLTKpiao/fK/DzRDvZwL+N0QB+6qK/K4HdnAgRPfV1bufTXWf4F5TpLKNpq8bsrez5qSo8Tz+ZxNMjh2jy1F1EYzWko8afxOk4GDu1OhPvCk06mfeF0oDzA5T+XSghLjUDjtm0/xqjZwitqXlQOzH7dPS1JpPG83jEg== 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=6mjSvimQTw0FgV4q3jSJeq5FCSYHIp8Scn1CZA2mgh4=; b=L4u0xlbnfhveqF9CKdscCwv5IToeN9yfVIvOSWMShGB95KkWczNfehDYFoH2DueruWShYDRhvGYXas9GXmXM5cufNV8t8S4obMxcOZhQ0nK9NksjfNB4mboY/w5b1gwZJSa+RJMg7FmhtHyKL7JD0HTWcipRKEw2TZ/s053LK5QBhqXihhXUxs1Q7/BR3REViIFS7MphfOwpRHvAGFQGLYIzz6m0LGNaku2o0tPHu/aafxavRtKL0Xl5UfmfbCU/d7UIc+r2GJzk4AXdjWzsTXnKDUB3ZiV1SfYIeFJIotqQJ1GMavxNBepq6xfx4OXrptvoZXnGFmPB97j+urozqA== 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=6mjSvimQTw0FgV4q3jSJeq5FCSYHIp8Scn1CZA2mgh4=; b=D2DOY3DG5rq5jXH8XxEgoIjAkC1MAXk49Mug6Z9LObsWE0Kp7uChtvrmzQKcs6SpNuW+oDuibbPdKX4TyTtboJRUsL0BdFfLZIl5XfhuGA/m+WH/fBqkwZknBcjjEHPoVfbMRe8fHwrX3Y8rfvK+SSBPRDwftD6IiYi7D270oasHu3wgRQFeL7vEL7iSwL2/PQVYExsYFM0R3I0EGzMUJLp6y8bPgyRV+cOlG3/hvvirjz51kJhoPF/eFE+N5csDlpQemnNIE7qRIGVtPa2aeiUxF7cuNahoNgqRww0ZNN6/pXLuNJ2YbOAaQXOBHb7b3CkXBEsYjW1VAkbsvUamJw== Received: from MW4PR04CA0386.namprd04.prod.outlook.com (2603:10b6:303:81::31) by MW4PR12MB6779.namprd12.prod.outlook.com (2603:10b6:303:20f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36; Tue, 7 Feb 2023 14:02:57 +0000 Received: from CO1NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:303:81:cafe::b4) by MW4PR04CA0386.outlook.office365.com (2603:10b6:303:81::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36 via Frontend Transport; Tue, 7 Feb 2023 14:02:56 +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 CO1NAM11FT045.mail.protection.outlook.com (10.13.175.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Tue, 7 Feb 2023 14:02:56 +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; Tue, 7 Feb 2023 06:02:43 -0800 Received: from nvidia.com (10.126.230.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; Tue, 7 Feb 2023 06:02:40 -0800 From: Viacheslav Ovsiienko To: CC: , , , , , Erez Shitrit Subject: [PATCH v2 4/9] net/mlx5/hws: free FT from RTC id before set the new value Date: Tue, 7 Feb 2023 16:02:01 +0200 Message-ID: <20230207140206.29139-4-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230207140206.29139-1-viacheslavo@nvidia.com> References: <20230206095229.23027-1-viacheslavo@nvidia.com> <20230207140206.29139-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.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: CO1NAM11FT045:EE_|MW4PR12MB6779:EE_ X-MS-Office365-Filtering-Correlation-Id: 3098c1b3-75fe-456f-d8ec-08db091403b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: evHZv1S1ZB2zTYtWFXWbY5w6qncVsLHF+yh5/Sr3ubFegRLecLQVgG8iBYuOCnOexwVJUZYe64VsBJKqTJwrciFuOu4UhiTWqJe8nayjndA9YyyefWOiWFxmfjQ27U/TUuUzKId31pjPkuvpKVg8JMEi+kLZhtIfSgPBYydeT0lYXry7Wmb7VfssepIty7HP4rTSTZYnCmxOzgS493bU8raoloo39+CCv03TZdKUKqDyB06xNLJxegDVi0Ds6UUg0nZ6n/pIgfMhOavORDRra621YVTwAUn7bVwDde64pFp2dh14ECYngDg4trxsH0i4tgx5decAS8euhUIwQ126zSwmEfBd92ZtbdmBLj3k/LUObX4zTNnPZUl1FJe7E6M1XgxSv/l/ZViIwbFLu50A4k6TRp+Vt9VKlX121RETuHBJ+m7uOYA1vidECB8M98ruLMWZPWjAwO42g5M/jCdMOyVx6upS3nxWUANq0TehNMjjPl+gAV7Ql2CXi46hZv0+WUrBIh3LHQebv8d2R4LQklIJyh/zfwagadN+rYGtakPazb7XkuBFiQSQDc+biqdEsCWe47Js3GFz3AjrhFcwHYJ30ss2iLIcj2BPFgAr1nQNC4TKxbtKhVE3RbyV5cZdUPyb/oIaFbu18gHEeSxhBH4gYRDQMAqk1QWz6HMJdl8xrGtlBY5VtuIL6azafQXN88rOOzu21E+TKHnbTkdyBA== 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)(376002)(396003)(346002)(39860400002)(136003)(451199018)(36840700001)(46966006)(40470700004)(26005)(5660300002)(6286002)(36756003)(7696005)(40460700003)(186003)(6666004)(336012)(107886003)(2906002)(2616005)(40480700001)(16526019)(426003)(83380400001)(86362001)(55016003)(47076005)(478600001)(1076003)(70586007)(70206006)(8936002)(36860700001)(6916009)(8676002)(41300700001)(82740400003)(82310400005)(4326008)(7636003)(54906003)(356005)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2023 14:02:56.7880 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3098c1b3-75fe-456f-d8ec-08db091403b0 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: CO1NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6779 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 d509a2f0e1..32bf3f5886 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