mbox

[RFC,v1,0/7] net/mlx5: introduce limit watermark and host shaper

Message ID 20220506035645.4101714-1-spiked@nvidia.com (mailing list archive)
Headers

Message

Spike Du May 6, 2022, 3:56 a.m. UTC
  LWM(limit watermark) is per RX queue attribute, when RX queue fullness reach
the LWM limit, HW sends an event to dpdk application.
Host shaper can configure shaper rate and lwm-triggered for a host port.
The shaper limits the rate of traffic from host port to wire port.
If lwm-triggered is enabled, a 100Mbps shaper is enabled automatically
when one of the host port's Rx queues receives LWM event.

These two features can combine to control traffic from host port to wire port.
The work flow is configure LWM to RX queue and enable lwm-triggered flag in
host shaper, after receiving LWM event, delay a while until RX queue is empty
, then disable the shaper. We recycle this work flow to reduce RX queue drops.

Add new libethdev API to set LWM, add rte event RTE_ETH_EVENT_RXQ_LIMIT_REACHED
to handle LWM event. For host shaper, because it doesn't align to existing DPDK
framework and is specific to Nvidia NIC, use PMD private API.

For integration with testpmd, put the private cmdline function and LWM event
handler in mlx5 PMD directory by adding a new file mlx5_test.c. Only add minimal
code in testpmd to invoke interfaces from mlx5_test.c.

Spike Du (7):
  net/mlx5: add LWM support for Rxq
  common/mlx5: share interrupt management
  ethdev: introduce Rx queue based limit watermark
  net/mlx5: add LWM event handling support
  net/mlx5: support Rx queue based limit watermark
  net/mlx5: add private API to config host port shaper
  app/testpmd: add LWM and Host Shaper command

 app/test-pmd/cmdline.c                       |  74 ++++++++
 app/test-pmd/config.c                        |  23 +++
 app/test-pmd/meson.build                     |   3 +
 app/test-pmd/testpmd.c                       |  13 ++
 app/test-pmd/testpmd.h                       |   1 +
 doc/guides/nics/mlx5.rst                     |  87 +++++++++
 doc/guides/rel_notes/release_22_07.rst       |   2 +
 drivers/common/mlx5/linux/meson.build        |  44 +++--
 drivers/common/mlx5/linux/mlx5_common_os.c   | 131 ++++++++++++++
 drivers/common/mlx5/linux/mlx5_common_os.h   |  11 ++
 drivers/common/mlx5/mlx5_prm.h               |  26 +++
 drivers/common/mlx5/version.map              |   3 +-
 drivers/common/mlx5/windows/mlx5_common_os.h |  24 +++
 drivers/net/mlx5/linux/mlx5_ethdev_os.c      |  71 --------
 drivers/net/mlx5/linux/mlx5_os.c             | 132 +++-----------
 drivers/net/mlx5/linux/mlx5_socket.c         |  53 +-----
 drivers/net/mlx5/meson.build                 |   7 +-
 drivers/net/mlx5/mlx5.c                      |  62 +++++++
 drivers/net/mlx5/mlx5.h                      |  12 +-
 drivers/net/mlx5/mlx5_devx.c                 |  60 ++++++-
 drivers/net/mlx5/mlx5_devx.h                 |   1 +
 drivers/net/mlx5/mlx5_rx.c                   | 253 +++++++++++++++++++++++++++
 drivers/net/mlx5/mlx5_rx.h                   |  11 ++
 drivers/net/mlx5/mlx5_test.c                 | 191 ++++++++++++++++++++
 drivers/net/mlx5/mlx5_test.h                 |  27 +++
 drivers/net/mlx5/mlx5_txpp.c                 |  28 +--
 drivers/net/mlx5/rte_pmd_mlx5.h              |  30 ++++
 drivers/net/mlx5/version.map                 |   2 +
 drivers/net/mlx5/windows/mlx5_ethdev_os.c    |  22 ---
 drivers/vdpa/mlx5/mlx5_vdpa_virtq.c          |  52 +-----
 lib/ethdev/ethdev_driver.h                   |   7 +
 lib/ethdev/rte_ethdev.c                      |  28 +++
 lib/ethdev/rte_ethdev.h                      |  30 +++-
 lib/ethdev/version.map                       |   3 +
 34 files changed, 1193 insertions(+), 331 deletions(-)
 create mode 100644 drivers/net/mlx5/mlx5_test.c
 create mode 100644 drivers/net/mlx5/mlx5_test.h