Skip to content

mlx5: sharing global MR cache between drivers

[email protected] dpdk-dev 3 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest18 patches 1 replyApplied
  2. v218 patches 2 repliesSuperseded
  3. v118 patches 0 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/18net/mlx5/windows: fix miss callback register for mem eventdrivers/net/mlx5/windows/mlx5_os.c+13 -00 replies
2/18common/mlx5: share basic probing with the internal driversdrivers/common/mlx5/mlx5_common.c drivers/common/mlx5/mlx5_common.h drivers/common/mlx5/mlx5_common_private.h +8 more+94 -920 replies
3/18common/mlx5: share common definitionsdrivers/common/mlx5/mlx5_common.c drivers/common/mlx5/mlx5_common_defs.h drivers/common/mlx5/mlx5_common_mr.h +3 more+49 -370 replies
4/18common/mlx5: share memory related devargsdrivers/common/mlx5/mlx5_common.c drivers/common/mlx5/mlx5_common.h drivers/common/mlx5/mlx5_malloc.h +8 more+186 -890 replies
5/18net/mlx5/windows: rearrange probing codedrivers/net/mlx5/windows/mlx5_os.c+94 -1300 replies
6/18common/mlx5: move basic probing functions to commondrivers/common/mlx5/linux/mlx5_common_os.c drivers/common/mlx5/linux/mlx5_common_os.h drivers/common/mlx5/linux/mlx5_common_verbs.c +7 more+411 -3990 replies
7/18net/mlx5: remove redundant flag in device configdrivers/net/mlx5/linux/mlx5_os.c drivers/net/mlx5/mlx5.h drivers/net/mlx5/mlx5_flow_dv.c +2 more+21 -240 replies
8/18common/mlx5: share device context objectdrivers/common/mlx5/linux/mlx5_common_os.c drivers/common/mlx5/mlx5_common.c drivers/common/mlx5/mlx5_common.h +25 more+321 -3280 replies
9/18common/mlx5: add ROCE disable in context device creationdrivers/common/mlx5/linux/mlx5_common_os.c drivers/common/mlx5/linux/mlx5_common_os.h drivers/common/mlx5/linux/mlx5_common_verbs.c +12 more+188 -2010 replies
10/18common/mlx5: share the protection domain objectdrivers/common/mlx5/linux/mlx5_common_os.c drivers/common/mlx5/linux/mlx5_common_os.h drivers/common/mlx5/mlx5_common.c +32 more+167 -3490 replies
11/18common/mlx5: share the HCA capabilities handledrivers/common/mlx5/mlx5_common.c drivers/common/mlx5/mlx5_common.h drivers/compress/mlx5/mlx5_compress.c +15 more+100 -1360 replies
12/18net/mlx5: remove redundancy in MR filedrivers/net/mlx5/mlx5_mr.c drivers/net/mlx5/mlx5_tx.h+1 -1430 replies
13/18common/mlx5: add MR ctrl init functiondrivers/common/mlx5/mlx5_common_mr.c drivers/common/mlx5/mlx5_common_mr.h drivers/common/mlx5/version.map +5 more+42 -190 replies
14/18common/mlx5: add global MR cache create functiondrivers/common/mlx5/linux/mlx5_common_verbs.c drivers/common/mlx5/mlx5_common_mr.c drivers/common/mlx5/mlx5_common_mr.h +12 more+70 -1170 replies
15/18common/mlx5: share MR top-half search functiondrivers/common/mlx5/mlx5_common.h drivers/common/mlx5/mlx5_common_mr.c drivers/common/mlx5/version.map +3 more+77 -950 replies
16/18common/mlx5: share MR managementdrivers/common/mlx5/mlx5_common.c drivers/common/mlx5/mlx5_common.h drivers/common/mlx5/mlx5_common_mr.c +27 more+110 -3580 replies
17/18common/mlx5: support device DMA map and unmapdrivers/common/mlx5/mlx5_common.c drivers/common/mlx5/mlx5_common.h drivers/common/mlx5/mlx5_common_mr.c +4 more+100 -2550 replies
18/18common/mlx5: share MR mempool registrationdrivers/common/mlx5/mlx5_common.c drivers/common/mlx5/mlx5_common.h drivers/common/mlx5/mlx5_common_mp.h +16 more+322 -2980 replies

