DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rongwei Liu <rongweil@nvidia.com>
To: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
	<thomas@monjalon.net>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>
Subject: [dpdk-dev] [RFC 0/1] net/mlx5: set txq affinity in round-robin
Date: Fri, 10 Sep 2021 07:23:46 +0300	[thread overview]
Message-ID: <20210910042347.12820-1-rongweil@nvidia.com> (raw)

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(-)

-- 
2.27.0


             reply	other threads:[~2021-09-10  4:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10  4:23 Rongwei Liu [this message]
2021-09-10  4:23 ` [dpdk-dev] [RFC 1/1] " Rongwei Liu
2021-09-13 12:11   ` Kinsella, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210910042347.12820-1-rongweil@nvidia.com \
    --to=rongweil@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).