From ebd0cd832bb4b3dfdf9fea8f81353f938d267401 Mon Sep 17 00:00:00 2001 From: =?utf8?q?N=C3=A9lio=20Laranjeiro?= Date: Tue, 24 Oct 2017 17:18:13 +0200 Subject: [PATCH] net/mlx5: fix work queue array size Indirection table size must be in log to communicate with verbs when the number of queue is not a power of two, the maximum indirection table size is use, but not converted to log2. This makes a memory corruption. Fixes: 4c7a0f5ff876 ("net/mlx5: make indirection tables shareable") Signed-off-by: Nelio Laranjeiro Acked-by: Yongseok Koh --- drivers/net/mlx5/mlx5_rxq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index daf05cb091..a1f382b1f5 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1120,7 +1120,7 @@ mlx5_priv_ind_table_ibv_new(struct priv *priv, uint16_t queues[], struct mlx5_ind_table_ibv *ind_tbl; const unsigned int wq_n = rte_is_power_of_2(queues_n) ? log2above(queues_n) : - priv->ind_table_max_size; + log2above(priv->ind_table_max_size); struct ibv_wq *wq[1 << wq_n]; unsigned int i; unsigned int j; -- 2.20.1