summaryrefslogtreecommitdiff
path: root/drivers/net/mlx4/mlx4.c
diff options
context:
space:
mode:
authorAnatoly Burakov <anatoly.burakov@intel.com>2019-04-25 13:45:15 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-06-05 11:27:36 +0200
commitedf73dd330729d9892add288da5e73c171553dd8 (patch)
treeb65b75ad1c0b03e34eeca0b48a604b34c08262d6 /drivers/net/mlx4/mlx4.c
parentc830900d75c55ecebb4bffd86215e117dd4a2089 (diff)
downloaddpdk-edf73dd330729d9892add288da5e73c171553dd8.zip
dpdk-edf73dd330729d9892add288da5e73c171553dd8.tar.gz
dpdk-edf73dd330729d9892add288da5e73c171553dd8.tar.xz
ipc: handle unsupported IPC in action register
Currently, IPC API will silently ignore unsupported IPC. Fix the API call and its callers to explicitly handle unsupported IPC cases. For primary processes, it is OK to not have IPC because there may not be any secondary processes in the first place, and there are valid use cases that disable IPC support, so all primary process usages are fixed up to ignore IPC failures. For secondary processes, IPC will be crucial, so leave all of the error handling as is. Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Diffstat (limited to 'drivers/net/mlx4/mlx4.c')
-rw-r--r--drivers/net/mlx4/mlx4.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index f7cd0c9..aa4d43f 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -697,6 +697,7 @@ mlx4_init_once(void)
{
struct mlx4_shared_data *sd;
struct mlx4_local_data *ld = &mlx4_local_data;
+ int ret = 0;
if (mlx4_init_shared_data())
return -rte_errno;
@@ -711,21 +712,26 @@ mlx4_init_once(void)
rte_rwlock_init(&sd->mem_event_rwlock);
rte_mem_event_callback_register("MLX4_MEM_EVENT_CB",
mlx4_mr_mem_event_cb, NULL);
- mlx4_mp_init_primary();
+ ret = mlx4_mp_init_primary();
+ if (ret)
+ goto out;
sd->init_done = true;
break;
case RTE_PROC_SECONDARY:
if (ld->init_done)
break;
- mlx4_mp_init_secondary();
+ ret = mlx4_mp_init_secondary();
+ if (ret)
+ goto out;
++sd->secondary_cnt;
ld->init_done = true;
break;
default:
break;
}
+out:
rte_spinlock_unlock(&sd->lock);
- return 0;
+ return ret;
}
/**