BPF List
 help / color / mirror / Atom feed
* [PATCH v10 net-next 0/2] octeontx2-pf: mqprio bandwidth offload for NIX TX schedulers
@ 2026-08-31 13:10 Ratheesh Kannoth
  2026-08-31 13:10 ` [PATCH v10 net-next 1/2] net/sched: mqprio: pass qdisc handle to offload drivers Ratheesh Kannoth
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ratheesh Kannoth @ 2026-08-31 13:10 UTC (permalink / raw)
  To: bpf, linux-kernel, netdev
  Cc: andrew+netdev, ast, daniel, davem, edumazet, hawk, horms, jhs,
	jiri, john.fastabend, kuba, pabeni, sdf, sgoutham,
	Ratheesh Kannoth

This series adds hardware offload for channel-mode mqprio with
TC_MQPRIO_SHAPER_BW_RATE on Marvell octeontx2 PF devices. Each
non-QoS transmit queue is shaped by programming MDQ CIR/PIR on the NIX TX
scheduler. When bandwidth offload is enabled, the driver allocates one
SMQ per queue, parents every MDQ under TL4[0], and applies each traffic
class min/max rate to the queue(s) in that class. The TX scheduler
hierarchy is reprogrammed through ndo_stop()/ndo_open() on every mqprio
add, replace, or delete.

Patch 1 is required for patch 2. The octeontx2 driver tracks committed
mqprio configuration in snapshots keyed by the owning qdisc handle. That
handle is needed to implement two behaviours that patch 2 relies on:

  * tc qdisc replace installs the new mqprio and runs its offload setup
    before tearing down the replaced instance. Without the handle, the
    driver cannot tell a stale disable callback from the replaced qdisc
    apart from teardown of the active configuration, and may clear
    hardware shapers or netdev TC state while the new mqprio is being
    committed.

  * When replace fails after partial programming, the driver rolls back
    from the previous snapshot. Matching setup and teardown callbacks to
    the same qdisc instance requires the handle passed through the core
    mqprio offload path.

Patch 1 extends struct tc_mqprio_qopt_offload with that handle and fills
it from mqprio_enable_offload() and mqprio_disable_offload(). Patch 2
consumes it in the octeontx2 PF mqprio offload path.

The driver rejects offload unless the interface is running and the
device supports CIR+PIR shaping. Per-TC rates are rejected when a
traffic class spans more than one queue, and concurrent PFC, XDP, or SDP
rep use is blocked. Ethtool channel count changes are blocked while mqprio
bandwidth offload is active.

Ratheesh Kannoth (2):
  net/sched: mqprio: pass qdisc handle to offload drivers
  octeontx2-pf: add mqprio bandwidth offload for NIX TX schedulers

 .../ethernet/marvell/octeontx2/af/rvu_nix.c   |   6 +-
 .../marvell/octeontx2/nic/otx2_common.c       | 145 +++-
 .../marvell/octeontx2/nic/otx2_common.h       |  27 +
 .../marvell/octeontx2/nic/otx2_dcbnl.c        |   6 +
 .../marvell/octeontx2/nic/otx2_ethtool.c      |   8 +
 .../ethernet/marvell/octeontx2/nic/otx2_pf.c  |  13 +
 .../ethernet/marvell/octeontx2/nic/otx2_tc.c  | 696 ++++++++++++++++++
 .../net/ethernet/marvell/octeontx2/nic/qos.c  |   3 +
 include/net/pkt_sched.h                       |   1 +
 net/sched/sch_mqprio.c                        |   5 +-
 10 files changed, 907 insertions(+), 3 deletions(-)

---

v9 -> v10: Addressed sashiko/jacub comments.
	https://sashiko.dev/#/message/20260817032747.1765883-1-rkannoth%40marvell.com

v8 -> v9: Addressed Sashiko comments
	https://lore.kernel.org/netdev/aoJ6FhtWue0FHDQV@rkannoth-OptiPlex-7090/
v7 -> v8: Addressed Sashiko comments
	https://sashiko.dev/#/patchset/20260811085050.3212280-1-rkannoth%40marvell.com
v6 -> v7: Addressed Sashiko comments
	https://sashiko.dev/#/message/20260810034738.1786029-1-rkannoth%40marvell.com
v5 -> v6: Addressed Sashiko comments
	https://lore.kernel.org/netdev/20260806095434.1144397-1-rkannoth@marvell.com/
v4 -> v5: Addressed sashiko comments
	https://sashiko.dev/#/patchset/20260803042724.3380209-1-rkannoth%40marvell.com
v3 -> v4: Addressed sashiko comments
	https://lore.kernel.org/netdev/20260729105139.2302908-1-rkannoth@marvell.com/
v2 -> v3: Addressed sashiko comments
	https://lore.kernel.org/netdev/amnYX866mYx02cBe@rkannoth-OptiPlex-7090/T/#m67310cbec48b21c7720858ab3a1ea083a0f8dc10
v1 -> v2: Addressed sashiko comments
	https://lore.kernel.org/netdev/20260724075010.2665758-1-rkannoth@marvell.com/

--
2.43.0

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

end of thread, other threads:[~2026-09-03 19:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 13:10 [PATCH v10 net-next 0/2] octeontx2-pf: mqprio bandwidth offload for NIX TX schedulers Ratheesh Kannoth
2026-08-31 13:10 ` [PATCH v10 net-next 1/2] net/sched: mqprio: pass qdisc handle to offload drivers Ratheesh Kannoth
2026-09-03 19:15   ` [v10,net-next,1/2] " netdev-bot+sashiko
2026-08-31 13:10 ` [PATCH v10 net-next 2/2] octeontx2-pf: add mqprio bandwidth offload for NIX TX schedulers Ratheesh Kannoth
2026-09-01 13:11   ` sashiko-bot
2026-09-03 19:15   ` [v10,net-next,2/2] " netdev-bot+sashiko
2026-09-02  1:39 ` [PATCH v10 net-next 0/2] octeontx2-pf: " Ratheesh Kannoth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox