From: Chas Williams <3chas3@gmail.com>
To: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix socket id check
Date: Tue, 16 Jun 2020 06:09:59 -0400 [thread overview]
Message-ID: <dc841d70-10ad-c0f7-e279-8860610716c6@gmail.com> (raw)
In-Reply-To: <20200616094637.31620-1-david.marchand@redhat.com>
Acked-by: Chas Williams <chas3@att.com>
On 6/16/20 5:46 AM, David Marchand wrote:
> Caught by code review, rte_eth_dev_socket_id() returns -1 on error.
> The code should behave the same, but still, do not use LCORE_ID_ANY for
> something that is not a lcore id.
>
> Fixes: c15c5897340d ("net/bonding: avoid allocating mempool on unknown socket")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
> index b77a37ddb3..b7ffa2f2cf 100644
> --- a/drivers/net/bonding/rte_eth_bond_8023ad.c
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
> @@ -1043,7 +1043,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
> RTE_ASSERT(port->tx_ring == NULL);
>
> socket_id = rte_eth_dev_socket_id(slave_id);
> - if (socket_id == (int)LCORE_ID_ANY)
> + if (socket_id == -1)
Testing against < 0 would probably be more future proof. But if someone
decides to update rte_eth_dev_socket_id they will hopefully update
callers as well.
> socket_id = rte_socket_id();
>
> element_size = sizeof(struct slow_protocol_frame) +
>
next prev parent reply other threads:[~2020-06-16 10:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 9:46 David Marchand
2020-06-16 10:09 ` Chas Williams [this message]
2020-07-09 10:36 ` Ferruh Yigit
2021-04-22 7:12 Min Hu (Connor)
2021-04-26 14:54 ` Ferruh Yigit
2021-04-27 2:44 ` Chengchang Tang
2021-04-27 10:45 ` Ferruh Yigit
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=dc841d70-10ad-c0f7-e279-8860610716c6@gmail.com \
--to=3chas3@gmail.com \
--cc=dev@dpdk.org \
/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).