net/mlx5: support externally allocated static memory
authorYongseok Koh <yskoh@mellanox.com>
Mon, 24 Sep 2018 18:36:47 +0000 (18:36 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 11 Oct 2018 16:53:49 +0000 (18:53 +0200)
commit7e43a32ee06054e7af9de6b9830b61b783df063b
treef2d0ad730f97d7ffa9f311151323db9c2102a945
parent31912d9924039c3a4f58e1bb00f380e5b4c7bd81
net/mlx5: support externally allocated static memory

When MLX PMD registers memory for DMA, it accesses the global memseg list
of DPDK to maximize the range of registration so that LKey search can be
more efficient. Granularity of MR registration is per page.

Externally allocated memory shouldn't be used for DMA because it can't be
searched in the memseg list and free event can't be tracked by DPDK. If it
is used, the following error will occur:

net_mlx5: port 0 unable to find virtually contiguous chunk for
address (0x5600017587c0). rte_memseg_contig_walk() failed.

There's a pending patchset [1] which enables externally allocated memory.
Once it is merged, users can register their own memory out of EAL then that
will resolve this issue.

Meanwhile, if the external memory is static (allocated on startup and never
freed), such memory can also be registered by little tweak in the code.

[1] http://patches.dpdk.org/project/dpdk/list/?series=1415

This patch is not a bug fix but needs to be included in stable versions.

Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
drivers/net/mlx5/mlx5_mr.c
drivers/net/mlx5/mlx5_rxtx.h