[v2] eal/linux: register mp hotplug callback after memory init
Checks
Commit Message
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.
v2: add signed-off-by
Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
lib/eal/linux/eal.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Comments
On Thu, Jun 8, 2023 at 9:26 AM Zhihong Wang
<wangzhihong.wzh@bytedance.com> wrote:
>
> 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.
>
> Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Forgot to mention that we need a Fixes: tag.
I added it and applied, thanks.
@@ -1058,12 +1058,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;
@@ -1221,6 +1215,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;