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 2C7BD42CDA; Fri, 16 Jun 2023 14:00:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7D8C40DDB; Fri, 16 Jun 2023 14:00:46 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 441BA40A7A; Fri, 16 Jun 2023 14:00:45 +0200 (CEST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QjHjV2kpYzqTFg; Fri, 16 Jun 2023 19:58:06 +0800 (CST) Received: from [10.78.231.32] (10.78.231.32) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 16 Jun 2023 20:00:37 +0800 Message-ID: Date: Fri, 16 Jun 2023 20:00:37 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH v3] net/bonding: fix bond startup failure when NUMA is -1 To: Chaoyong He , CC: , , Zerun Fu , , Peng Zhang , Long Wu References: <20230616071558.1278520-1-chaoyong.he@corigine.com> <20230616072034.1278546-1-chaoyong.he@corigine.com> From: "humin (Q)" In-Reply-To: <20230616072034.1278546-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.78.231.32] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected 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 Hi, 在 2023/6/16 15:20, Chaoyong He 写道: > 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 No need add your colleagues unless they "reviwed-by" through email-list. > --- > 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: