DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eal: fix return value of lcore role
@ 2025-05-20 20:17 pbhagavatula
  2025-05-21  5:13 ` Morten Brørup
  0 siblings, 1 reply; 2+ messages in thread
From: pbhagavatula @ 2025-05-20 20:17 UTC (permalink / raw)
  To: anatoly.burakov, erik.g.carrillo, mb, jerinj, Tyler Retzlaff
  Cc: dev, Pavan Nikhilesh, stable

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;
 }
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] eal: fix return value of lcore role
  2025-05-20 20:17 [PATCH] eal: fix return value of lcore role pbhagavatula
@ 2025-05-21  5:13 ` Morten Brørup
  0 siblings, 0 replies; 2+ messages in thread
From: Morten Brørup @ 2025-05-21  5:13 UTC (permalink / raw)
  To: pbhagavatula, anatoly.burakov, erik.g.carrillo, jerinj, Tyler Retzlaff
  Cc: dev, stable

> 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;
>  }
> --
> 2.43.0

Reviewed-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-21  5:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-20 20:17 [PATCH] eal: fix return value of lcore role pbhagavatula
2025-05-21  5:13 ` Morten Brørup

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).