* [PATCH] doc: document that fork is not supported after EAL init
@ 2026-11-23 18:21 Stephen Hemminger
2026-11-25 11:18 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2026-11-23 18:21 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Follow up to a recently closed bug report. Forking an application after rte_eal_init()
does not work, but this was only mentioned in a couple of driver notes.
State the restriction in the EAL programmer's guide, along with what is still allowed:
exec() in the child, or a child making no DPDK calls.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/prog_guide/env_abstraction_layer.rst | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
index 2f13ee846e..c54c7e73a5 100644
--- a/doc/guides/prog_guide/env_abstraction_layer.rst
+++ b/doc/guides/prog_guide/env_abstraction_layer.rst
@@ -64,6 +64,13 @@ It consists of calls to the pthread library (more specifically, pthread_self(),
The creation and initialization functions for these objects are not multi-thread safe.
However, once initialized, the objects themselves can safely be used in multiple threads simultaneously.
+.. warning::
+
+ A child created by ``fork()`` after ``rte_eal_init()`` must not use the DPDK.
+ Calling ``exec()`` in the child, or making no DPDK calls at all, is safe.
+ For multiple processes sharing DPDK resources,
+ use the model described in :doc:`multi_proc_support`.
+
Shutdown and Cleanup
~~~~~~~~~~~~~~~~~~~~
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] doc: document that fork is not supported after EAL init
2026-11-23 18:21 [PATCH] doc: document that fork is not supported after EAL init Stephen Hemminger
@ 2026-11-25 11:18 ` Thomas Monjalon
2026-11-25 18:54 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2026-11-25 11:18 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
23/11/2026 19:21, Stephen Hemminger:
> + A child created by ``fork()`` after ``rte_eal_init()`` must not use the DPDK.
> + Calling ``exec()`` in the child, or making no DPDK calls at all, is safe.
It would be safe if we didn't have atexit(unlink_sockets)
in lib/telemetry/telemetry.c
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] doc: document that fork is not supported after EAL init
2026-11-25 11:18 ` Thomas Monjalon
@ 2026-11-25 18:54 ` Stephen Hemminger
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2026-11-25 18:54 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Wed, 25 Nov 2026 12:18:59 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:
> 23/11/2026 19:21, Stephen Hemminger:
> > + A child created by ``fork()`` after ``rte_eal_init()`` must not use the DPDK.
> > + Calling ``exec()`` in the child, or making no DPDK calls at all, is safe.
>
> It would be safe if we didn't have atexit(unlink_sockets)
> in lib/telemetry/telemetry.c
>
>
No fork breaks many places like hugepages etc.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-25 18:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 18:21 [PATCH] doc: document that fork is not supported after EAL init Stephen Hemminger
2026-11-25 11:18 ` Thomas Monjalon
2026-11-25 18:54 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox