All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2-next 0/2] Add support for traffic class bandwidth configuration via devlink-rate
@ 2025-07-04 12:27 Carolina Jubran
  2025-07-04 12:27 ` [PATCH iproute2-next 1/2] devlink: Update uapi headers Carolina Jubran
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Carolina Jubran @ 2025-07-04 12:27 UTC (permalink / raw)
  To: stephen, dsahern; +Cc: Jiri Pirko, netdev, Carolina Jubran

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-11 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-04 12:27 [PATCH iproute2-next 0/2] Add support for traffic class bandwidth configuration via devlink-rate Carolina Jubran
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

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.