Skip to content

Commit

Permalink
eal/linux: fix secondary process crash for mp hotplug requests
Browse files Browse the repository at this point in the history
[ upstream commit 66f7ee3f7ab1a7d0295464ab236d4ada08eedee3 ]

Secondary would crash if it tries to handle mp requests before memory
init, since globals such as eth_dev_shared_data_lock are not accessible
to it at this moment.

Fixes: 244d513 ("eal: enable hotplug on multi-process")

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  • Loading branch information
Zhihong Wang authored and kevintraynor committed Jul 11, 2023
1 parent 15aac36 commit 3ca0632
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/eal/linux/eal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,12 +1061,6 @@ rte_eal_init(int argc, char **argv)
}
}

/* register multi-process action callbacks for hotplug */
if (eal_mp_dev_hotplug_init() < 0) {
rte_eal_init_alert("failed to register mp callback for hotplug");
return -1;
}

if (rte_bus_scan()) {
rte_eal_init_alert("Cannot scan the buses for devices");
rte_errno = ENODEV;
Expand Down Expand Up @@ -1205,6 +1199,12 @@ rte_eal_init(int argc, char **argv)
return -1;
}

/* register multi-process action callbacks for hotplug after memory init */
if (eal_mp_dev_hotplug_init() < 0) {
rte_eal_init_alert("failed to register mp callback for hotplug");
return -1;
}

if (rte_eal_tailqs_init() < 0) {
rte_eal_init_alert("Cannot init tail queues for objects");
rte_errno = EFAULT;
Expand Down

0 comments on commit 3ca0632

Please sign in to comment.