From: Yongseok Koh Date: Fri, 15 Dec 2017 01:59:17 +0000 (-0800) Subject: net/mlx5: fix Memory Region registration X-Git-Tag: spdx-start~557 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3a6f2eb8c5c597d6675a8fbb9563010c0c546521;p=dpdk.git net/mlx5: fix Memory Region registration Although granularity of chunks in a mempool is a cacheline, addresses are extended to align to page boundary for performance reason in device when registering a MR (Memory Region). This could make some regions overlap, then can cause Tx completion error due to incorrect LKEY search. If the error occurs, the Tx queue will get stuck. To avoid it, end address of a packet segment is used in LKEY search. Fixes: b0b093845793 ("net/mlx5: use buffer address for LKEY search") Cc: stable@dpdk.org Reported-by: Hanoch Haim Signed-off-by: Yongseok Koh Acked-by: Nelio Laranjeiro --- diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index b8c7925a34..b783ca2032 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -543,7 +543,7 @@ static __rte_always_inline uint32_t mlx5_tx_mb2mr(struct mlx5_txq_data *txq, struct rte_mbuf *mb) { uint16_t i = txq->mr_cache_idx; - uintptr_t addr = rte_pktmbuf_mtod(mb, uintptr_t); + uintptr_t addr = rte_pktmbuf_mtod_offset(mb, uintptr_t, DATA_LEN(mb)); struct mlx5_mr *mr; assert(i < RTE_DIM(txq->mp2mr));