summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_txq.c
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2018-01-22 13:33:38 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-01-29 10:04:28 +0100
commitd10b09db0a455a27f1f1fa5e4a0fa7b1350706a5 (patch)
treea44f1bcd53ff419767d76a522f4c1ad144573502 /drivers/net/mlx5/mlx5_txq.c
parent80554894c4618f6f3bd202565bc881215d99dde6 (diff)
downloaddpdk-next-eventdev-d10b09db0a455a27f1f1fa5e4a0fa7b1350706a5.zip
dpdk-next-eventdev-d10b09db0a455a27f1f1fa5e4a0fa7b1350706a5.tar.gz
dpdk-next-eventdev-d10b09db0a455a27f1f1fa5e4a0fa7b1350706a5.tar.xz
net/mlx5: fix allocation when no memory on device NUMA node
When no memory is available on the same numa node than the device, the initialization of the device fails. However, the use case where the cores and memory are on a different socket than the device is valid, even if not optimal. To fix this issue, this commit introduces an infrastructure to select the socket on which to allocate the verbs objects based on the ethdev configuration and the object type, rather than the PCI numa node. Fixes: 1e3a39f72d5d ("net/mlx5: allocate verbs object into shared memory") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_txq.c')
-rw-r--r--drivers/net/mlx5/mlx5_txq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 4901830..18321c3 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -396,6 +396,8 @@ mlx5_priv_txq_ibv_new(struct priv *priv, uint16_t idx)
int ret = 0;
assert(txq_data);
+ priv->verbs_alloc_ctx.type = MLX5_VERBS_ALLOC_TYPE_TX_QUEUE;
+ priv->verbs_alloc_ctx.obj = txq_ctrl;
if (mlx5_getenv_int("MLX5_ENABLE_CQE_COMPRESSION")) {
ERROR("MLX5_ENABLE_CQE_COMPRESSION must never be set");
goto error;
@@ -526,12 +528,14 @@ mlx5_priv_txq_ibv_new(struct priv *priv, uint16_t idx)
DEBUG("%p: Verbs Tx queue %p: refcnt %d", (void *)priv,
(void *)txq_ibv, rte_atomic32_read(&txq_ibv->refcnt));
LIST_INSERT_HEAD(&priv->txqsibv, txq_ibv, next);
+ priv->verbs_alloc_ctx.type = MLX5_VERBS_ALLOC_TYPE_NONE;
return txq_ibv;
error:
if (tmpl.cq)
claim_zero(ibv_destroy_cq(tmpl.cq));
if (tmpl.qp)
claim_zero(ibv_destroy_qp(tmpl.qp));
+ priv->verbs_alloc_ctx.type = MLX5_VERBS_ALLOC_TYPE_NONE;
return NULL;
}