DPDK patches and discussions
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
To: "pbhagavatula@marvell.com" <pbhagavatula@marvell.com>,
	"anatoly.burakov@intel.com" <anatoly.burakov@intel.com>,
	"erik.g.carrillo@intel.com" <erik.g.carrillo@intel.com>,
	"mb@smartsharesystems.com" <mb@smartsharesystems.com>,
	"jerinj@marvell.com" <jerinj@marvell.com>,
	Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH] eal: fix return value of lcore role
Date: Wed, 21 May 2025 11:26:13 +0000	[thread overview]
Message-ID: <77ea61e96ce54cbeb46eb440e30fd19e@huawei.com> (raw)
In-Reply-To: <20250520201726.7420-1-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
> 
> Suggested-by: Morten Brørup <mb@smartsharesystems.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  lib/eal/common/eal_common_lcore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
> index 294267177d..9dd6c72055 100644
> --- 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;
>  }
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
 
> 2.43.0


      parent reply	other threads:[~2025-05-21 11:26 UTC|newest]

Thread overview: 3+ 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 [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=77ea61e96ce54cbeb46eb440e30fd19e@huawei.com \
    --to=konstantin.ananyev@huawei.com \
    --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).