[dpdk-stable] patch 'net/mlx5: fix memory region cache last index' has been queued to LTS release 17.11.1

Yuanhan Liu yliu at fridaylinux.org
Thu Feb 1 10:47:34 CET 2018


Hi,

FYI, your patch has been queued to LTS release 17.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/03/18. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 1eee333eaa818ccd1721064a8628dadbf360306e Mon Sep 17 00:00:00 2001
From: Shahaf Shuler <shahafs at mellanox.com>
Date: Thu, 25 Jan 2018 18:18:02 +0200
Subject: [PATCH] net/mlx5: fix memory region cache last index

[ upstream commit 627cbfad1ca0d4e12744a28d61b8881ab5ff3757 ]

In case Memory Region cache is full, the new mempool will be
inserted in the last index of the array.

Update the last entry being hit to reflect it.

Fixes: b0b093845793 ("net/mlx5: use buffer address for LKEY search")

Signed-off-by: Xueming Li <xuemingl at mellanox.com>
Signed-off-by: Shahaf Shuler <shahafs at mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
---
 drivers/net/mlx5/mlx5_rxtx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index ab71a68..604f308 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -564,7 +564,6 @@ mlx5_tx_mb2mr(struct mlx5_txq_data *txq, struct rte_mbuf *mb)
 			return txq->mp2mr[i]->lkey;
 		}
 	}
-	txq->mr_cache_idx = 0;
 	mr = mlx5_txq_mp2mr_reg(txq, mlx5_tx_mb2mp(mb), i);
 	/*
 	 * Request the reference to use in this queue, the original one is
@@ -572,6 +571,7 @@ mlx5_tx_mb2mr(struct mlx5_txq_data *txq, struct rte_mbuf *mb)
 	 */
 	if (mr) {
 		rte_atomic32_inc(&mr->refcnt);
+		txq->mr_cache_idx = i >= RTE_DIM(txq->mp2mr) ? i - 1 : i;
 		return mr->lkey;
 	}
 	return (uint32_t)-1;
-- 
2.7.4



More information about the stable mailing list