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 DA5D341BE9; Mon, 6 Feb 2023 10:53:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E6BCF42D1A; Mon, 6 Feb 2023 10:53:12 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 334A642BC9 for ; Mon, 6 Feb 2023 10:53:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SV234yI8W6XuhbJd0iSG5P8jQWkJEw0kUJX2Ovs1UR/tDGAzsFBmCna7sFFdZB2ZzlKrvZ5GnJrwYwZhs3H9/Fuhk1eQaXprLGS+TVMgV+KjcinXx2od9JirPdm43tevEN4MIhZk2fybW4Okt2BW0b2CYNjTY/ETSu5yAi095nYOpu6I4vskz7yK3BprUpBr3+l+ZEAA0z5kezls8Yt+uz/C+eikREZmyESImxjtq6yy1rv/aLqi4AjqeBS2e1VLShxOY4S3LTCAyX7iJPDMj/rQmxaXhINKNJxmvuaSCrqk4nfGrOAx394QxqpRb8/G4r/KIlHkcVsvPHouvm5aAQ== 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=evUxlUrDnHpcBAp8zH3HKjfYFFgxjBFmS3Ww1LrSKxUwhzHc9aeoiojQSyGppIZ7blzvpvQLAY4ISsyiiPfyRqmn2iCfzSuiDTrqw5NLiIPA3enRsyb60jYOopsdYfArE30lAEjv7h5XWRVL1JdPSr1W8nbty/cepsS2hU4hlixOOvpZNqqxTn3yOVo6SyT7BNzE5an46tMk/PClsehFH2sAJKEhwjceSb8Z5J/QZFDdzfZe2W4+KG9VRPUQ6O4g+BbmGZC4v5GRzqd+N+CclkDb/mLqnUIj/am5h/GSo8hnJevcNKXlybTjLgqsgdCiFCdU71mP8f1NAHv7bto9dQ== 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=C+H8h1CjAcPvFFNG/Z4cB/3SnGivRxTenTm6YMUTEfdZYJela6jWoIADHAQMmZ5jS8op9I8NvqMFkPykPJNbQz8ZcMOnUyFDodW4TjzkRtbwxPhbhQgDSD+NxY4gyBD4FY01R7WI/1qK+36mZ8Rpmdr4qjDaYqR9sZAsQBzdPYhZavzq4XFxqeHk7MJV8zKdkz7dvzMpjH8l/ibarueEddgPaCXpNlMGb4lZGoX4ApkFLyE2F69SB5bVTalHZqABkFMmNxqImJy/JBcdN6uAeKmMopgO22sZHH3cKJ0W1NY47xfYw2rbEhffRYfxviGakhRjv58+a4oJo+7C7ZpL2w== Received: from MW4PR04CA0313.namprd04.prod.outlook.com (2603:10b6:303:82::18) by SA1PR12MB5671.namprd12.prod.outlook.com (2603:10b6:806:23b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 09:53:09 +0000 Received: from CO1NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:303:82:cafe::38) by MW4PR04CA0313.outlook.office365.com (2603:10b6:303:82::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34 via Frontend Transport; Mon, 6 Feb 2023 09:53:09 +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 CO1NAM11FT024.mail.protection.outlook.com (10.13.174.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34 via Frontend Transport; Mon, 6 Feb 2023 09:53:09 +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, 6 Feb 2023 01:52:56 -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; Mon, 6 Feb 2023 01:52:54 -0800 From: Viacheslav Ovsiienko To: CC: , , , , , Erez Shitrit Subject: [PATCH 2/9] net/mlx5/hws: Matcher, Free FT from RTC id before set the new value Date: Mon, 6 Feb 2023 11:52:22 +0200 Message-ID: <20230206095229.23027-2-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230206095229.23027-1-viacheslavo@nvidia.com> References: <20221228165433.18185-1-viacheslavo@nvidia.com> <20230206095229.23027-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: CO1NAM11FT024:EE_|SA1PR12MB5671:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d84a686-5ac0-4948-f0f2-08db0827f426 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sEXXeSNdxWOZ/emjG6tghQuPNEsbnEj88M4VQv0mGh+vc/U2JHw6aGfaZASkjhGaAsYo+qWyb3W0WyCh/h0x1OpsmRLRltn5SiI+mc2qMQeYmVtDUJT8ZH6mofRH/qob/v3QqXcglerdMxxnkTbMpkyvF/p02cB8odZ2XEsFevJ//nMuIfWx3fVPH1Lq3j2FhC29QOyCGSpx6dWBaDB11rhb6ElkV2k9WwijsrFDZ3zV1mpADGUmjYPEhYC+aXzXTTD6YbfxSkEOyYnVEh4itN7NQt4XVKP+10p+5wL/cJxUtaeYdsQWM9tGlN2ZsXbsHW0ZInooB8eUPe+d22+LgIvptXQsnK+X4Mz0TVwFNGzon0BUYpCAw8UPC8BFg4cL5ut7SqT2+xzqPql3GUY0w5FTOI2ysHE0+X/tBTeUNL7mGo5IR5inkVOmN9rBcKXENZ59WTFHrHR4J2mVn8ZsaNXBlZ7fIuy0i75ww1ZWp5fr249WL+5fbZVhBzCnLTMqOsAWgjrsIZTRyvckp0p7rzRAOt/T1b1+9O+B3FvG7ByNQ9F+L3aW7RNkYmXydVba96Q9Ku8HVNf4oUVEEtv1e3r3HwOQw0Sn3D/adBMm1k07rKDHthD6KvygfTmAUPWG8U3WyliIQl3+LHfmUUOt+dV2BbVGTSAGeD7RyOpZuMhmH9P2a0jnuXmHzIk1y4da/W7S7RnutOrECUcEMXeZ7w== 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)(82310400005)(40460700003)(6916009)(1076003)(55016003)(6666004)(40480700001)(107886003)(2616005)(478600001)(16526019)(8676002)(186003)(26005)(6286002)(4326008)(70586007)(70206006)(316002)(7696005)(54906003)(86362001)(36756003)(82740400003)(7636003)(356005)(47076005)(426003)(83380400001)(36860700001)(336012)(5660300002)(41300700001)(8936002)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 09:53:09.4902 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d84a686-5ac0-4948-f0f2-08db0827f426 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: CO1NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5671 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