]> git.droids-corp.org - dpdk.git/commit
common/mlx5: fix MR lookup for non-contiguous mempool
authorDmitry Kozlyuk <dkozlyuk@nvidia.com>
Fri, 14 Jan 2022 10:52:17 +0000 (12:52 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 26 Jan 2022 16:41:10 +0000 (17:41 +0100)
commit2eb92b0fbbabcb1fb49d2006de7682cca80ebea7
tree9f648fd10757639cbcd0fd6f05dc1bc781877abf
parentafd857cba9946797c98511badb1a0921d9b0d7eb
common/mlx5: fix MR lookup for non-contiguous mempool

Memory region (MR) lookup by address inside mempool MRs
was not accounting for the upper bound of an MR.
For mempools covered by multiple MRs this could return
a wrong MR LKey, typically resulting in an unrecoverable
TxQ failure:

    mlx5_net: Cannot change Tx QP state to INIT Invalid argument

Corresponding message from /var/log/dpdk_mlx5_port_X_txq_Y_index_Z*:

    Unexpected CQE error syndrome 0x04 CQN = 128 SQN = 4848
        wqe_counter = 0 wq_ci = 9 cq_ci = 122

This is likely to happen with --legacy-mem and IOVA-as-PA,
because EAL intentionally maps pages at non-adjacent PA
to non-adjacent VA in this mode, and MLX5 PMD works with VA.

Fixes: 690b2a88c2f7 ("common/mlx5: add mempool registration facilities")
Cc: stable@dpdk.org
Reported-by: Wang Yunjian <wangyunjian@huawei.com>
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/common/mlx5/mlx5_common_mr.c