🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
5 messages
5 total messages Started by Dave Seddon Mon, 30 Nov 2026 00:42
[PATCH net 0/3] net/sched: fix the add notification of matchall and cgroup
#24282
Author: Dave Seddon
Date: Mon, 30 Nov 2026 00:42
23 lines
11705 bytes
mall_change() and cls_cgroup_change() do not return the new filter to
their caller, so the notification for a matchall or cgroup add has no
handle and no options. Patches 1 and 2 are the one-line fixes; patch 3
adds two tdc tests that fail without them.

The other classifiers already return the new filter.

Dave Seddon (3):
  net/sched: cls_matchall: return the new filter from mall_change()
  net/sched: cls_cgroup: return the new filter from cls_cgroup_change()
  selftests: tc-testing: check the echoed matchall and cgroup add

 net/sched/cls_cgroup.c                        |  1 +
 net/sched/cls_matchall.c                      |  2 +-
 .../tc-testing/tc-tests/filters/cgroup.json   | 22 +++++++++++++++++++
 .../tc-testing/tc-tests/filters/matchall.json | 22 +++++++++++++++++++
 4 files changed, 46 insertions(+), 1 deletion(-)


base-commit: 28a371228d4eb4857cc31eeb1a0d7d01e9c3ea2f
-- 
2.56.0
[PATCH net 2/3] net/sched: cls_cgroup: return the new filter from cls_cgroup_change()
#24281
Author: Dave Seddon
Date: Mon, 30 Nov 2026 00:42
30 lines
12005 bytes
Return the new filter through *arg, as the other classifiers do.
cls_cgroup_change() never sets it, so the RTM_NEWTFILTER notification
for a cgroup add or replace has handle 0 and no TCA_OPTIONS:

  # tc -echo filter add dev d0 ingress handle 7 pref 1 cgroup action ok
  added filter dev d0 ingress protocol all pref 1 cgroup chain 0

With this patch it carries handle 0x7 and the action.

Fixes: f400923735ec ("pkt_sched: Control group classifier")
Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
---
 net/sched/cls_cgroup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 28701d3916b8..521901d8538c 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -119,6 +119,7 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
 	if (err < 0)
 		goto errout;
 
+	*arg = new;
 	rcu_assign_pointer(tp->root, new);
 	if (head) {
 		tcf_exts_get_net(&head->exts);
-- 
2.56.0
[PATCH net 3/3] selftests: tc-testing: check the echoed matchall and cgroup add
#24283
Author: Dave Seddon
Date: Mon, 30 Nov 2026 00:42
77 lines
13882 bytes
Add a matchall and a cgroup filter with "tc -echo" and check that the
echoed notification carries the filter handle. Both tests fail without
the previous two patches.

Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
---
 .../tc-testing/tc-tests/filters/cgroup.json   | 22 +++++++++++++++++++
 .../tc-testing/tc-tests/filters/matchall.json | 22 +++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/cgroup.json b/tools/testing/selftests/tc-testing/tc-tests/filters/cgroup.json
index 35c9a7dbe1c4..9bbbb6b08e2d 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/filters/cgroup.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/filters/cgroup.json
@@ -1232,5 +1232,27 @@
         "teardown": [
             "$TC qdisc del dev $DEV1 ingress"
         ]
+    },
+    {
+        "id": "b9d4",
+        "name": "Add cgroup filter and check the echoed notification",
+        "category": [
+            "filter",
+            "cgroup"
+        ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
+        "setup": [
+            "$TC qdisc add dev $DUMMY ingress"
+        ],
+        "cmdUnderTest": "bash -c '$TC -echo filter add dev $DUMMY parent ffff: handle 0x7 prio 1 protocol ip cgroup action ok | grep \"cgroup.*handle 0x7\"'",
+        "expExitCode": "0",
+        "verifyCmd": "$TC filter show dev $DUMMY ingress",
+        "matchPattern": "cgroup.*handle 0x7",
+        "matchCount": "1",
+        "teardown": [
+            "$TC qdisc del dev $DUMMY ingress"
+        ]
     }
 ]
diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json b/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json
index 6b3eea401fc8..c4689cb62f3e 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json
@@ -574,5 +574,27 @@
         "teardown": [
             "$TC qdisc del dev $DEV1 clsact"
         ]
+    },
+    {
+        "id": "e3c7",
+        "name": "Add ingress matchall filter and check the echoed notification",
+        "category": [
+            "filter",
+            "matchall"
+        ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
+        "setup": [
+            "$TC qdisc add dev $DUMMY ingress"
+        ],
+        "cmdUnderTest": "bash -c '$TC -echo filter add dev $DUMMY parent ffff: handle 0x7 prio 1 protocol ip matchall action ok | grep \"matchall.*handle 0x7\"'",
+        "expExitCode": "0",
+        "verifyCmd": "$TC filter show dev $DUMMY ingress",
+        "matchPattern": "matchall.*handle 0x7",
+        "matchCount": "1",
+        "teardown": [
+            "$TC qdisc del dev $DUMMY ingress"
+        ]
     }
 ]
-- 
2.56.0
Re: [PATCH net 0/3] net/sched: fix the add notification of matchall and cgroup
#24284
Author: netdev-bot+sinfo
Date: Mon, 30 Nov 2026 00:48
19 lines
8643 bytes
Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
Re: [PATCH net 0/3] net/sched: fix the add notification of matchall and cgroup
#24302
Author: dave seddon
Date: Mon, 30 Nov 2026 01:00
39 lines
13328 bytes
G'day,

I discovered these by porting parts of tc to Go. I was running tc
commands in a namespace, capturing the netlink traffic with nlmon, and
comparing the output against my port, which highlighted that these
notifications were missing handles and options.

Thanks,
Dave

On Sun, Nov 29, 2026 at 4:49 PM <netdev-bot+sinfo@kernel.org> wrote:
>
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
>  - How the issue was discovered, e.g. hit in production, hit during
>    development, syzbot report, manual code inspection, LLM or static
>    analysis tool scan.
>
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account.
>
> *IMPORTANT*: If you do repost (for other reasons) - please include
> the relevant info in the cover letter or commit messages.
> --
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.



-- 
Regards,
Dave Seddon
+1 415 857 5102
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads