From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=cdUBAJBu; arc=pass; dmarc=none Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by mail.toke.dk (Postfix) with ESMTPS id 1A87C188D131 for ; Tue, 20 Oct 2026 20:59:24 +0200 (CEST) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-8a06b436dffso899735b3a.3 for ; Tue, 20 Oct 2026 11:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1792522763; cv=none; d=google.com; s=arc-20260327; b=MUjPbhKIRhx2EaUbdyKY41U9ssPYjsDlmZefOMZeVlPcbZU+2cnMBw2JQMomW/eFEW 0Mk15ZzZyMh5K+MhflK9p/XdPfuRIGcw+I0NodwhiHqjMxpwewyU8zycqURPQEOq8/lN clD69xJE6vYi3oeA1L+hl6PrIbAWTvtY2Pa3OnWrTy1rCi8l58m3X4dzDsEUNEh8XJlo BG3OLCL4aI5Pb6Ek/Ny9r6dHORHCRUNh69LZuLJVn0c86VLUrQkx8/hsK0mcU6QTqIPN afm47xQJIBEShcbGuhHmRiMjPTetRSrZ3v13TIlYDlopMrRq3FWuVC3tUrQdxrJqq3uz qg4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XQ36xuvgD5KgmjQFERxUCvHwC9F6c0TJyW3P0s80Oao=; fh=0UzhehF5NY/hBdAKGOTKZcFitbSFFGO9DB1o5KV2tls=; b=arJh7viXzncl114yE4kCio8tsfXYNpkWqROXcQYir62AUehyPQd0eTx3B7L8JAIqw2 TtCBn3mV+U5ksAV7MMc1Lu+4a/DCjaGGoMDpQ9vpaPT6YYyBtBBSxX9PIAkDKu5aS/Ow pIiGPMMgOPOf4/3kVdcFNZoayu187HNrJ9QZBKQ8yN+lASs7GOXjdPxjG23QuM3hkD/K ICV32Q6bV5I06nwODcr+M7U+k4Ud8QphzLrVusl2i+T1f1umBlYTLsVxVKsxQIhxC3XH e7z2PGSKKrYAXLa+orIwIffWozybAybzcrvZ4j7+t+tOrQimujBVs7KRifFbGJsBVHvF u+AA==; darn=lists.bufferbloat.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu.com; s=google; t=1792522763; x=1793127563; darn=lists.bufferbloat.net; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=XQ36xuvgD5KgmjQFERxUCvHwC9F6c0TJyW3P0s80Oao=; b=cdUBAJBuAZwwEbT6SzynCQrv9BVyuP2HmbkT36HMluIlLZ0+CKCU/3MQV2VSa0bDu2 yZIsjh9SiC6SW9wIniRKebbwcLsfbY/nCVyv2852O5YLOPIkb7C/kipSSa9kWv+NNmc3 jLaWvRz2OZyxZM6R36biOyFBIHwE1/MkxOPOA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792522763; x=1793127563; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=XQ36xuvgD5KgmjQFERxUCvHwC9F6c0TJyW3P0s80Oao=; b=ttU1mH0cNjuq4gxrMS5g2dgyKSBUXxiLvbfYI0TYBp5DomEeVwbie4bBFAQa/GU40f 0R4emELmtZ4oX0M2ErCPuEEg1LAacd046SJgL2vi5oIM446xfKnNtQquA1xTiz/m4+ST 6as22VL0sA3MMUgwz1gpA9tgiaC8JsjcZLzFgG1JxFtcJx9FhcQRSmNyaJC6BErd8f6e xgu9UGVV6VrXp3ibPTkpgpmZoMHLPNHPRxdLJjxmIKb+5yfg8vs/7li7lXYc9RPWRWcW roW7ltzb8Gh05g3Clt2saZcF8NFGptfGjXaTCw837WmM/xb9UoY3JMVTnzdtRPh8hFuQ 7VKg== X-Forwarded-Encrypted: i=1; AKwUvBz9cBrBut7fARSeScIlpVkiW2OhU5bMvW//mo667q+Ammw418GzTrPSDUOgZh2JK1/HRFUO@lists.bufferbloat.net X-Gm-Message-State: AFq9FYIoveNKtn9G8ug9OSNBDPOqOG7B/3IuyHEqMTJqqdj6h3N575on aTkAtSl8uqRYqBUGltbVZdeot2gwbe0sttEuNo4nFAhIg+Qciov6LS/Nho8OmrLR5wJpobMNOdF Vuu0j2YQH682/nVisCGYqVwUHwPxrBVUjnsvtw7OB X-Gm-Gg: AYBFou069ymxK1AX43Hjlq1t8JBdfSThy+Gi365b+9sHPf1DllAlRXA0TZaawnczQ0v 7HOwwm/grzNwdJd5siCBLyAIS9c6qwexJryaMmR/H40HPDehY8H9oaSSJUrMW4kMa7Cp/BHK4CP TdAahYcEHDrNFR8aovctZsxRw/61g4BOFiCTaKQeyy5khjWwl4HQnV1xVt0T4yr+71+taIelZZp ITDEXkJcikwZO1FQlx0ts2JNs83jaf6KPJPYhRkwuRYiFP3P3NvVcKZUOMFq6HcO3wxf1J+bW69 FrTxfgozlxGbObJeE0gOk2bviORfqJqK095Kz7sYq6manzaltEoSJ6bEqHdDlPkjxKQ+lwAiCjH g9yOMcLjJ6jS1oGXT9h9sT9y58KrPTzYk/Q== X-Received: by 2002:a05:6a00:2355:b0:89f:fc75:6d99 with SMTP id d2e1a72fcca58-8a04d355f07mr8431215b3a.60.1792522762595; Tue, 20 Oct 2026 11:59:22 -0700 (PDT) MIME-Version: 1.0 References: <87cxt4tgee.fsf@toke.dk> In-Reply-To: <87cxt4tgee.fsf@toke.dk> From: Jamal Hadi Salim Date: Tue, 20 Oct 2026 14:59:11 -0400 X-Gm-Features: AclHuK-3d7nzgzf0Rb5nk6AUcxBLBETCb8nWT32tf6bWch9HLQ9ILYRccVPhl9c Message-ID: To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Cc: netdev@vger.kernel.org, Jiri Pirko , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Victor Nogueira , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , cake@lists.bufferbloat.net, Sashiko Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: KNTYEZHN7MWL2PRAXAUUZRLGOOLCSYF6 X-Message-ID-Hash: KNTYEZHN7MWL2PRAXAUUZRLGOOLCSYF6 X-MailFrom: jhs@mojatatu.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Subject: [Cake] Re: [PATCH net-next v8 1/4] net/sched: cake: return the classifier result to the caller List-Id: Cake - FQ_codel the next generation Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, Oct 20, 2026 at 1:45=E2=80=AFPM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > > Jamal Hadi Salim writes: > > > The Fix: > > cake runs an optional external classifier from its enqueue path and the= n > > computes the flow hash inside the helper. Have the helper return the > > filter's overrides instead, so the caller owns the flow selection. > > > > This is preparation for the accounting changes that follow. Packet > > classification and flow selection are unchanged. > > > > Reviewed-by: Victor Nogueira > > Signed-off-by: Jamal Hadi Salim > > One nit below, in case you need to respin for other reasons; but I guess > I can live with it as-is, so: > If sashiko comes up with something code-specific that is meaningful, I will send another round and will factor this in. In this and other series i learnt one small lesson that cost a lot of churn= : If sashiko complains about some pre-existing issue, I shouldnt jump in and say "that is sensible, why not add it on the next update" ;-> It then becomes a recursion of sorts, sashiko starts asking for more and more ;-> My temptation is to put as many small related issues as possible in one series instead of sending one at a time and wrestling in the mud with sashiko every week.. cheers, jamal > Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen > > > > --- > > > > v7 -> v8: cake-only. fq_codel_classify() is line-for-line the same as > > fq_pie_classify() and fq_pie is not changed by this series, so fq_codel > > keeps its original classify shape; the fq_codel backlog guard is placed > > inline in sch_fq_codel.c in 0003 instead. (Toke H=C3=B8iland-J=C3=B8rg= ensen, v7 > > review) > > --- > > net/sched/sch_cake.c | 35 ++++++++++++++++++++++------------- > > 1 file changed, 22 insertions(+), 13 deletions(-) > > > > diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c > > index dc93267029e7..6432d10c992e 100644 > > --- a/net/sched/sch_cake.c > > +++ b/net/sched/sch_cake.c > > @@ -1712,18 +1712,24 @@ static struct cake_tin_data *cake_select_tin(st= ruct Qdisc *sch, > > return &qd->tins[tin]; > > } > > > > -static u32 cake_classify(struct Qdisc *sch, struct cake_tin_data **t, > > - struct sk_buff *skb, int flow_mode, int *qerr) > > +/* Run the qdisc's optional external classifier. Returns true when a > > + * terminal TC action consumed the packet, with the reason in *qerr; > > + * otherwise *flow and *host hold the filter's overrides (0 if none). > > + */ > > nit: I still think this comment is superfluous and should just be removed= :/ > > > +static bool cake_tcf_classify(struct Qdisc *sch, struct sk_buff *skb, > > + u16 *flow, u16 *host, int *qerr) > > { > > struct cake_sched_data *q =3D qdisc_priv(sch); > > struct tcf_proto *filter; > > struct tcf_result res; > > - u16 flow =3D 0, host =3D 0; > > int result; > > > > + *flow =3D 0; > > + *host =3D 0; > > + > > filter =3D rcu_dereference_bh(q->filter_list); > > if (!filter) > > - goto hash; > > + return false; > > > > *qerr =3D NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; > > result =3D tcf_classify_qdisc(skb, filter, &res, false); > > @@ -1737,17 +1743,15 @@ static u32 cake_classify(struct Qdisc *sch, str= uct cake_tin_data **t, > > *qerr =3D NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; > > fallthrough; > > case TC_ACT_SHOT: > > - return 0; > > + return true; > > } > > #endif > > if (TC_H_MIN(res.classid) <=3D CAKE_QUEUES) > > - flow =3D TC_H_MIN(res.classid); > > + *flow =3D TC_H_MIN(res.classid); > > if (TC_H_MAJ(res.classid) <=3D (CAKE_QUEUES << 16)) > > - host =3D TC_H_MAJ(res.classid) >> 16; > > + *host =3D TC_H_MAJ(res.classid) >> 16; > > } > > -hash: > > - *t =3D cake_select_tin(sch, skb); > > - return cake_hash(*t, skb, flow_mode, flow, host) + 1; > > + return false; > > } > > > > static void cake_reconfigure(struct Qdisc *sch); > > @@ -1758,20 +1762,25 @@ static s32 cake_enqueue(struct sk_buff *skb, st= ruct Qdisc *sch, > > u32 idx, tin, prev_qlen, prev_backlog, drop_id; > > struct cake_sched_data *q =3D qdisc_priv(sch); > > int len =3D qdisc_pkt_len(skb), ret; > > + u16 flow_override, host_override; > > struct sk_buff *ack =3D NULL; > > ktime_t now =3D ktime_get(); > > struct cake_tin_data *b; > > struct cake_flow *flow; > > bool same_flow =3D false; > > > > - /* choose flow to insert into */ > > - idx =3D cake_classify(sch, &b, skb, q->config->flow_mode, &ret); > > - if (idx =3D=3D 0) { > > + /* Classify first: a terminal TC action consumes the packet. */ > > + if (cake_tcf_classify(sch, skb, &flow_override, &host_override, &= ret)) { > > if (ret & __NET_XMIT_BYPASS) > > qdisc_qstats_drop(sch); > > __qdisc_drop(skb, to_free); > > return ret; > > } > > + > > + /* choose flow to insert into */ > > + b =3D cake_select_tin(sch, skb); > > + idx =3D cake_hash(b, skb, q->config->flow_mode, flow_override, > > + host_override) + 1; > > tin =3D (u32)(b - q->tins); > > idx--; > > flow =3D &b->flows[idx]; > > -- > > 2.43.0