Skip to contentSkip to conversation

doc: document that fork is not supported after EAL init

PATCH New Stephen Hemminger 1 participant 1 message Nov 23

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: document that fork is not supported after EAL init

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.

---
 doc/guides/prog_guide/env_abstraction_layer.rst | 7 +++++++
 1 file changed, 7 insertions(+)
doc/guides/prog_guide/env_abstraction_layer.rst +7 -0
index 2f13ee846e..c54c7e73a5 100644
@@ -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
 ~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
2.53.0