From: Olga Shern Date: Mon, 23 Nov 2015 14:44:47 +0000 (+0100) Subject: mlx5: fix local protection error when Tx MP to MR cache is full X-Git-Tag: spdx-start~7985 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ecbfdbad6e707e1dbf44238e0317cc4ccf69e9b5;p=dpdk.git mlx5: fix local protection error when Tx MP to MR cache is full When MP to MR cache is full, the last (newest) MR is freed instead of the first (oldest) one, causing local protection errors during TX. Fixes: 2e22920b85d9 ("mlx5: support non-scattered Tx and Rx") Signed-off-by: Olga Shern Signed-off-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index c6c167c697..eb6c9f77a9 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -179,7 +179,7 @@ txq_mp2mr(struct txq *txq, const struct rte_mempool *mp) DEBUG("%p: MR <-> MP table full, dropping oldest entry.", (void *)txq); --i; - claim_zero(ibv_dereg_mr(txq->mp2mr[i].mr)); + claim_zero(ibv_dereg_mr(txq->mp2mr[0].mr)); memmove(&txq->mp2mr[0], &txq->mp2mr[1], (sizeof(txq->mp2mr) - sizeof(txq->mp2mr[0]))); }