common/mlx5: fix external memory pool registration
authorDmitry Kozlyuk <dkozlyuk@nvidia.com>
Tue, 9 Nov 2021 10:32:53 +0000 (12:32 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 10 Nov 2021 14:44:42 +0000 (15:44 +0100)
commit7297d2cdecce71aeaf33d915db1659d6dea0bad6
tree1bd421336dbf49218a246e933761b84014d90e6d
parent0888c011d515b635dab58ec604244b5323282110
common/mlx5: fix external memory pool registration

Registration of packet mempools with RTE_PKTMBUF_POOL_PINNED_EXT_MEM
was performed incorrectly: after population of such mempool chunks
only contain memory for rte_mbuf structures, while pointers to actual
external memory are not yet filled. MR LKeys could not be obtained
for external memory addresses of such mempools. Rx datapath assumes
all used mempools are registered and does not fallback to dynamic
MR creation in such case, so no packets could be received.

Skip registration of extmem pools on population because it is useless.
If used for Rx, they are registered at port start.
During registration, recognize such pools, inspect their mbufs
and recover the pages they reside in.

While MRs for these pages may already be created by rte_dev_dma_map(),
they are not reused to avoid synchronization on Rx datapath
in case these MRs are changed in the database.

Fixes: 690b2a88c2f7 ("common/mlx5: add mempool registration facilities")

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