All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carolina Jubran <cjubran@nvidia.com>
To: <stephen@networkplumber.org>, <dsahern@gmail.com>
Cc: Jiri Pirko <jiri@nvidia.com>, <netdev@vger.kernel.org>,
	Carolina Jubran <cjubran@nvidia.com>
Subject: [PATCH iproute2-next 0/2] Add support for traffic class bandwidth configuration via devlink-rate
Date: Fri, 4 Jul 2025 15:27:51 +0300	[thread overview]
Message-ID: <20250704122753.845841-1-cjubran@nvidia.com> (raw)

This series adds support for configuring bandwidth allocation per
traffic class (TC) through the devlink-rate interface. It introduces a
new 'tc-bw' attribute, allowing users to define how bandwidth is
distributed across up to 8 traffic classes in a single command. This
enables fine-grained traffic shaping and supports use cases such as
Enhanced Transmission Selection (ETS) as defined by IEEE 802.1Qaz.

Example commands:

- devlink port function rate add pci/0000:08:00.0/group \
  tx_share 10Gbit tx_max 50Gbit tc-bw 0:20 1:0 2:0 3:0 4:0 5:80 6:0 7:0
	Sets tc-bw on a rate node named 'group'; traffic classes 0 and
	5 will get relative shares of 20 and 80 respectively.

- devlink port function rate set pci/0000:08:00.0/1 \
  tc-bw 0:20 1:0 2:0 3:0 4:0 5:80 6:0 7:0
	Updates traffic class bandwidth shares on port 1.

- devlink port function rate set pci/0000:08:00.0/1 \
  tc-bw 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0
	Disables tc-bw on port 1.

**Classification model and queue behavior**

In setups using traffic classes, classification could be performed
based on VLAN PCP or DSCP bits. These are mapped to traffic class
indices by the hypervisor or device configuration.

Each transmit queue is expected to carry traffic for a single traffic
class. Mixing different classes in the same queue can lead to
head-of-line blocking and scheduler misbehavior. The hypervisor ensures
that traffic flows are mapped to the correct queue, and the hardware
uses that queue's identity to assign the packet to the appropriate
traffic class scheduler.

The 'tc-bw' configuration assumes that this model is respected: each
traffic class should correspond to one or more queues that carry
traffic only for that class. Bandwidth shares are enforced per class,
not per queue.

Thanks

Carolina Jubran (2):
  devlink: Update uapi headers
  devlink: Add support for 'tc-bw' attribute in devlink-rate

 devlink/devlink.c            | 191 +++++++++++++++++++++++++++++++++--
 include/uapi/linux/devlink.h |   9 ++
 man/man8/devlink-rate.8      |  14 +++
 3 files changed, 208 insertions(+), 6 deletions(-)

-- 
2.38.1


             reply	other threads:[~2025-07-04 12:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04 12:27 Carolina Jubran [this message]
2025-07-04 12:27 ` [PATCH iproute2-next 1/2] devlink: Update uapi headers Carolina Jubran
2025-07-04 12:27 ` [PATCH iproute2-next 2/2] Add support for 'tc-bw' attribute in devlink-rate Carolina Jubran
2025-07-11 16:50 ` [PATCH iproute2-next 0/2] Add support for traffic class bandwidth configuration via devlink-rate patchwork-bot+netdevbpf

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=20250704122753.845841-1-cjubran@nvidia.com \
    --to=cjubran@nvidia.com \
    --cc=dsahern@gmail.com \
    --cc=jiri@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.