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 065D642CD6; Fri, 16 Jun 2023 09:21:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBB2A410ED; Fri, 16 Jun 2023 09:21:03 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2092.outbound.protection.outlook.com [40.107.94.92]) by mails.dpdk.org (Postfix) with ESMTP id 996A24003C; Fri, 16 Jun 2023 09:21:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lQPyyjw9/D+I1LL2dxGzeyHptQD5ulLGy1Il0eLS4wR6e/0iCyN36RuHbs1ROwMh3Cck5TRixotrnpPu4RH5uglObrRJOoP/7K3HHvunOs5bc+AOmBn/+v0kykZJw/uSQcgzRunQ4g3HIIMSz7SshugRVjumEoNVh7a6vjbcEHs0vp3VPfJ6UsxbtQizoy+2vEaVJE6Mr9wPhBMbtzG5+WXcezqtMNd2rLEPZnTNRJcswY/+2cLzY/UCIIMbM7YLFnD6qVp81Hp0bZKE1zvI14UR+LqVmlB9s0xCLyXZGcGJiGPS/KA4aVb7qjDN4PVBoB3NaKCjmFcNpV/lw9DFyA== 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=hwHmxuycAe2pkZCydQXGYJUsnfblAyAluWpP+SXuWek=; b=bVBkBexvA15oeQttxdUMzBfKAHFVmhrONcYGPxwkkJRLggWiom8FikHSWYNSOdD2lfeyx+v+6zLN+qBug3ysLvR9aBXppr1oAsNwZn+dAddT8EtaCqfeRyktXcl17VkXJaMzZTUxD/ycNTjfCU09eqeXoTtKlPWP/R0TCBfS9lMv068k/C0e195WgPB5j/hxzJAXIkSi0epCdezjIRCqp5lDGcJhVSGmHkjQb3g3GLbghmyx28lJDNdBqW+Bv2wUS4HxAWch2tO8sTQ8U9HBmPrJ9zRjrbHuY4KAUoESZwOTTtMM/0orV8H0y1yLgbYUylqkTldoELD2anPB+2qjEQ== 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=hwHmxuycAe2pkZCydQXGYJUsnfblAyAluWpP+SXuWek=; b=aDzaf2ZRKoCwgS+QXCWaIrjJCSeHTFNeZkK62fbL7g7bFeO/hpL55iaLG45a01G8Y0XP7l0pPcq8pdD/tsozN5/2Texw466Uwh1K8fXh94ySBvMEAsUBqb0sI21qopltELTyp8BdB5G5/eIh+hXrUurROdXy+npucPxL2rOYqJg= 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 PH0PR13MB5998.namprd13.prod.outlook.com (2603:10b6:510:16d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Fri, 16 Jun 2023 07:20:58 +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:20:58 +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 v3] net/bonding: fix bond startup failure when NUMA is -1 Date: Fri, 16 Jun 2023 15:20:34 +0800 Message-Id: <20230616072034.1278546-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230616071558.1278520-1-chaoyong.he@corigine.com> References: <20230616071558.1278520-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0036.apcprd02.prod.outlook.com (2603:1096:4:1f6::20) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH0PR13MB5998:EE_ X-MS-Office365-Filtering-Correlation-Id: 276c6e2c-42dd-4d62-968f-08db6e3a3b26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RNOfYbZ7k4ijdTfAZH4pUCkX6pEQUj/P1rmRJ/W2yU2VQ4AxUhpRWoPfskhg1r5PGqlQwA+AA4iQQ6O7v8P9COiGObRTY/97hsil7msYXMmxZdvLoYyFqJK3IpbhH+0Opd8eiQtW5cM3+3VV+6ucfh+dKJPB6VJZMjTjnEZErNEr70CxE/zBQnMFTX3IoeoqNgkQT5FlCjcmb7rv39MX8CsOkF43l8LgRsSfp5NMSqImhPlD7JCdf+nOFk8+rb+Tr1L/kp6uVQtynFuD4Hw195WX5n3IBW03M9e0D9FTaJNAQuZ207BU3tzms2jqCnZrFwMGXpEZETRzzdDqi0FTtdQjT8krYUdFLvLnrzQsplvz3C52qEvqhHGXh1h92NlMC5n+aaR5ErIPqhBFY5UZ/UvZjpozFOBGhjiWjB6QphxX7vR5GMOJPWRfT8ylRnmxlR2vZCo0efBDqucfOo7nTRIGUsEKQJltsLMQlrfjO1nH9ZZjoeZmR/kR93s3HrgtmnabIe3rEgJuCep81+eBlJtDPPYvAksDY2mJkPjvsfriAZwQ5C7EpG2NpZWjbBsdcxzVqesFzJPcNX3l2oVDM/BXTjefxrNmo4B/QwXBcG3ua5uQxRu4Q/FnfpPyD016kxN8rZqDih63ouY6C5KRIRAUBX3aBmK8RZN/2LYzhgA= 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)(376002)(346002)(39830400003)(366004)(451199021)(41300700001)(8936002)(8676002)(478600001)(38100700002)(38350700002)(2616005)(83380400001)(107886003)(26005)(6512007)(6506007)(6666004)(186003)(52116002)(6486002)(54906003)(86362001)(1076003)(36756003)(316002)(450100002)(66556008)(66946007)(4326008)(66476007)(6916009)(44832011)(2906002)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?XvC0mI56HWo6Y2nF9Ecc5D/JMCwNdOvRE/4ICPom8qmxHRzfvK7Rtj17ulau?= =?us-ascii?Q?FhhR88sHPNFUqyG4QhDDRbAB+yiqAiLvb8+nxixzph+lADOyT6bK8kKcRpQL?= =?us-ascii?Q?hJ6PywOvdGjpCT8hSusuxN/QJDpA9cGPUpLQvpT3A/jpcTHhdb5qfYw4nvTP?= =?us-ascii?Q?m2zofp+og0yEoLFsWF4avSFaoFOSTQlZ5H33mKKt5hulvT8+KCCxJ0s1vf7i?= =?us-ascii?Q?8+OZasOFGJ9G7VyWFyGsKRAw/X+EDhLP/7aKdr6VtbFEsVYYUgxvhjleL57z?= =?us-ascii?Q?xBvrQ//BMNFRbq245I0mgXd/j7gkJtMwsHIMx4TnjEY0XtC7UmYFPgZLwQoK?= =?us-ascii?Q?fU91fmq0EMohNoYl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GaV?= =?us-ascii?Q?acRMgAtGvs+m+0HpmtCItTWVb1KERJ5OwqxdcPefnKjEcqHDx35A1/9wV1N+?= =?us-ascii?Q?870eO4drIGmzB3JfFWZBtnd/cuyGkPDqi1bMEaW8P9s5AssHWXKxxSHKLyP/?= =?us-ascii?Q?/NhHcMOvzA1lDwAqQJyWTH2+GsvIK1eBz0j2WNCyBOm03YXizPre2Ys54V3L?= =?us-ascii?Q?zhsqV2H05/KbK5IXZx5ToSgWLZmmxvzLJBJLWkKvuPNbi+/QUCyJpKUTEmdE?= =?us-ascii?Q?oKevfb4Meya2cbyU2XJN6PR+NadAL3OyiEp2pakGb1VrJnPg1oOW4f2Ivqqp?= =?us-ascii?Q?c1v5Akv22GBUOCJxoui2UoTFDHUbmN3z7UXpDpIsu+S4jxtlmLFFV3Xdn60w?= =?us-ascii?Q?pw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 276c6e2c-42dd-4d62-968f-08db6e3a3b26 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:20:58.5121 (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: AXDKyzmAmQ02BqTxjkc6fqQ1r80rTgcVthLPPXfCHnfX35ntf+UJ4XcMYw1fdwkOBDKC848/r7VJn08/iLB4HrOMGeRd8oi02QVwT92bK68= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5998 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: 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 --- v2: * Fix the print format string. v3: * Add the version number of patch. --- 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