dev: fix hotplug notification to secondary
PATCH 1/1 dev: fix hotplug notification to secondary
There was a logical error when making some last minute change. Fix the no_shconf evaluation.
Besides, we currently have no unit test checking device hotplug in the fast-tests testsuite.
Instead, we rely on rcX tags validations when non regression tests relying on the multiprocess examples are run.
Add some basic unit test that does not cover all that the examples do yet provide a first gate on multiprocess changes.
Bugzilla ID: 1963
--- MAINTAINERS | 1 + app/test/meson.build | 1 + app/test/test.c | 1 + app/test/test.h | 1 + app/test/test_dev_hotplug.c | 320 ++++++++++++++++++++++++++++++++ lib/eal/common/eal_common_dev.c | 4 +- 6 files changed, 326 insertions(+), 2 deletions(-) create mode 100644 app/test/test_dev_hotplug.c
MAINTAINERS +1 -0
@@ -177,6 +177,7 @@ F: app/test/test_common.c F: app/test/test_cpuflags.c F: app/test/test_cycles.c F: app/test/test_debug.c +F: app/test/test_dev_hotplug.c F: app/test/test_devargs.c F: app/test/test_eal* F: app/test/test_errno.c
app/test/meson.build +1 -0
@@ -61,6 +61,7 @@ source_file_deps = { 'test_cryptodev_security_tls_record.c': ['cryptodev', 'security'], 'test_cycles.c': [], 'test_debug.c': [], + 'test_dev_hotplug.c': ['net_null'], 'test_devargs.c': ['kvargs'], 'test_dispatcher.c': ['dispatcher'], 'test_distributor.c': ['distributor'],
app/test/test.c +1 -0
@@ -62,6 +62,7 @@ do_recursive_call(void) } actions[] = {#ifndef RTE_EXEC_ENV_WINDOWS { "run_secondary_instances", test_mp_secondary }, + { "run_hotplug_secondary", test_dev_hotplug_mp }, #endif #ifdef RTE_LIB_PDUMP #ifdef RTE_NET_RING
app/test/test.h +1 -0
@@ -216,6 +216,7 @@ int commands_init(void);int command_valid (const char *cmd);int test_exit (void ); +int test_dev_hotplug_mp (void );int test_mp_secondary (void );int test_panic (void );int test_timer_secondary (void );
app/test/test_dev_hotplug.c new file +320 -0
320 lines not on this page · raw message
lib/eal/common/eal_common_dev.c +2 -2
@@ -269,7 +269,7 @@ rte_dev_probe(const char *devargs) {const struct internal_config *internal_conf =eal_get_internal_configuration (); -bool do_mp = !!internal_conf->no_shconf; +bool do_mp = internal_conf->no_shconf ==0 ;struct eal_dev_mp_req req;struct rte_device *dev;int ret;
@@ -428,7 +428,7 @@ rte_dev_remove(struct rte_device *dev) {const struct internal_config *internal_conf =eal_get_internal_configuration (); -bool do_mp = !!internal_conf->no_shconf; +bool do_mp = internal_conf->no_shconf ==0 ;struct eal_dev_mp_req req;char *devargs;int ret;
Signature · 1 line
2.54.0
Quoted 9 lines · David Marchand
There was a logical error when making some last minute change. Fix the
no_shconfevaluation.Besides, we currently have no unit test checking device hotplug in the fast-tests testsuite.
Instead, we rely on rcX tags validations when non regression tests relying on the multiprocess examples are run.
Quoted 7 lines
Add some basic unit test that does not cover all that the examples do yet provide a first gate on multiprocess changes.
Bugzilla ID: 1963
Fixes 1a2e26d8701d ("dev: skip multi-process in hotplug")Signed-off-by David Marchand <[email protected]>
There are some issues with the added test.
The new test is failing on LoongArch CI.
LoongArch CI seems to have a list of excluded tests, and it excludes multiprocess related tests.
So I guess I'll need LoongArch people to update their tests.
I also have a build issue when disabling net/null.
The AI bot also pointed out some leak in the test exit/error paths.
So I'll send a v2, but I'll separate the EAL fix from the unit test so that I can merge the fix quickly.
Signature · 1 line
David Marchand
PATCH v2 1/1 dev: fix hotplug notification to secondary
In reply to David MarchandThere was a logical error when making some last minute change. Fix the no_shconf evaluation.
Bugzilla ID: 1963
---
Changes since v1:
- separated the unit test from the fix,
--- lib/eal/common/eal_common_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/eal/common/eal_common_dev.c +2 -2
@@ -269,7 +269,7 @@ rte_dev_probe(const char *devargs) {const struct internal_config *internal_conf =eal_get_internal_configuration (); -bool do_mp = !!internal_conf->no_shconf; +bool do_mp = internal_conf->no_shconf ==0 ;struct eal_dev_mp_req req;struct rte_device *dev;int ret;
@@ -428,7 +428,7 @@ rte_dev_remove(struct rte_device *dev) {const struct internal_config *internal_conf =eal_get_internal_configuration (); -bool do_mp = !!internal_conf->no_shconf; +bool do_mp = internal_conf->no_shconf ==0 ;struct eal_dev_mp_req req;char *devargs;int ret;
Signature · 1 line
2.54.0
Quoted 37 lines · David Marchand
There was a logical error when making some last minute change. Fix the
no_shconfevaluation.Bugzilla ID: 1963
Fixes 1a2e26d8701d ("dev: skip multi-process in hotplug")Signed-off-by David Marchand <[email protected]>---
Changes since v1:
- separated the unit test from the fix,--- lib/eal/common/eal_common_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/eal/common/eal_common_dev.c +2
-2@@ -269,7 +269,7 @@ rte_dev_probe(const char *devargs) {const struct internal_config *internal_conf =eal_get_internal_configuration (); -bool do_mp = !!internal_conf->no_shconf; +bool do_mp = internal_conf->no_shconf ==0 ;struct eal_dev_mp_req req;struct rte_device *dev;int ret;@@ -428,7 +428,7 @@ rte_dev_remove(struct rte_device *dev) {const struct internal_config *internal_conf =eal_get_internal_configuration (); -bool do_mp = !!internal_conf->no_shconf; +bool do_mp = internal_conf->no_shconf ==0 ;struct eal_dev_mp_req req;char *devargs;int ret;
David Marchand
AppliedQuoted 8 lines · David Marchand
There was a logical error when making some last minute change. Fix the
no_shconfevaluation.Bugzilla ID: 1963
Fixes 1a2e26d8701d ("dev: skip multi-process in hotplug")Signed-off-by David Marchand <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand