From: Thomas Monjalon <thomas@monjalon.net>
To: Pavan Nikhilesh <pbhagavatula@marvell.com>
Cc: anatoly.burakov@intel.com, erik.g.carrillo@intel.com,
mb@smartsharesystems.com, jerinj@marvell.com,
Tyler Retzlaff <roretzla@linux.microsoft.com>,
dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH] eal: fix return value of lcore role
Date: Sun, 08 Jun 2025 21:57:19 +0200 [thread overview]
Message-ID: <3958894.6tgchFWduM@thomas> (raw)
In-Reply-To: <20250520201726.7420-1-pbhagavatula@marvell.com>
20/05/2025 22:17, pbhagavatula@marvell.com:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Update rte_lcore_has_role() to return false instead of a
> negative value for invalid lcore IDs, removing the need
> for callers to pre-validate the ID.
>
> Fixes: b0a1502a277c ("eal: make semantics of lcore role function more intuitive")
> Cc: stable@dpdk.org
The API comment says:
* @return
* Boolean value: positive if test is true; otherwise returns 0.
So yes we can consider this as a fix.
> --- a/lib/eal/common/eal_common_lcore.c
> +++ b/lib/eal/common/eal_common_lcore.c
> @@ -87,7 +87,7 @@ rte_lcore_has_role(unsigned int lcore_id, enum rte_lcore_role_t role)
> struct rte_config *cfg = rte_eal_get_configuration();
>
> if (lcore_id >= RTE_MAX_LCORE)
> - return -EINVAL;
> + return 0;
>
> return cfg->lcore_role[lcore_id] == role;
> }
Applied, thanks.
prev parent reply other threads:[~2025-06-08 19:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 20:17 pbhagavatula
2025-05-21 5:13 ` Morten Brørup
2025-05-21 11:26 ` Konstantin Ananyev
2025-06-08 19:57 ` Thomas Monjalon [this message]
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=3958894.6tgchFWduM@thomas \
--to=thomas@monjalon.net \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=erik.g.carrillo@intel.com \
--cc=jerinj@marvell.com \
--cc=mb@smartsharesystems.com \
--cc=pbhagavatula@marvell.com \
--cc=roretzla@linux.microsoft.com \
--cc=stable@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).