Skip to content

net/mlx5e: Use multiple doorbells

Tariq Toukan bpf linux-doc linux-rdma lkml netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 10 repliesApplied 10/10
  2. v110 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- added numbers to cover letter.
- fixed mlx5.rst nested list error.
- removed newline from NL_SET_ERR_MSG_FMT_MOD.

[1]
mlx5e uses a single MMIO-mapped doorbell per netdevice for all send and receive operations. Writes to the doorbell go over the PCIe bus directly to the device, which then services the indicated queues.

Patches in v2 All 10 applied

#Subject and filesSizeRepliesApplied
1/10net/mlx5: Fix typo of MLX5_EQ_DOORBEL_OFFSETdrivers/net/ethernet/mellanox/mlx5/core/eq.c+2 -41 replyApplied
2/10net/mlx5: Remove unused 'offset' field from mlx5_sq_bfregdrivers/net/ethernet/mellanox/mlx5/core/wc.c include/linux/mlx5/driver.h+7 -61 replyApplied
3/10net/mlx5e: Remove unused 'xsk' param of mlx5e_build_xdpsq_paramdrivers/net/ethernet/mellanox/mlx5/core/en/params.c drivers/net/ethernet/mellanox/mlx5/core/en/params.h drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c+2 -41 replyApplied
4/10net/mlx5: Store the global doorbell in mlx5_privdrivers/infiniband/hw/mlx5/cq.c drivers/net/ethernet/mellanox/mlx5/core/cq.c drivers/net/ethernet/mellanox/mlx5/core/en/params.c +9 more+29 -401 replyApplied
5/10net/mlx5e: Prepare for using multiple TX doorbellsdrivers/net/ethernet/mellanox/mlx5/core/en.h drivers/net/ethernet/mellanox/mlx5/core/en/params.h drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +2 more+20 -51 replyApplied
6/10net/mlx5e: Prepare for using different CQ doorbellsdrivers/net/ethernet/mellanox/mlx5/core/cq.c drivers/net/ethernet/mellanox/mlx5/core/en.h drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +4 more+9 -111 replyApplied
7/10net/mlx5e: Use multiple TX doorbellsdrivers/net/ethernet/mellanox/mlx5/core/en_common.c drivers/net/ethernet/mellanox/mlx5/core/en_main.c include/linux/mlx5/driver.h+42 -21 replyApplied
8/10net/mlx5e: Use multiple CQ doorbellsdrivers/net/ethernet/mellanox/mlx5/core/en.h drivers/net/ethernet/mellanox/mlx5/core/en/params.c drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +2 more+6 -11 replyApplied
9/10devlink: Add a 'num_doorbells' driverinit paramDocumentation/networking/devlink/devlink-params.rst include/net/devlink.h net/devlink/param.c+12 -01 replyApplied
10/10net/mlx5e: Use the 'num_doorbells' devlink paramDocumentation/networking/devlink/mlx5.rst drivers/net/ethernet/mellanox/mlx5/core/devlink.c drivers/net/ethernet/mellanox/mlx5/core/en_common.c+49 -11 replyApplied

Reviews trailers per patch

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

PatchDragos TatuleaJiri PirkoSimon Horman
1/10R-b R-b
2/10R-b R-b
3/10R-b R-b
4/10R-b R-b
5/10R-b R-b
6/10R-b R-b
7/10R-b R-b
8/10R-b R-b
9/10R-b R-b R-b
10/10R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH net-next V2 00/10] net/mlx5e: Use multiple doorbells

Hi,

This series by Cosmin adds multiple doorbells usage in mlx5e driver. See detailed description by Cosmin below [1].

Find V1 here:
https://lore.kernel.org/all/[email protected]/

Regards,
Tariq

V1->V2:
- added numbers to cover letter.
- fixed mlx5.rst nested list error.
- removed newline from NL_SET_ERR_MSG_FMT_MOD.

[1]
mlx5e uses a single MMIO-mapped doorbell per netdevice for all send and receive operations. Writes to the doorbell go over the PCIe bus directly to the device, which then services the indicated queues.

On certain architectures and with sufficiently high volume of doorbell ringing (many cores, many active channels, small MTU, no GSO, etc.), the MMIO-mapped doorbell address can become contended, leading to delays in servicing writes to that address and a global slowdown of all traffic for that netdevice.

mlx5 NICs have supported using multiple doorbells for many years, the mlx5_ib driver for the same hardware has been using multiple doorbells traditionally.

This patch series extends the mlx5 Ethernet driver to also use multiple doorbells to solve the MMIO contention issues. By allocating and using more doorbells for all channel queues (TX and RX), the MMIO contention on any particular doorbell address is reduced significantly.

