DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Cheryl Bansal <cheryl.bansal@altera.com>
To: bruce.richardson@intel.com, david.marchand@redhat.com
Cc: arnon@qwilt.com, dev@dpdk.org, stable@dpdk.org,
	Cheryl Bansal <cheryl.bansal@altera.com>
Subject: [PATCH] eal: set errno when shared config init fails
Date: Mon, 30 Nov 2026 20:39:02 +0530	[thread overview]
Message-ID: <20261130150902.2562849-1-cheryl.bansal@altera.com> (raw)

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


             reply	other threads:[~2026-11-30 15:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 15:09 Cheryl Bansal [this message]
2026-11-30 17:39 ` [PATCH] eal: set errno when shared config init fails Stephen Hemminger

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=20261130150902.2562849-1-cheryl.bansal@altera.com \
    --to=cheryl.bansal@altera.com \
    --cc=arnon@qwilt.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --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