From: NĂ©lio Laranjeiro Date: Thu, 17 Nov 2016 09:49:55 +0000 (+0100) Subject: net/mlx5: fix endianness in Tx completion queue X-Git-Tag: spdx-start~5122 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e929f2a2cd1f45e865dc6a52b44b17f5630238d5;p=dpdk.git net/mlx5: fix endianness in Tx completion queue Completion queue entry data uses network endian, to access them we should use ntoh*(). Fixes: c305090bbaf8 ("net/mlx5: replace countdown with threshold for Tx completions") Reported-by: Liming Sun Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index b31b33b015..2c5ca74c21 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -199,7 +199,7 @@ txq_complete(struct txq *txq) } while (1); if (unlikely(cqe == NULL)) return; - wqe = &(*txq->wqes)[htons(cqe->wqe_counter) & + wqe = &(*txq->wqes)[ntohs(cqe->wqe_counter) & ((1 << txq->wqe_n) - 1)].hdr; elts_tail = wqe->ctrl[3]; assert(elts_tail < (1 << txq->wqe_n));