[PATCH net-next 2/3] net: sched: tbf: pass all params to offload users

From: David Yang

Date: Sat May 02 2026 - 17:55:03 EST


Drivers might have fine-grained control over queues. Pass all available
params so they can make use of them.

Signed-off-by: David Yang <mmyangfl@xxxxxxxxx>
---
include/net/pkt_cls.h | 6 +++++-
net/sched/sch_tbf.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 3bd08d7f39c1..d73c04e3d919 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -1040,8 +1040,12 @@ enum tc_tbf_command {
};

struct tc_tbf_qopt_offload_replace_params {
+ u32 limit;
+ u32 max_size;
+ s64 buffer;
+ s64 mtu;
struct psched_ratecfg rate;
- u32 max_size;
+ struct psched_ratecfg peak;
struct gnet_stats_queue *qstats;
};

diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 4576111fe075..8a1110d59dec 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -153,8 +153,12 @@ static void tbf_offload_change(struct Qdisc *sch,
qopt.command = TC_TBF_REPLACE;
qopt.handle = sch->handle;
qopt.parent = sch->parent;
- qopt.replace_params.rate = q->rate;
+ qopt.replace_params.limit = q->limit;
qopt.replace_params.max_size = q->max_size;
+ qopt.replace_params.buffer = q->buffer;
+ qopt.replace_params.mtu = q->mtu;
+ qopt.replace_params.rate = q->rate;
+ qopt.replace_params.peak = q->peak;
qopt.replace_params.qstats = &sch->qstats;

dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_TBF, &qopt);
--
2.53.0