The first patches are cleanups:
net/mlx5: Fix typo of MLX5_EQ_DOORBEL_OFFSET
net/mlx5: Remove unused 'offset' field from struct mlx5_sq_bfreg' net/mlx5e: Remove unused 'xsk' param of mlx5e_build_xdpsq_param

The next patch separates the global doorbell from Ethernet-specific resources:
net/mlx5: Store the global doorbell in mlx5_priv

Next, plumbing to allow a different doorbell to be used for channel TX and RX queues:
net/mlx5e: Prepare for using multiple TX doorbells net/mlx5e: Prepare for using different CQ doorbells

Then, enable using multiple doorbells for channel queues:
net/mlx5e: Use multiple TX doorbells
net/mlx5e: Use multiple CQ doorbells

Finally, introduce a devlink parameter to control this:
devlink: Add a 'num_doorbells' driverinit param net/mlx5e: Use the 'num_doorbells' devlink param

Some performance results, done with the Linux pktgen script, running b2b over Connect-X 8 NICs:
samples/pktgen/pktgen_sample02_multiqueue.sh -i $NIC -s 64 -d $DST_IP \
-m $MAC -t 64

Baseline (1 doorbell): 9 Mpps
This series (8 doorbells): 56 Mpps

Note that pktgen without 'burst' rings the doorbell after every packet, while real packet TX using NAPI usually batches multiple pending packets with the xmit_more mechanism. So this is in essence a micro-benchmark showcasing the improvement of using multiple doorbells on platforms affected by MMIO contention. Real life traffic usually sees little movement either way.

Cosmin Ratiu (10):
net/mlx5: Fix typo of MLX5_EQ_DOORBEL_OFFSET net/mlx5: Remove unused 'offset' field from mlx5_sq_bfreg net/mlx5e: Remove unused 'xsk' param of mlx5e_build_xdpsq_param net/mlx5: Store the global doorbell in mlx5_priv net/mlx5e: Prepare for using multiple TX doorbells net/mlx5e: Prepare for using different CQ doorbells net/mlx5e: Use multiple TX doorbells
net/mlx5e: Use multiple CQ doorbells
devlink: Add a 'num_doorbells' driverinit param net/mlx5e: Use the 'num_doorbells' devlink param

 .../networking/devlink/devlink-params.rst     |  3 ++
 Documentation/networking/devlink/mlx5.rst     |  9 ++++
 drivers/infiniband/hw/mlx5/cq.c               |  4 +-
 drivers/net/ethernet/mellanox/mlx5/core/cq.c  |  1 -
 .../net/ethernet/mellanox/mlx5/core/devlink.c | 26 +++++++++++
 drivers/net/ethernet/mellanox/mlx5/core/en.h  |  3 ++
 .../ethernet/mellanox/mlx5/core/en/params.c   |  6 +--
 .../ethernet/mellanox/mlx5/core/en/params.h   |  2 +-
 .../net/ethernet/mellanox/mlx5/core/en/ptp.c  |  6 ++-
 .../net/ethernet/mellanox/mlx5/core/en/ptp.h  |  1 +
 .../net/ethernet/mellanox/mlx5/core/en/trap.c |  1 +
 .../net/ethernet/mellanox/mlx5/core/en/txrx.h |  5 +--
 .../mellanox/mlx5/core/en/xsk/setup.c         |  2 +-
 .../ethernet/mellanox/mlx5/core/en_common.c   | 45 ++++++++++++++++---
 .../net/ethernet/mellanox/mlx5/core/en_main.c | 37 ++++++++++++---
 drivers/net/ethernet/mellanox/mlx5/core/eq.c  |  8 ++--
 .../ethernet/mellanox/mlx5/core/fpga/conn.c   |  1 -
 .../net/ethernet/mellanox/mlx5/core/lib/aso.c |  8 ++--
 .../net/ethernet/mellanox/mlx5/core/main.c    | 11 +++--
 .../mellanox/mlx5/core/steering/hws/send.c    |  8 ++--
 .../mellanox/mlx5/core/steering/sws/dr_send.c |  1 -
 drivers/net/ethernet/mellanox/mlx5/core/wc.c  | 16 ++++---
 include/linux/mlx5/cq.h                       |  1 -
 include/linux/mlx5/driver.h                   |  8 ++--
 include/net/devlink.h                         |  4 ++
 net/devlink/param.c                           |  5 +++
 26 files changed, 163 insertions(+), 59 deletions(-)

base-commit: a4ab91f470c5c84ce0c17197c1562d29aa032340

Signature · 1 line
2.31.1