DPDK patches and discussions
 help / color / mirror / Atom feed
From: "humin (Q)" <humin29@huawei.com>
To: Chaoyong He <chaoyong.he@corigine.com>, <dev@dpdk.org>
Cc: <oss-drivers@corigine.com>, <niklas.soderlund@corigine.com>,
	Zerun Fu <zerun.fu@corigine.com>, <stable@dpdk.org>,
	Peng Zhang <peng.zhang@corigine.com>,
	Long Wu <long.wu@corigine.com>
Subject: Re: [PATCH v3] net/bonding: fix bond startup failure when NUMA is -1
Date: Fri, 16 Jun 2023 20:00:37 +0800	[thread overview]
Message-ID: <da8b5b45-5562-a904-b521-0695b83c2a05@huawei.com> (raw)
In-Reply-To: <20230616072034.1278546-1-chaoyong.he@corigine.com>

Hi,

在 2023/6/16 15:20, Chaoyong He 写道:
> From: Zerun Fu <zerun.fu@corigine.com>
>
> 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 <zerun.fu@corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Long Wu <long.wu@corigine.com>

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:

  reply	other threads:[~2023-06-16 12:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16  3:20 [PATCH] " Chaoyong He
2023-06-16  3:54 ` humin (Q)
2023-06-16  6:08   ` Chaoyong He
2023-06-16 11:57     ` humin (Q)
2023-06-16  7:15 ` Chaoyong He
2023-06-16  7:20   ` [PATCH v3] " Chaoyong He
2023-06-16 12:00     ` humin (Q) [this message]
2023-06-19  8:57       ` Ferruh Yigit
2023-06-20  2:53         ` humin (Q)
2023-06-20 10:18           ` Ferruh Yigit
2023-06-20 11:03         ` Niklas Söderlund
2023-06-20 13:15           ` humin (Q)
2023-06-20 14:10             ` Ferruh Yigit
2023-06-20 14:19               ` Thomas Monjalon
2023-06-21  4:00               ` humin (Q)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=da8b5b45-5562-a904-b521-0695b83c2a05@huawei.com \
    --to=humin29@huawei.com \
    --cc=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=niklas.soderlund@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    --cc=stable@dpdk.org \
    --cc=zerun.fu@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).