ipc: handle unsupported IPC in sync request
[dpdk.git] / drivers / net / mlx5 / mlx5_mp.c
index cea74ad..37f26cc 100644 (file)
@@ -180,8 +180,9 @@ mp_req_on_rxtx(struct rte_eth_dev *dev, enum mlx5_mp_req_type type)
        mp_init_msg(dev, &mp_req, type);
        ret = rte_mp_request_sync(&mp_req, &mp_rep, &ts);
        if (ret) {
-               DRV_LOG(ERR, "port %u failed to request stop/start Rx/Tx (%d)",
-                       dev->data->port_id, type);
+               if (rte_errno != ENOTSUP)
+                       DRV_LOG(ERR, "port %u failed to request stop/start Rx/Tx (%d)",
+                               dev->data->port_id, type);
                goto exit;
        }
        if (mp_rep.nb_sent != mp_rep.nb_received) {
@@ -320,11 +321,18 @@ exit:
 /**
  * Initialize by primary process.
  */
-void
+int
 mlx5_mp_init_primary(void)
 {
+       int ret;
+
        assert(rte_eal_process_type() == RTE_PROC_PRIMARY);
-       rte_mp_action_register(MLX5_MP_NAME, mp_primary_handle);
+
+       /* primary is allowed to not support IPC */
+       ret = rte_mp_action_register(MLX5_MP_NAME, mp_primary_handle);
+       if (ret && rte_errno != ENOTSUP)
+               return -1;
+       return 0;
 }
 
 /**
@@ -340,11 +348,11 @@ mlx5_mp_uninit_primary(void)
 /**
  * Initialize by secondary process.
  */
-void
+int
 mlx5_mp_init_secondary(void)
 {
        assert(rte_eal_process_type() == RTE_PROC_SECONDARY);
-       rte_mp_action_register(MLX5_MP_NAME, mp_secondary_handle);
+       return rte_mp_action_register(MLX5_MP_NAME, mp_secondary_handle);
 }
 
 /**