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 F19AB43FB4; Mon, 6 May 2024 13:46:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54A8A40697; Mon, 6 May 2024 13:45:48 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2076.outbound.protection.outlook.com [40.107.244.76]) by mails.dpdk.org (Postfix) with ESMTP id BE49140DCB; Mon, 6 May 2024 13:45:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JUgOohSteX2Cybn3x03+iFTujcUyy6IhB6X4OqvnScBINRtP+/vOmKuPTuMcLS9indPdXCRRwVWC/FZ/+YwborMCdnFXkWt3vzKIT2+b4BnD0kU1OETJ3FYjIqnmYGhLk1Oq/tvWIWFUuz3qhxcmIcmE7ClM2HcJjw2oRoYT1FhikoGtxLJXxxDMX0kKhb6dXeQgtKibr1MKyK6RROGfVpd8f2eHm51MXQGofscmvq8VkNX9SXjav3vbtmuhOlZ8K3FuhMUstbRe5rTB2hXUlqGMsYqim0euIKN7ThJjghfb3wyLhsbv39jdATbZFpaCM+rjAa6OJPysEaXzCoRepA== 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=XH1LCzMBj7ft6IYZqbnc03R0doZRxIOG7QGmpD0wqYw=; b=XgrIA20rLkMvrR4opUZ7e5CoQha2oU+zInOfH0UL8lzI5PpFsRWWmiL0GuqTKxXpeeyiahe7saE3A6EMqd09Yd1wRqatXQmELGtOqmd9bj2H2lfMCjGxdO0bPYDdhAqgp4LOL91RC286Beeq7+2Gt22TIwArcF828i9s5c2f8V4wxdVH2md2edSxGjXGk1z9sR1DFuuT2XXZqOQUNBkKglMVxSU5tIlzpi4nm8/LX9KnaK1dm1G5Z/7pIbRfJUkLmbhd6UkVHv8nGOjv9qjtWTOfxceXLxwoETVVXpIXZBwHqsrxyDXhdpB4rKqN5A9MtxYa6PS9crDeKm1UR5yDZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=monjalon.net 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 (0) 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=XH1LCzMBj7ft6IYZqbnc03R0doZRxIOG7QGmpD0wqYw=; b=tRVZmbuKaaggQQrEmBRBU/Dq98XKuEiJ1epSnnuc33HYivZ+Hdri+XVd5H3AX1ZoNHNBZrNBx9r4ksbOaH5pt4cWVK1mffiC32WKYPNyQrwBxdEOrRJEsB/JRMo+LpA5SopGzXaL+bY0EKkRrPHd3f2uCpwDAPz6dTM3GJGPxDnPPdpUDUa2mimmyZFTUnJDHV1a38dy5MnuGebWd0admBavC1ZyCLHtqrCyQpJnAOrOtxA786LFt73l1LhmhNqlpeq90DdRKq661VUrpvSEkMqbKfsxjcXxDTrqHet0vIy9CofV4rbPrOOikNUWGfQJvSMclmozuRDsdQPTJYpFtQ== Received: from DM6PR10CA0009.namprd10.prod.outlook.com (2603:10b6:5:60::22) by LV3PR12MB9332.namprd12.prod.outlook.com (2603:10b6:408:20f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42; Mon, 6 May 2024 11:45:20 +0000 Received: from CY4PEPF0000E9D8.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::a2) by DM6PR10CA0009.outlook.office365.com (2603:10b6:5:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42 via Frontend Transport; Mon, 6 May 2024 11:45:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CY4PEPF0000E9D8.mail.protection.outlook.com (10.167.241.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.18 via Frontend Transport; Mon, 6 May 2024 11:45:20 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 6 May 2024 04:45:12 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 6 May 2024 04:45:12 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Mon, 6 May 2024 04:45:09 -0700 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad CC: , Subject: [v2 13/16] net/mlx5/hws: set default miss when replacing table Date: Mon, 6 May 2024 14:44:16 +0300 Message-ID: <20240506114419.966498-13-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240506114419.966498-1-igozlan@nvidia.com> References: <20240314114220.203241-1-igozlan@nvidia.com> <20240506114419.966498-1-igozlan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D8:EE_|LV3PR12MB9332:EE_ X-MS-Office365-Filtering-Correlation-Id: 08d59600-9160-4029-b201-08dc6dc201f7 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|376005|36860700004|82310400017|921011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?y0i+w1Cd8IPq26rSZMQs8ifcVEjThh8HYl0QzWXmGHKXiSUF6HdoL3LACT1J?= =?us-ascii?Q?tRZcdKZ8IkSmtpQa+qrckQgesJmUAsUiygMKcvMWhWTLkJfiN0phrdAYrr7I?= =?us-ascii?Q?2zJE/GRQ5CIkcMsgRNoRG9cza1vKwMhvqmlVBjZECLJ9uMgKzapr8xOXRvYb?= =?us-ascii?Q?qDs+d0XDEkZ+0s4P9ZXQp5E/KLf20uPum6YtqC5Q2D19GuoW8A2axJMOFcNl?= =?us-ascii?Q?EUZFqzsYYlu42TLp75BegX2n4mdZneFYevD0lPV+gAE3wvQqxVJoHZwQn3zY?= =?us-ascii?Q?82az51J8ccdUGia7RgE4YUUHLq6swA+Ga83t9uwEHxixOdRv+BplvraPffju?= =?us-ascii?Q?H8xUHxk9D5Kq6CmW223M5tDtUiumrAeEfbVV/58hpVnRg7OVjZso7AcA253r?= =?us-ascii?Q?b+kT6zk80fgGbAhG8yw/Fb4sAFZF+7M37WAtAHcxVX4oB0xiIf3FezkLsQHw?= =?us-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1Vp6oB0PNW5mX8wsyH?= =?us-ascii?Q?sbvMZEz0jUdWAVabJtxLXG7ToPIK?= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230031)(1800799015)(376005)(36860700004)(82310400017)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 11:45:20.2767 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08d59600-9160-4029-b201-08dc6dc201f7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9332 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 Allowing the replacement of a miss table without enforcing a previous disconnecting. This feature extension allows the user to change the destination miss table when the system runs without losing traffic. Fixes: b81f95ca770d ("net/mlx5/hws: support default miss table") Cc: stable@dpdk.org Signed-off-by: Itamar Gozlan Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_table.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_table.c b/drivers/net/mlx5/hws/mlx5dr_table.c index 55b9b20150..ab73017ade 100644 --- a/drivers/net/mlx5/hws/mlx5dr_table.c +++ b/drivers/net/mlx5/hws/mlx5dr_table.c @@ -611,8 +611,7 @@ static int mlx5dr_table_set_default_miss_not_valid(struct mlx5dr_table *tbl, if (mlx5dr_table_is_root(tbl) || (miss_tbl && mlx5dr_table_is_root(miss_tbl)) || - (miss_tbl && miss_tbl->type != tbl->type) || - (miss_tbl && tbl->default_miss.miss_tbl)) { + (miss_tbl && miss_tbl->type != tbl->type)) { DR_LOG(ERR, "Invalid arguments"); rte_errno = EINVAL; return -rte_errno; @@ -625,6 +624,7 @@ int mlx5dr_table_set_default_miss(struct mlx5dr_table *tbl, struct mlx5dr_table *miss_tbl) { struct mlx5dr_context *ctx = tbl->ctx; + struct mlx5dr_table *old_miss_tbl; int ret; ret = mlx5dr_table_set_default_miss_not_valid(tbl, miss_tbl); @@ -632,15 +632,16 @@ int mlx5dr_table_set_default_miss(struct mlx5dr_table *tbl, return ret; pthread_spin_lock(&ctx->ctrl_lock); - + old_miss_tbl = tbl->default_miss.miss_tbl; ret = mlx5dr_table_connect_to_miss_table(tbl, miss_tbl); if (ret) goto out; + if (old_miss_tbl) + LIST_REMOVE(tbl, default_miss.next); + if (miss_tbl) LIST_INSERT_HEAD(&miss_tbl->default_miss.head, tbl, default_miss.next); - else - LIST_REMOVE(tbl, default_miss.next); pthread_spin_unlock(&ctx->ctrl_lock); return 0; -- 2.39.3