Thread (6 messages) flat view 6 messages, 2 authors, 2d ago
WARM2d

[PATCH v10 net-next 1/2] net/sched: mqprio: pass qdisc handle to offload drivers

From: Ratheesh Kannoth <rkannoth@marvell.com>
Date: 2026-08-31 13:11:07
Also in: bpf, lkml
Subsystem: networking [general], tc subsystem, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jamal Hadi Salim, Jiri Pirko, Linus Torvalds

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@marvell.com>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help