Article View: linux.kernel.netdev
Article #7099Re: [PATCH net-next v8 1/4] net/sched: cake: return the classifier result to the caller
From: netdev-bot+sashiko
Date: Sat, 24 Oct 2026 17:30
Date: Sat, 24 Oct 2026 17:30
84 lines
10815 bytes
10815 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] Two new comments in net/sched/sch_cake.c say the TC action has
consumed the packet when the helper returns true.
--
net/sched: cake: return the classifier result to the caller
This commit splits the external classifier out of cake_classify() into a
new helper, cake_tcf_classify(). The helper now returns the filter's
flow and host overrides, and cake_enqueue() does the tin selection and
flow hashing itself. It is described as preparation for later
accounting changes, with no change to classification behaviour.
> diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
> index dc93267029e70..6432d10c992e5 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(struct 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).
> + */
[Severity: Low]
This isn't a bug, but is "consumed the packet" accurate here?
For TC_ACT_SHOT the action does not take ownership of the skb.
tcf_gact_act() in net/sched/act_gact.c only updates its stats and
returns the verdict:
if (action == TC_ACT_SHOT)
tcf_action_inc_drop_qstats(&gact->common);
tcf_lastuse_update(&gact->tcf_tm);
return action;
Even so, cake_tcf_classify() returns true for it. The
STOLEN/QUEUED/TRAP cases work the same way, because the qdisc still
drops its own reference.
[ ... ]
> @@ -1758,20 +1762,25 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
[ ... ]
> - /* choose flow to insert into */
> - idx = cake_classify(sch, &b, skb, q->config->flow_mode, &ret);
> - if (idx == 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;
> }
[Severity: Low]
This comment has the same wording. The very next lines still have to
free the skb with __qdisc_drop(skb, to_free), so the action has not
consumed it.
A true return really means "do not enqueue, the caller must drop the
skb". Could both comments say that instead?
If a later caller trusted the current wording, it could skip the free
and leak the skb. Both comments are unchanged at the end of the
series.
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/QDISC-BA27.v8.r0.20261020063241%40mojatatu.com
Technical Details
Message-ID:
<179286303840.3134.16646155289449371572@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351432-linux-kernel-netdev=dewy.ruReferences:
<QDISC-BA27.v8.r0.20261020063241-1@mojatatu.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351432-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v8 1/4] net/sched: cake: return the classifier result to the caller Date: Sat, 24 Oct 2026 17:30:38 +0000 Organization: Usenet Network Message-ID: <179286303840.3134.16646155289449371572@kernel.org> References: <QDISC-BA27.v8.r0.20261020063241-1@mojatatu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="819007"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:2neEPi0jDncUCUep6LOrY11QxnQ= sha256:o4S6RtWEKpp22GbRtqFlEUBbDWVVqGD39BWfcai15oY= sha1:ufCTBry7oA9YASzZ13RSgajI3Y4= sha256:fGkD8xehsa7UHH1OSJmo7tUZ7Os3PBpwhnU6ReYeBP8= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 2607911164C; Sat, 24 Oct 2026 20:31:03 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.739 X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UC0U0AC1WEDw; Sat, 24 Oct 2026 20:30:56 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-351432-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 6A639111672; Sat, 24 Oct 2026 20:30:47 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 52C2533A68; Sat, 24 Oct 2026 17:30:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792863041; b=z+t2AV1mqMDrJ4xjLRnydtx/WS/84dGD6m/s0Ni3wqe00TrhvI8NN4mVazAjhwrkohR8 ij9Ms6FENdzsNockCgmS4NMxHU8a/Fx1DEaa5xx+KRIthNL4WvndKGDYnbTGELtoOSldp pburOwye+DtWZZ1jR7z1Wi1UET7RuJg4/3Ka1sod6o18BWX8Z6/dpeQcHg4f7p8KkfzTW B6lLJTKceaIVmqd2onT8t7+2vLFPDdYx7IePxjFpEPJzjd7cM1czhWQJMRR1kFqQDe4lu TCItCUSRIcqli2DsSV3tqKiKFXuBt+zGgvG9aSulkONtdZ/aObYJ+g6RiyRx7LioLwg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792863041; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=vbiGdGifJI25J1ktQA8m+IDo+99FoGcOOd/GahePnVk=; b=xTHxUBntRTvJAsQoOmBg/07oWuuOAlZmxNVK0b0sXltNvvI4seDrw+ajFIxWXnBN/Av0 6J9WInF387GGwuz5o27MmNZ0rqR3C8FuAEGEjKewsGbPfytpegMcZaLU8hKxpc381ZPk3 g37cDuE31n5gyOOHvB9st4/E9oJpm4S2giKzhUZVpX6y4X7v34qjXak0cNw78LmHiMH0y RX2rVuzHOEexQArhpqJuGy2d4GwfqE8FnQ0Mpu1O9T5MF9ayHPfOAGlKBFA5g2b4wAIK1 E1k08aMxICDUv/i0NCGWVudS8t28ZM0ldGVvAW/hURsr8Q1BC9DCC1RaI+vsKnwoSjA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ao5w8EAR; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2535B606A322; Sat, 24 Oct 2026 17:30:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ao5w8EAR X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792863040; b=f/nErdhikphotoLoLf/n1kukUohUn76gdvcKJRTwnQt8sKS7KkaPvaxaQHwuYVFTfI/E b3K8++zBloMM7fUhXz/s/1tNvf5BSsEFuvEs9LGudgwg0dtcBbqXRaKCh8+rNyiXY1ym3 uaUCTN7hopnOKj0wO3cu269reHZ4gNh89iP0fDREu46XNhfqxENXaQUbN2hGnGC7+kSvf kueT30tDP8/g7Im0CTVgpvShp2r0o8XsxWiAOj192QaU2go1CnRM33wz0utuKY+pMGWFQ HBQHZ5a5h2YwlgNMRD1ZY+BC3vooc87MgeISoDrOtgqhmqmHgbX/lefyQPuxv3WQW/A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792863040; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=vbiGdGifJI25J1ktQA8m+IDo+99FoGcOOd/GahePnVk=; b=1SPDPVU+LiUJZ6CvmGY3c522pWZclCtKw3wxwfuYA/ekmrF9B079hS4BczvnXGJQR61X atyoc9Si8nJ3plcLBN01Aj3L0in52M9UFXGIYFxwFdCnMPSz50p/s0Fis/xe60TekW7Er 55E0voTCEbY+EImSF2uFThq47diFfoSSx3Xe7qZo3tY3OMtxGvRpMO8Bh6lqrewGYBKtJ jjIVMFWeH2GOv4NkcCxgTT5VhHOU0GjLoeoi0vl7Ahtke/UifRgB3uyXkTmtfEmuu8Q+r SoTocEO1wLjrDY6T1IWIuD1Lx5KCrIHXERkuz3iQ5CEcG++mr7KrteGWkYwH9z/Qqfg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ao5w8EAR; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4036606A31A for <netdev@vger.kernel.org>; Sat, 24 Oct 2026 17:30:39 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D47A61F01825; Sat, 24 Oct 2026 17:30:38 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792863039; bh=vbiGdGifJI25J1ktQA8m+IDo+99FoGcOOd/GahePnVk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Ao5w8EARMiK8PjS357+cXcFCPdpXfUABVDKXS4o+9gdFvaKlLJ+rB/EXaN59/PTJj jnz5z5gN1ZuGH3Hp0ry/19n2J1O8obJXoKe+A+s65nqJw1AMgjNJ0fxWCkbAprgnk2 pHEU3EZESkhZAF1Pj/Xm6R9zGrboRmf0vjowmac6MVLCawF23RRG4LEFxLIehemCBI tMwtGXz0nf3xt9pjxumZluu21HDzdovDIJgcHMEvPH5890tdGHcWWQFMYpY2/x15YJ PMq+TrByGwEUOW92WNNEfPXEhCwGVDQYH9EEx0U2hv3tERPlpJaFUOSn6vEMY6NdW6 ecAcCPz8c0viQ== X-Cc: netdev@vger.kernel.org, jiri@resnulli.us, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, victor@mojatatu.com, toke@toke.dk, bjorn@kernel.org, sashiko-bot@kernel.org X-In-Reply-To: <QDISC-BA27.v8.r0.20261020063241-1@mojatatu.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list