[dpdk-dev,v2,2/7] net/mlx5: fix work queue array size

Message ID 445f14773a544d41d37a6a63a718f97269b86165.1508768946.git.nelio.laranjeiro@6wind.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Nélio Laranjeiro Oct. 23, 2017, 2:49 p.m. UTC
  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 <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index ad741ef44..fce9fb116 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1113,7 +1113,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;