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 D218C42CD3; Fri, 16 Jun 2023 05:20:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2AB240DDB; Fri, 16 Jun 2023 05:20:44 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2114.outbound.protection.outlook.com [40.107.93.114]) by mails.dpdk.org (Postfix) with ESMTP id 8AF5B4021E; Fri, 16 Jun 2023 05:20:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H+I0+dQojf1b1mcsp5HI3YN7DFM3KvlpZDomlu3EMUPW1CKHCzpY4N7CEtY3+znQ5jhu7sj24mZ37r7gJirmhwIZt/vWgSsLlorUUArXZQ45pwDkQxHvd6lbCsGO/3k4UHRgYH9nIMFwI+ZF04f3e88WyP/EF2dA3ovBLmWx8SF9Wb51KHMNzpZtq+ioKV68MfIhtPV+Gd+lNZSZSR9MAoiTmbASniAaaOMNjxpabuDNuo44dDYhP0s/amTCg5+qLOgWgEo8+0LoOaNH50/TCifcuUmHgUl0ywUyZ6tJeJSxj+rPPexpEfGe7eqDFK7tLN4a5McApl6QdKxRWZDoSw== 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=wAAMMg1Qtysvd63xZ+djkAlHla9nbhZSHL0nzk1zRJY=; b=nmtsTepV5F4dTaIcW2jl6ZMZV1vyDP/FKEoZIbsz+LerMNXD7p1NYmLIglFrizIS2J3DID6VgaXBnDB0aOyYEZnumlbXP/mnHiSnqhqUYtutuG2SyqnNIcdEBzeISqptSmE+JD0h4vIZ38eJ9Gv7hUJ7jvjVzw/glRpb7msGf7p3V7fmIMpwEnXR/RY+K4tVSyGnNxEIEKdU8+YvMWtQCEm7P0E4CzMJXGz390QtI4JqgIRcpwO3hU6OrLV8UD+lnfpOKegR58pK7TTRA7M+v7puCSNE6lMFm5iEUg+U4bIy4KJIDaqnptD1xdnNHMO8RrrUPM/n9IqNusqRU0lYVg== 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=wAAMMg1Qtysvd63xZ+djkAlHla9nbhZSHL0nzk1zRJY=; b=OUhcDYB7MvwEeJmM9tku1lJKQKR7WgE7sCEnjDS+ndCTG/2Lw8zqGIjIoUjh0HMYmqfdxjVRE4aAF3CpxDyisQRp33PZnaDsZIlTEiCxkOzsq1mJDA6X87FGxNS+3O6eidafD10pHmdpB2RI5MBMgKh+z6k4ubNyVW0v5PhJAx8= 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 PH0PR13MB4908.namprd13.prod.outlook.com (2603:10b6:510:7b::9) 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 03:20:38 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::d2cb:a650:e1ce:2174]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::d2cb:a650:e1ce:2174%3]) with mapi id 15.20.6455.045; Fri, 16 Jun 2023 03:20:37 +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 11:20:13 +0800 Message-Id: <20230616032013.1275530-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0233.apcprd06.prod.outlook.com (2603:1096:4:ac::17) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH0PR13MB4908:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a1254f6-5236-4883-ad19-08db6e18a7c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Dmbqz/3TnRUza9vElcjrWvlXwnwsNdrQLzGq/cZmG29Hkl4amOO+rZ5UgZBe5vIy5jsc68qTb1ueFlWeomCciG1WT7VFuv/nnWJyoqDOdg2AdPdYMjmvbIRB6vxvcelAIN7hiAopnThS3v/SKTKqGcOHg37jt/W96OIQxBiuyTvDCikPoiSrOXLsM3bIDShKtI83QwGsVyzKD7DDS2FK3y3lsRBRNKJQF1+l9IHEpRxo2QtrWuZSMsrmzDPmmoQEDQa9PXpEA5RklJhq5hOG8GvDTQOyL3pPI9XUS6RqcGB/w7bFQNMmcQpA1GNFN87ifDgGRU9FV8GSjxj2KSD0fR2Lda7LYd18sVKn5bi1hXicoayBXrbinlggZyQQlPdZDyGw686f5YWJd0NQYf7080Sm1pVmy+UsslCqcA1QdIjOMbM1/tkQ/lOP5A5eXNkEcGPSwPSu71U7goDSGAMhCW8pM5aOGnWh4ujUxosqZkBbKllSM4/EaqBzV4hOxRXxB+EPPAEWv6XvH1kCt9lrCTgomIym/C5KAiq7wMeNwe1YCDMsnoW1+r/SEOJSe0V99EnoH4gS974kKKRi0SYS4xiJ2hD2Kn+MRvj/vQS2tOk5ug9Zr2SSTFO9WQMM05z5Z5KJV2Fc6LVdwG1Jf+MtdMQZNBrFjIwYu9WGTVHKWw0= 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)(39840400004)(396003)(136003)(346002)(376002)(366004)(451199021)(478600001)(107886003)(44832011)(86362001)(52116002)(6486002)(6666004)(316002)(41300700001)(38100700002)(38350700002)(450100002)(83380400001)(66556008)(66946007)(66476007)(4326008)(6916009)(5660300002)(8676002)(8936002)(2906002)(186003)(54906003)(6512007)(6506007)(1076003)(26005)(2616005)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?D9M06OrJl4/hPLz7JbzA7G0sk3I9ZsCOwZb7cluAWqsh4NR14Y1tScqg++HC?= =?us-ascii?Q?44VRZpUDlpEvI330f7nrUkP7SF/0WXTJYSzVjcU6SiqwriOpB1KryUmwXm30?= =?us-ascii?Q?xKy2WK6jZy71S6JgZ03T+mVxPG7g6vMLq0nLQI9oOJmDobrd95YOH0BLPLeB?= =?us-ascii?Q?k+RAJ+TXAmf7N5cXrGKFspIKjpLMxX/Zd58+hKXfmo6O0jWPbrw310Uq1LKZ?= =?us-ascii?Q?p/zxqI9MUHN2cIxTO6qzNVlab8nGsxqg0pRTlU2ML0uEP/AiIxNOD/JVugQq?= =?us-ascii?Q?qTFAUu6SKxqDgoCtQbokRLJPFvvVjJvb7gY2JD0qZm5tqXKi9XcxjHbO6rt/?= =?us-ascii?Q?j90G/gD4snCimYd/CnMFKQE66YK2Eg/o3r5jVvtLzNv2rrjruUfyZrJuTrsB?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C93oeqWdeZ+Uwc6P7mwJoOwXS01Hih/lqByXfOy2iDgW3?= =?us-ascii?Q?OA5NYxPwg87zwh3vhVD6EliwBczwLUV1l8TyHOh7HDydWc6tBn0i+JPX/k6Q?= =?us-ascii?Q?r7otWZF4KzNho/pOIwFk5HzslI3R2fm2v2j4HyVsW+cqCf4FjPKq0nJwuTWn?= =?us-ascii?Q?LpKtE2XXfUAu6jU8DN4q6O32jpHEUle5H3PhUczSSNEjByZpN2CPQ9wYuAUk?= =?us-ascii?Q?VgfqE6xbg+F39Zy6z0JzFiPoVSl5qvh5lcyxFEeQQa08Hf2H49/QjzJNv/JI?= =?us-ascii?Q?eiNxce6dSRGzYtCoAvOupN+nEp4Vcy+LQ2IBxoWIAhokrpa606+yrOX4TWMn?= =?us-ascii?Q?eg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a1254f6-5236-4883-ad19-08db6e18a7c2 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 03:20:37.8287 (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: yll4qPflA1Fl3Q3Hp3JREyIWwaXDspqjVX4hTbBtaQFDekbCPQ++MyFZu+Yh33u6xOvDjwtgwiAxvIs8IjZ9q3TwxOF4lp+Wr6RoLTZfaT0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB4908 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 --- drivers/net/bonding/rte_eth_bond_args.c | 6 ++++++ drivers/net/bonding/rte_eth_bond_pmd.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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..390a5b4271 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; -- 2.39.1