DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] eal: set errno when shared config init fails
@ 2026-11-30 15:09 Cheryl Bansal
  2026-11-30 17:39 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Cheryl Bansal @ 2026-11-30 15:09 UTC (permalink / raw)
  To: bruce.richardson, david.marchand; +Cc: arnon, dev, stable, Cheryl Bansal

rte_eal_init() is documented to return -1 with rte_errno set.
rte_config_init() returns -1 without setting it, so a second primary
process fails the config lock and the caller observes rte_errno 0.

Set EAGAIN at that failure. It is the code returned when the lock is
held, and rte_eal_init() already documents it as a resource that can
be retried. The same assignment covers the other config init failures,
which matches the one code used for each later init stage.

Bugzilla ID: 2156
Fixes: 4e8854ae89fa ("eal: do not panic on shared memory init")
Cc: stable@dpdk.org

Signed-off-by: Cheryl Bansal <cheryl.bansal@altera.com>
---
 lib/eal/freebsd/eal.c | 1 +
 lib/eal/linux/eal.c   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index faf5f0e911..5383639e10 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -498,6 +498,7 @@ rte_eal_init(int argc, char **argv)
 
 	if (rte_config_init() < 0) {
 		rte_eal_init_alert("Cannot init config");
+		rte_errno = EAGAIN;
 		goto err_out;
 	}
 
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 278504237d..03ccca2424 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -649,6 +649,7 @@ rte_eal_init(int argc, char **argv)
 
 	if (rte_config_init() < 0) {
 		rte_eal_init_alert("Cannot init config");
+		rte_errno = EAGAIN;
 		goto err_out;
 	}
 
-- 
2.43.0


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

* Re: [PATCH] eal: set errno when shared config init fails
  2026-11-30 15:09 [PATCH] eal: set errno when shared config init fails Cheryl Bansal
@ 2026-11-30 17:39 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2026-11-30 17:39 UTC (permalink / raw)
  To: Cheryl Bansal; +Cc: bruce.richardson, david.marchand, arnon, dev, stable

On Mon, 30 Nov 2026 20:39:02 +0530
Cheryl Bansal <cheryl.bansal@altera.com> wrote:

> rte_eal_init() is documented to return -1 with rte_errno set.
> rte_config_init() returns -1 without setting it, so a second primary
> process fails the config lock and the caller observes rte_errno 0.
> 
> Set EAGAIN at that failure. It is the code returned when the lock is
> held, and rte_eal_init() already documents it as a resource that can
> be retried. The same assignment covers the other config init failures,
> which matches the one code used for each later init stage.
> 
> Bugzilla ID: 2156
> Fixes: 4e8854ae89fa ("eal: do not panic on shared memory init")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Cheryl Bansal <cheryl.bansal@altera.com>
> ---

I would use EBUSY since caller probably can't retry with any more succes

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

end of thread, other threads:[~2026-11-30 17:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 15:09 [PATCH] eal: set errno when shared config init fails Cheryl Bansal
2026-11-30 17:39 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox