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 E0F7342CD7 for ; Fri, 16 Jun 2023 09:16:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCB9D410ED; Fri, 16 Jun 2023 09:16:30 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2100.outbound.protection.outlook.com [40.107.93.100]) by mails.dpdk.org (Postfix) with ESMTP id E55514003C; Fri, 16 Jun 2023 09:16:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nmptEpIOzsRew9U3ERvoPe68dV/X1XY8Ng9TAJx0NYadtZ+J3oYHlocyqn8UKLs2IpQ+sW0Y6m2JEFNeOVyON8w/oM5hse1XaGPM+Zh3tsohTKUkOB2URLm6HoZSu5q6TDj8+1u38XVazGbdIZpBBoCno6zPu71XB9KZrHXauu5lCQm2PMchHt8lW5+93zk9hKjS2uf7yZfjzg7xEJkyRVLEfnZegkhWo7xV+6wLof+EIVSj3oX3GszRIi12LaS8VP/HWwX5RAV6pLP7QOia2KMvX8gVCtqPzibVNwoKjp7F+/+Dy3yMTxqYn3TbvOm1B1Bdb25M9XL2s3+2Jx9BlA== 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=ALyvj5dne48pBam7noqtQvKZ9Md9FOpwDw6d3i/BswA=; b=cyFXu6B/c/L1v4RmsiyXWpQJ94FaBnIsuD9HDC02e1qAntRokHCEbKQCJRh/tjbGyAvBmOvoUumtV9RYbd1JYPfKm3VccK305umyoiWD7tntp/1tgbC/y1ve/U+nTz6/37bZIr8fgGTt6gpdZe/eNXfq15KAGTPzKZskK1UDK9QslAhymRitVe5HpieDlriduvzZwLMrqB2L8+YLKdgzZXPg8ciRMgarAex5N4pp1m2FYZJlfHKc69Fh5DffLF4e+1+8Tkm2uBnHFbindkwE6cM6xRfd2MeXezWlC6u5EbXNs5gawG2Jgi08eK+8uwZRLQhEhVAgvUVtFt+UjEqpVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ALyvj5dne48pBam7noqtQvKZ9Md9FOpwDw6d3i/BswA=; b=ZOFxWuXWDlw8toDmqh+gqfm5voAiCGArHKOrO3xwV7oQN8z96PhqBHtDWfW3UUH71wxDraBzsXICd+wNSCEjNAGD7d/9ogCZ2PUXo4zmIsofmui2S7f669VcDeiVom50s9+eNoEfuEbGOu/akC+A6XDBIyN396v3xDzlNn+anDQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by SA0PR13MB4014.namprd13.prod.outlook.com (2603:10b6:806:73::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.29; Fri, 16 Jun 2023 07:16:25 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::d2cb:a650:e1ce:2174]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::d2cb:a650:e1ce:2174%4]) with mapi id 15.20.6500.029; Fri, 16 Jun 2023 07:16:24 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Zerun Fu , stable@dpdk.org, Peng Zhang , Chaoyong He , Long Wu Subject: [PATCH] net/bonding: fix bond startup failure when NUMA is -1 Date: Fri, 16 Jun 2023 15:15:58 +0800 Message-Id: <20230616071558.1278520-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230616032013.1275530-1-chaoyong.he@corigine.com> References: <20230616032013.1275530-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0045.apcprd01.prod.exchangelabs.com (2603:1096:4:193::19) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SA0PR13MB4014:EE_ X-MS-Office365-Filtering-Correlation-Id: 82be9519-9828-4dd9-8591-08db6e3997a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t2+ztmLWPpXkbo0T2x0I+kv2UQ7+HSwr681FTxCv5j2bTTa+GI2TwH+/vGnnYmwi/569s3wSyCBOQUjj6KPNpZWoJEgwikxKJEIlDYA1BawHGfO83ZR8714E/KtsDtkFIBeMO3Av037t0BxMDWHtMS75gztJ6dAPHqnGbRHmRFbvtWWcMqOpmSZJB8KijLLwIGaE0k3EUxCGxDzNxG+ijJH7gI1oR2j7wDEQ0XlHpYPytccFG6vwW/3u3hE8ITXjGU6dgWUDSFov0chHqdISCJsWnokLmxm0hpiMud3iXXINLLboEFqJvpp4yAv1uzfDkliTz4fLn198VarilDRGWmTG6DVyxkniwkNva+ECneaGKAotSE+wm1sf7HlA3KZGZtQBBjGSVK0m+cmoUCNt12g2YmYUSZyVCb5vBZhv4EapTEtSSB6idrVJTYTIYWsmwQkPydw9bUYCv3HX2fUYI/68uVd5xmp4qgROpKrsluXVNrZEiJNEw8+kH+FVTByfkthRSZ92MKDZt3lt+W2MCNjoKvKUK3sgJApy+rfg/tPXmlqwavJI+wVZdkFhmTxoNrLqp4g3uqxsaF2RFk8qPLjrPOa7f1Y6bsrsVA5Sqdfm60dAZfu3LleP1/pTZZuxNNSrLJGEHD1hQFYmPNx0XTSJW/b8rc++4f9GYAJWZ4o= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(136003)(346002)(39830400003)(366004)(376002)(451199021)(26005)(1076003)(6506007)(6512007)(107886003)(186003)(52116002)(6486002)(8936002)(83380400001)(2616005)(41300700001)(2906002)(316002)(4326008)(44832011)(5660300002)(8676002)(478600001)(6666004)(450100002)(66476007)(66556008)(66946007)(54906003)(6916009)(86362001)(36756003)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?gIgi5GkzhNxdzJNMY/fyqm4fAQYlKlbP21lm8w/IaZ6dCX2aUq4l4dv6zDlO?= =?us-ascii?Q?ePMPll+h5o2dS8efVQHtDgvE4afsA89yzWzwgv+p7uf1QHullu3wAteJDGkq?= =?us-ascii?Q?n6lDV75ablMBGLg9Dy2WX2nsAxIvIE9iM2TusYUFSxuyXB6aVFIWWAIrKJM4?= =?us-ascii?Q?czcci4jpYJ6390Kr2EJcJi+nFZIrwOYaYX7rKHnx+VrYogH2rP+vmdSb0iO2?= =?us-ascii?Q?7IEtT0GQvgZ+8gF32S/HSm6iHsQnWcVPWrhQZSxL3pFGkPliugDk4EwkMrVY?= =?us-ascii?Q?ORTHDyxlaz+Ep8HDkfu6tCLqr++Qe7RPJvaIice6NRdW/DihK/68tClMtmh3?= =?us-ascii?Q?yCJBZDw7CGUoorxLpJ7XqMsMB8Opx7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2qxH0uqZxrGQQoQofbV6eBzw7HoMesPT9QbpnXjKuNxAN2OuOK?= =?us-ascii?Q?t23hrw6foGn+63x7eWcKto80dzAsnU0cn41wMKYSmtYLhe/XOabYmE8bA5nw?= =?us-ascii?Q?1Upjs19jxZw7kjmGPswQrVf9sINlRAIPDC95wjdjEl51hMq1BEA9Ej21hNR8?= =?us-ascii?Q?fF0Ylp5OfMIJidCyNcaBlJ/MN67MLoD4v2/cEa9bZOMdG1xggYBQVKrBK8We?= =?us-ascii?Q?pDWa9dePm5OerNhXU/gcHD9/9RyIl17AoqDCq2UMA2J6tX2mMVqZS9EA0o2X?= =?us-ascii?Q?4AZ1pDgDE8dluh6czAkRMTRM9HHpa/gx/FdVtoWcP7k4qQ13RGqTUErFdBPy?= =?us-ascii?Q?Hg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82be9519-9828-4dd9-8591-08db6e3997a9 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 07:16:24.3279 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U+rXmV/D+pzSJL3rkVlS79gABgvuHeA104+nH3W2HyMcdkD4mGOUkiEcer1jHXp/+FIYuslThvebk8f7x/r3YjEn59g9cNXz5OQKJD2+714= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB4014 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Zerun Fu After the mainline Linux kernel commit "fe205d984e7730f4d21f6f8ebc60f0698404ac31" (ACPI: Remove side effect of partly creating a node in acpi_map_pxm_to_online_node) by Jonathan Cameron. When the system does not support NUMA architecture, the "socket_id" is expected to be -1. The valid "socket_id" in BOND PMD is greater than or equal to zero. So it will cause an error when DPDK checks the validity of the "socket_id" when starting the bond. This commit can fix this bug. Fixes: f294e04851fd ("net/bonding: fix socket ID check") Cc: stable@dpdk.org Signed-off-by: Zerun Fu Reviewed-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Long Wu --- drivers/net/bonding/rte_eth_bond_args.c | 6 ++++++ drivers/net/bonding/rte_eth_bond_pmd.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index 6553166f5c..c137efd55f 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -212,6 +212,12 @@ bond_ethdev_parse_socket_id_kvarg(const char *key __rte_unused, if (*endptr != 0 || errno != 0) return -1; + /* SOCKET_ID_ANY also consider a valid socket id */ + if ((int8_t)socket_id == SOCKET_ID_ANY) { + *(int *)extra_args = SOCKET_ID_ANY; + return 0; + } + /* validate socket id value */ if (socket_id >= 0 && socket_id < RTE_MAX_NUMA_NODES) { *(int *)extra_args = (int)socket_id; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index f0c4f7d26b..73205f78f4 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -3604,7 +3604,7 @@ static int bond_alloc(struct rte_vdev_device *dev, uint8_t mode) { const char *name = rte_vdev_device_name(dev); - uint8_t socket_id = dev->device.numa_node; + int socket_id = dev->device.numa_node; struct bond_dev_private *internals = NULL; struct rte_eth_dev *eth_dev = NULL; uint32_t vlan_filter_bmp_size; @@ -3806,7 +3806,7 @@ bond_probe(struct rte_vdev_device *dev) port_id = bond_alloc(dev, bonding_mode); if (port_id < 0) { RTE_BOND_LOG(ERR, "Failed to create socket %s in mode %u on " - "socket %u.", name, bonding_mode, socket_id); + "socket %d.", name, bonding_mode, socket_id); goto parse_error; } internals = rte_eth_devices[port_id].data->dev_private; @@ -3831,7 +3831,7 @@ bond_probe(struct rte_vdev_device *dev) rte_eth_dev_probing_finish(&rte_eth_devices[port_id]); RTE_BOND_LOG(INFO, "Create bonded device %s on port %d in mode %u on " - "socket %u.", name, port_id, bonding_mode, socket_id); + "socket %d.", name, port_id, bonding_mode, socket_id); return 0; parse_error: -- 2.39.1