Re: [PATCH v11 net-next] octeontx2-pf: add mqprio bandwidth offload for NIX TX schedulers

From: Ratheesh Kannoth

Date: Wed Sep 02 2026 - 22:32:51 EST


On 2026-09-02 at 07:25:00, Ratheesh Kannoth (rkannoth@xxxxxxxxxxx) wrote:
> Add TC_SETUP_QDISC_MQPRIO offload for channel-mode mqprio with
> TC_MQPRIO_SHAPER_BW_RATE. Program per-queue MDQ CIR/PIR through the
> NIX TX scheduler mailbox for each non-QoS transmit queue. When offload
> is active, allocate one SMQ per such queue, parent every MDQ under
> TL4[0], and map each traffic class min/max rate to the queue(s) in that
> class.
>
> Rebuild the TX scheduler hierarchy by bouncing the netdev through
> ndo_stop() and ndo_open() on mqprio add, replace, and delete. Cache
> the active rates and restore MDQ shapers from otx2_mqprio_up() during
> ndo_open(); log and continue if restoration fails so a normal open is
> not blocked.
>
> Track mqprio configuration in mq_offload_snap snapshots (TC layout and
> rates). On tc qdisc replace, stage the new configuration while keeping
> the previous snapshot for rollback: failed setup restores the old
> snapshot, successful graft is recorded through TC_ROOT_GRAFT, and
> teardown of the replaced qdisc instance commits the staged snapshot
> without tearing down the live offload.
>
> Reject offload unless the interface is running and the device advertises
> CIR+PIR support. Reject per-TC rates for traffic classes mapped to more
> than one queue, SDP rep ports, and concurrent PFC or XDP use. Block
> ethtool channel count changes while mqprio bandwidth offload is active.
>
> Add a ratelimited AF debug message when validating TX scheduler queue
> ownership to aid mqprio hierarchy setup failures.
>
> Signed-off-by: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>

Will address sashiko reviews in v12.

pw-bot: changes-requested