ipc: handle unsupported IPC in action register
[dpdk.git] / drivers / net / mlx4 / mlx4_mp.c
index 1836224..ebc57a9 100644 (file)
@@ -316,11 +316,18 @@ exit:
 /**
  * Initialize by primary process.
  */
-void
+int
 mlx4_mp_init_primary(void)
 {
+       int ret;
+
        assert(rte_eal_process_type() == RTE_PROC_PRIMARY);
-       rte_mp_action_register(MLX4_MP_NAME, mp_primary_handle);
+
+       /* primary is allowed to not support IPC */
+       ret = rte_mp_action_register(MLX4_MP_NAME, mp_primary_handle);
+       if (ret && rte_errno != ENOTSUP)
+               return -1;
+       return 0;
 }
 
 /**
@@ -336,11 +343,11 @@ mlx4_mp_uninit_primary(void)
 /**
  * Initialize by secondary process.
  */
-void
+int
 mlx4_mp_init_secondary(void)
 {
        assert(rte_eal_process_type() == RTE_PROC_SECONDARY);
-       rte_mp_action_register(MLX4_MP_NAME, mp_secondary_handle);
+       return rte_mp_action_register(MLX4_MP_NAME, mp_secondary_handle);
 }
 
 /**