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 <lsun@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
This commit is contained in:
Nélio Laranjeiro 2016-11-17 10:49:55 +01:00 committed by Ferruh Yigit
parent fe5fe3820e
commit e929f2a2cd

View File

@ -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));