[PATCH v10 net-next 1/2] net/sched: mqprio: pass qdisc handle to offload drivers
From: Ratheesh Kannoth
Date: Mon Aug 31 2026 - 09:26:00 EST
Extend struct tc_mqprio_qopt_offload with the owning qdisc handle and
fill it from mqprio_enable_offload() and mqprio_disable_offload().
Offload drivers need the handle to tell apart mqprio setup, teardown,
and tc qdisc replace when they track committed configuration state.
Signed-off-by: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>
---
include/net/pkt_sched.h | 1 +
net/sched/sch_mqprio.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 90d3e7943b19..9f8694ecd436 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -165,6 +165,7 @@ struct tc_mqprio_caps {
struct tc_mqprio_qopt_offload {
/* struct tc_mqprio_qopt must always be the first element */
struct tc_mqprio_qopt qopt;
+ u32 handle;
struct netlink_ext_ack *extack;
u16 mode;
u16 shaper;
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
index 6ced7008ef5c..adc1393f84ea 100644
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -39,6 +39,7 @@ static int mqprio_enable_offload(struct Qdisc *sch,
struct net_device *dev = qdisc_dev(sch);
struct tc_mqprio_qopt_offload mqprio = {
.qopt = *qopt,
+ .handle = sch->handle,
.extack = extack,
};
int err, i;
@@ -79,7 +80,9 @@ static int mqprio_enable_offload(struct Qdisc *sch,
static void mqprio_disable_offload(struct Qdisc *sch)
{
- struct tc_mqprio_qopt_offload mqprio = { { 0 } };
+ struct tc_mqprio_qopt_offload mqprio = {
+ .handle = sch->handle,
+ };
struct mqprio_sched *priv = qdisc_priv(sch);
struct net_device *dev = qdisc_dev(sch);
--
2.43.0