mbox series

[v2,0/4] regex/mlx5: support scattered mbuf

Message ID 20210325043236.964312-1-suanmingm@nvidia.com (mailing list archive)
Headers show
Series regex/mlx5: support scattered mbuf | expand


Suanming Mou March 25, 2021, 4:32 a.m. UTC
The scattered mbuf was not supported in mlx5 RegEx driver. This patch
set adds the support of scattered mbuf by UMR WQE.

UMR WQE can convert multiple mkey's memory sapce to contiguous space.
Take advantage of the UMR WQE, scattered mbuf in one operation can be
converted to an indirect mkey. The RegEx which only accepts one mkey
can now process the whole scattered mbuf.

The maximum scattered mbuf can be supported in one UMR WQE is now
defined as 64. Multiple operations scattered mbufs can be add to one
UMR WQE if there is enough space in the KLM array, since the operations
can address their own mbuf's content by the mkey's address and length.
However, one operation's scattered mbuf's can't be placed in two
different UMR WQE's KLM array, if the UMR WQE's KLM does not has enough
free space for one operation, a new UMR WQE will be required.

In case the UMR WQE's indirect mkey will be over wrapped by the SQ's
WQE move, the meky's index used by the UMR WQE should be the index of
last the RegEX WQE in the operations. As one operation consumes one
WQE set, build the RegEx WQE by reverse helps address the mkey more
efficiently. Once the operations in one burst consumes multiple mkeys,
when the mkey KLM array is full, the reverse WQE set index will always
be the last of the new mkey's for the new UMR WQE.

In GGA mode, the SQ WQE's memory layout becomes UMR/NOP and RegEx WQE by
interleave. The UMR and RegEx WQE can be called as WQE set. The SQ's pi
and ci will also be increased as WQE set not as WQE.

For operations don't have scattered mbuf, uses the mbuf's mkey directly,
the WQE set combination is NOP + RegEx.
For operations have scattered mubf but share the UMR WQE with others,
the WQE set combination is NOP + RegEx.
For operations complete the UMR WQE, the WQE set combination is UMR +

1. Check mbuf multiple seg by nb_segs.
2. Add ops prefetch.
3. Allocate ops and mbuf memory together in test application.
4. Fix ci and pi in correct issue.

John Hurley (1):
  regex/mlx5: prevent wrong calculation of free sqs in umr mode

Suanming Mou (3):
  common/mlx5: add user memory registration bits
  regex/mlx5: add data path scattered mbuf process
  app/test-regex: support scattered mbuf input

 app/test-regex/main.c                    | 134 ++++++--
 doc/guides/regexdevs/mlx5.rst            |   5 +
 doc/guides/rel_notes/release_21_05.rst   |   4 +
 doc/guides/tools/testregex.rst           |   3 +
 drivers/common/mlx5/linux/meson.build    |   2 +
 drivers/common/mlx5/mlx5_devx_cmds.c     |   5 +
 drivers/common/mlx5/mlx5_devx_cmds.h     |   3 +
 drivers/regex/mlx5/mlx5_regex.c          |   9 +
 drivers/regex/mlx5/mlx5_regex.h          |  26 +-
 drivers/regex/mlx5/mlx5_regex_control.c  |  43 ++-
 drivers/regex/mlx5/mlx5_regex_fastpath.c | 380 +++++++++++++++++++++--
 11 files changed, 531 insertions(+), 83 deletions(-)