mbox series

[RFC,0/1] net/mlx5: set txq affinity in round-robin

Message ID 20210910042347.12820-1-rongweil@nvidia.com (mailing list archive)
Headers
Series net/mlx5: set txq affinity in round-robin |

Message

Rongwei Liu Sept. 10, 2021, 4:23 a.m. UTC
  Previously, we set txq affinity to 0 and let firmware
to perform round-robin when bonding. Firmware uses a
global counter to assign txq affinity to different
physical ports accord to remainder after division.

There are three dis-advantages:
1. The global counter is shared between kernel and dpdk.
2. After restarting pmd or port, the previous counter value
is reused, so the new affinity is unpredictable.
3. There is no way to get what affinity is set by firmware.

In this update, we will create several TISs up to the
number of bonding ports and bind each TIS to one PF port.

For each port, it will start to pick up TIS using its port
index. Upper layer application can quickly calculate each txq's
affinity without querying.

At DPDK layer, when creating txq with 2 bonding ports, the
affinity is set like:
port 0: 1-->2-->1-->2
port 1: 2-->1-->2-->1
port 2: 1-->2-->1-->2

Note: Only applicable to Devx api.

Rongwei Liu (1):
  net/mlx5: set txq affinity in round-robin

 drivers/common/mlx5/mlx5_devx_cmds.c | 38 ++++++++++++++++++++++
 drivers/common/mlx5/mlx5_devx_cmds.h | 12 +++++++
 drivers/common/mlx5/mlx5_prm.h       | 26 +++++++++++++++
 drivers/common/mlx5/version.map      |  1 +
 drivers/net/mlx5/linux/mlx5_os.c     | 37 ++++++++++++++++++++++
 drivers/net/mlx5/mlx5.c              | 17 +++-------
 drivers/net/mlx5/mlx5.h              |  8 ++++-
 drivers/net/mlx5/mlx5_devx.c         | 47 ++++++++++++++++++++++++++--
 drivers/net/mlx5/mlx5_tx.h           |  1 +
 drivers/net/mlx5/mlx5_txpp.c         |  4 +--
 10 files changed, 174 insertions(+), 17 deletions(-)