Blame SOURCES/0001-net-mlx5-fix-memory-region-boundary-checks.patch

a6040a
From d01327d95624923003b6e984040c8c17c06b5361 Mon Sep 17 00:00:00 2001
a6040a
From: Shahaf Shuler <shahafs@mellanox.com>
a6040a
Date: Thu, 25 Jan 2018 18:18:03 +0200
a6040a
Subject: [PATCH] net/mlx5: fix memory region boundary checks
a6040a
a6040a
[ upstream commit 25f28d9d294d00a1c539d47a13c14ce282e31b09 ]
a6040a
a6040a
Since commit f81ec748434b ("net/mlx5: fix memory region lookup") the
a6040a
Memory Region (MR) are no longer overlaps.
a6040a
a6040a
Comparing the end address of the MR should be exclusive, otherwise two
a6040a
contiguous MRs may cause wrong matching.
a6040a
a6040a
Fixes: f81ec748434b ("net/mlx5: fix memory region lookup")
a6040a
a6040a
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
a6040a
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
a6040a
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
a6040a
---
a6040a
 drivers/net/mlx5/mlx5_rxtx.h | 4 ++--
a6040a
 1 file changed, 2 insertions(+), 2 deletions(-)
a6040a
a6040a
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
a6040a
index 604f30849..de5b769ef 100644
a6040a
--- a/drivers/net/mlx5/mlx5_rxtx.h
a6040a
+++ b/drivers/net/mlx5/mlx5_rxtx.h
a6040a
@@ -547,7 +547,7 @@ mlx5_tx_mb2mr(struct mlx5_txq_data *txq, struct rte_mbuf *mb)
a6040a
 	struct mlx5_mr *mr;
a6040a
 
a6040a
 	assert(i < RTE_DIM(txq->mp2mr));
a6040a
-	if (likely(txq->mp2mr[i]->start <= addr && txq->mp2mr[i]->end >= addr))
a6040a
+	if (likely(txq->mp2mr[i]->start <= addr && txq->mp2mr[i]->end > addr))
a6040a
 		return txq->mp2mr[i]->lkey;
a6040a
 	for (i = 0; (i != RTE_DIM(txq->mp2mr)); ++i) {
a6040a
 		if (unlikely(txq->mp2mr[i] == NULL ||
a6040a
@@ -556,7 +556,7 @@ mlx5_tx_mb2mr(struct mlx5_txq_data *txq, struct rte_mbuf *mb)
a6040a
 			break;
a6040a
 		}
a6040a
 		if (txq->mp2mr[i]->start <= addr &&
a6040a
-		    txq->mp2mr[i]->end >= addr) {
a6040a
+		    txq->mp2mr[i]->end > addr) {
a6040a
 			assert(txq->mp2mr[i]->lkey != (uint32_t)-1);
a6040a
 			assert(rte_cpu_to_be_32(txq->mp2mr[i]->mr->lkey) ==
a6040a
 			       txq->mp2mr[i]->lkey);
a6040a
-- 
a6040a
2.14.3
a6040a