common/mlx5: fix memory region lookup on slow path
authorDmitry Kozlyuk <dkozlyuk@nvidia.com>
Thu, 25 Nov 2021 20:20:44 +0000 (22:20 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 26 Nov 2021 12:27:38 +0000 (13:27 +0100)
commit63625c5da1853b6d5a4f44b713c7d4a3d49ceb0a
treefa346b7069492560a9dc1444bf4d630b029b27c4
parent6399acaded4205ef4e81f375776df7db266826c1
common/mlx5: fix memory region lookup on slow path

Memory region (MR) was being looked up incorrectly
for the data address of an externally-attached mbuf.
A search was attempted for the mempool of the mbuf,
while mbuf data address does not belong to this mempool
in case of externally-attached mbuf.
Only attempt the search:
1) for not externally-attached mbufs;
2) for mbufs coming from MPRQ mempool;
3) for externally-attached mbufs from mempools
   with pinned external buffers.

Fixes: 08ac03580ef2 ("common/mlx5: fix mempool registration")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Reviewed-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/common/mlx5/mlx5_common_mr.c