Skip to contentSkip to conversation

tc: qdisc: provide tcm_handle and tcm_parent to kernel dump requests

PATCH Applied Eric Dumazet 3 participants 3 messages May 3 – May 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tc: qdisc: provide tcm_handle and tcm_parent to kernel dump requests

linux-7.2 can filter "tc qdisc show ..." on tcm_handle / tcm_parent and reduce dump costs.

Old kernels ignore these values.

Cc Jamal Hadi Salim <[email protected]>
---
 tc/tc_qdisc.c | 3 +++
 1 file changed, 3 insertions(+)
tc/tc_qdisc.c +3 -0
index b3c395b65c2f6b47abbcb6aa37b7dc1f080032e8..7c3e7cb36b4830bca9f2785a58b38d319ec4b563 100644
@@ -408,6 +408,9 @@ static int tc_qdisc_list(int argc, char **argv)
 		argc--; argv++;
 	}
 
+	/* Recent kernels (7.2+) can filter on tcm_parent/tcm_handle */
+	req.t.tcm_parent = filter_parent;
+	req.t.tcm_handle = filter_handle;
 
 	if (d[0]) {
 		req.t.tcm_ifindex = ll_name_to_index(d);
Signature · 1 line
2.54.0.545.g6539524ca2-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Eric Dumazet

linux-7.2 can filter "tc qdisc show ..." on tcm_handle / tcm_parent and reduce dump costs.

Old kernels ignore these values.

Cc Jamal Hadi Salim <[email protected]>

cheers,
jamal

Quoted 21 lines
---
 tc/tc_qdisc.c | 3 +++
 1 file changed, 3 insertions(+)
tc/tc_qdisc.c +3 -1
index b3c395b65c2f6b47abbcb6aa37b7dc1f080032e8..7c3e7cb36b4830bca9f2785a58b38d319ec4b563 100644
@@ -408,6 +408,9 @@ static int tc_qdisc_list(int argc, char **argv)
                argc--; argv++;
        }
 
+       /* Recent kernels (7.2+) can filter on tcm_parent/tcm_handle */
+       req.t.tcm_parent = filter_parent;
+       req.t.tcm_handle = filter_handle;
 
        if (d[0]) {
                req.t.tcm_ifindex = ll_name_to_index(d);
--

2.54.0.545.g6539524ca2-goog

#2 lore raw
In reply to Eric Dumazet
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Quoted 9 lines · On Sun, 3 May 2026 11:51:37 +0000 you wrote:

linux-7.2 can filter "tc qdisc show ..." on tcm_handle / tcm_parent and reduce dump costs.

Old kernels ignore these values.

Cc Jamal Hadi Salim <[email protected]>

[...]

Here is the summary with links:
- [iproute2-next] tc: qdisc: provide tcm_handle and tcm_parent to kernel dump requests

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=0fbce40d480f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html