Re: [PATCH net v2] net/sched: dualpi2: clear stale classification on filter miss
From: Jamal Hadi Salim
Date: Wed Jun 10 2026 - 06:13:20 EST
On Tue, Jun 9, 2026 at 7:26 PM Samuel Moelius
<sam.moelius@xxxxxxxxxxxxxxx> wrote:
>
> DualPI2 leaves previous classification state attached to an skb when
> filter classification returns no match. The enqueue path can then act
> on stale state from an earlier classification attempt.
>
> A filter miss should fall back to the default path without reusing old
> per-packet classification data.
>
> Clear the classification result when the filter lookup does not match.
>
Why not just initialize at the top of the function? Something like this:
--- a/net/sched/sch_dualpi2.c
+++ b/net/sched/sch_dualpi2.c
@@ -346,6 +346,8 @@ static int dualpi2_skb_classify(struct
dualpi2_sched_data *q,
struct tcf_proto *fl;
int result;
+ cb->classified = DUALPI2_C_CLASSIC;
Then you can even remove check around if (!fl)
- if (!fl) {
- cb->classified = DUALPI2_C_CLASSIC;
+ if (!fl)
return NET_XMIT_SUCCESS;
- }
Would improve readability.
cheers,
jamal