Reviews trailers per patch

All 18 patches have a Reviewed-by or Acked-by.

PatchMatan Azrad
1/18A-b
2/18A-b
3/18A-b
4/18A-b
5/18A-b
6/18A-b
7/18A-b
8/18A-b
9/18A-b
10/18A-b
11/18A-b
12/18A-b
13/18A-b
14/18A-b
15/18A-b
16/18A-b
17/18A-b
18/18A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [dpdk-dev] [PATCH v3 00/18] mlx5: sharing global MR cache between drivers

From: Michael Baum <[email protected]>

The MLNX PMD supports 5 classes (net, RegEx, vDPA, Compress and Crypto). The various drivers are registered under the common driver, and managed by it.
In the common driver probing, it calls in a loop the probe function of each driver registered to it. Each driver creates for itself all the objects required for communication with the hardware, as well as a global MR cache that manages memory mappings.
The management of the caches separately by the different drivers, is not very efficient. In fact the same memory is managed several times and each caching handle is done by doubling the number of drivers, so we want to manage this cache jointly by the common driver.
This feature will move management to common driver in two phases.

Phase 1: sharing HW objects between drivers (11 patches)
The communication with the hardware - for any MR handle - is conducted by the Protection Domain, so we are motivated to share it between the drivers. However, to create it we need to give the context of the device, so the context must also be shared between the drivers. At this point we will share between the drivers the next trio (CTX, PD, pdn) to create an infrastructure that will allow sharing of dependent objects, and in particular the global MR cache.
The common driver itself will create this trio individually for all drivers, before calling their probe function. As a parameter to the probe function, it will give them a pointer to the structure containing the trio.

Phase 2: sharing global MR cache between drivers (7 patches) The common driver will add to the structure containing the trio also the structure that manages the global MR cache, and will keep a list of such structures for memory management. In each driver, each queue will manage its own local MR cache. If the queue does not find its cache, it will switch to searching the global MR cache shared by all. Caching access will be through the pointer that the driver received as a parameter in probing.

v2: rebase
v3: fix compilation issue

Michael Baum (18):
net/mlx5/windows: fix miss callback register for mem event common/mlx5: share basic probing with the internal drivers common/mlx5: share common definitions common/mlx5: share memory related devargs net/mlx5/windows: rearrange probing code common/mlx5: move basic probing functions to common net/mlx5: remove redundant flag in device config common/mlx5: share device context object common/mlx5: add ROCE disable in context device creation common/mlx5: share the protection domain object common/mlx5: share the HCA capabilities handle net/mlx5: remove redundancy in MR file common/mlx5: add MR ctrl init function common/mlx5: add global MR cache create function common/mlx5: share MR top-half search function common/mlx5: share MR management
common/mlx5: support device DMA map and unmap common/mlx5: share MR mempool registration

 drivers/common/mlx5/linux/mlx5_common_os.c    | 280 +++++++-
 drivers/common/mlx5/linux/mlx5_common_os.h    |  16 +-
 drivers/common/mlx5/linux/mlx5_common_verbs.c |  96 ++-
 drivers/common/mlx5/linux/mlx5_nl.c           |   2 +-
 drivers/common/mlx5/linux/mlx5_nl.h           |   6 +-
 drivers/common/mlx5/mlx5_common.c             | 596 +++++++++++++++---
 drivers/common/mlx5/mlx5_common.h             |  96 +--
 drivers/common/mlx5/mlx5_common_defs.h        |  45 ++
 drivers/common/mlx5/mlx5_common_mp.h          |  11 +
 drivers/common/mlx5/mlx5_common_mr.c          | 192 +++++-
 drivers/common/mlx5/mlx5_common_mr.h          |  76 ++-
 drivers/common/mlx5/mlx5_common_private.h     |   6 -
 drivers/common/mlx5/mlx5_devx_cmds.h          |  12 +-
 drivers/common/mlx5/mlx5_malloc.h             |   1 -
 drivers/common/mlx5/version.map               |  29 +-
 drivers/common/mlx5/windows/mlx5_common_os.c  | 245 ++++++-
 drivers/common/mlx5/windows/mlx5_common_os.h  |   9 +-
 drivers/compress/mlx5/mlx5_compress.c         | 245 ++-----
 drivers/crypto/mlx5/mlx5_crypto.c             | 209 +-----
 drivers/crypto/mlx5/mlx5_crypto.h             |   6 +-
 drivers/crypto/mlx5/mlx5_crypto_dek.c         |   5 +-
 drivers/net/mlx5/linux/mlx5_ethdev_os.c       |   6 +-
 drivers/net/mlx5/linux/mlx5_mp_os.c           |  12 +-
 drivers/net/mlx5/linux/mlx5_os.c              | 511 ++++-----------
 drivers/net/mlx5/linux/mlx5_verbs.c           |  99 +--
 drivers/net/mlx5/linux/mlx5_verbs.h           |   2 -
 drivers/net/mlx5/meson.build                  |   1 -
 drivers/net/mlx5/mlx5.c                       | 241 ++-----
 drivers/net/mlx5/mlx5.h                       |  57 +-
 drivers/net/mlx5/mlx5_defs.h                  |  22 +-
 drivers/net/mlx5/mlx5_devx.c                  |  39 +-
 drivers/net/mlx5/mlx5_flow.c                  |   6 +-
 drivers/net/mlx5/mlx5_flow_aso.c              |  50 +-
 drivers/net/mlx5/mlx5_flow_dv.c               |  66 +-
 drivers/net/mlx5/mlx5_flow_verbs.c            |   4 +-
 drivers/net/mlx5/mlx5_mr.c                    | 397 ------------
 drivers/net/mlx5/mlx5_mr.h                    |  26 -
 drivers/net/mlx5/mlx5_rx.c                    |  16 +-
 drivers/net/mlx5/mlx5_rx.h                    |  20 +-
 drivers/net/mlx5/mlx5_rxq.c                   |  11 +-
 drivers/net/mlx5/mlx5_rxtx.c                  |   1 -
 drivers/net/mlx5/mlx5_rxtx.h                  |  27 -
 drivers/net/mlx5/mlx5_rxtx_vec.h              |   1 -
 drivers/net/mlx5/mlx5_trigger.c               |   8 +-
 drivers/net/mlx5/mlx5_tx.c                    |   1 -
 drivers/net/mlx5/mlx5_tx.h                    |  30 +-
 drivers/net/mlx5/mlx5_txpp.c                  |  23 +-
 drivers/net/mlx5/mlx5_txq.c                   |  10 +-
 drivers/net/mlx5/windows/mlx5_ethdev_os.c     |  12 +-
 drivers/net/mlx5/windows/mlx5_os.c            | 402 ++----------
 drivers/regex/mlx5/mlx5_regex.c               | 144 +----
 drivers/regex/mlx5/mlx5_regex.h               |  27 +-
 drivers/regex/mlx5/mlx5_regex_control.c       |  19 +-
 drivers/regex/mlx5/mlx5_regex_fastpath.c      |  47 +-
 drivers/regex/mlx5/mlx5_rxp.c                 |  62 +-
 drivers/vdpa/mlx5/mlx5_vdpa.c                 | 212 +------
 drivers/vdpa/mlx5/mlx5_vdpa.h                 |   5 +-
 drivers/vdpa/mlx5/mlx5_vdpa_event.c           |  25 +-
 drivers/vdpa/mlx5/mlx5_vdpa_lm.c              |   6 +-
 drivers/vdpa/mlx5/mlx5_vdpa_mem.c             |  13 +-
 drivers/vdpa/mlx5/mlx5_vdpa_steer.c           |  11 +-
 drivers/vdpa/mlx5/mlx5_vdpa_virtq.c           |  15 +-
 62 files changed, 2083 insertions(+), 2787 deletions(-)
 create mode 100644 drivers/common/mlx5/mlx5_common_defs.h
 delete mode 100644 drivers/net/mlx5/mlx5_mr.c
 delete mode 100644 drivers/net/mlx5/mlx5_mr.h
Signature · 1 line
2.25.1