๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23857

Re: [PATCH net-next v13 4/4] net/sched: cake: hash before segmenting and reject an overlong split

#23857
From: netdev-bot+sashiko
Date: Sat, 28 Nov 2026 12:08
69 lines
11007 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] The subject "hash before segmenting" and the "The Fix:" paragraph
  ("Key extraction must run on the unsegmented skb -- skb_gso_segment()โ€ฆ

--

net/sched: cake: hash before segmenting and reject an overlong split

This patch splits cake_hash() into a side-effect-free cake_hash_keys()
and a cake_hash_resolve() that runs only after admission. It moves the
split-GSO segmentation ahead of the resolution and refuses a split whose
segment sum would push the backlog past U32_MAX, or which an ancestor
cannot absorb, tagging every dropped segment with QDISC_DROP_OVERLIMIT.
The flow mode is now read once with READ_ONCE().

Link: https://lore.kernel.org/netdev/179231933068.3135.80340792633077986@kernel.org/
Link: https://lore.kernel.org/netdev/179269577270.3135.16072065138845192450@kernel.org/

> net/sched: cake: hash before segmenting and reject an overlong split
>
> The Fix: with CAKE_FLAG_SPLIT_GSO, cake computes the flow keys and then
> splits a GSO skb into segments it accounts individually. Key extraction
> must run on the unsegmented skb -- skb_gso_segment() can rewrite
> encapsulated headers to the inner ones -- and resolution must wait until
> admission, since it commits set-associative state a later rejection would
> leave mutated.

[Severity: Low]
Is "hash before segmenting" accurate as a description of what this
patch changes? Before this patch, cake_enqueue() already hashed the
unsegmented skb, ahead of the split block:

    b = cake_select_tin(sch, skb);
    idx = cake_hash(b, skb, q->config->flow_mode, flow_override,
                    host_override) + 1;
    ...
    if (qdisc_pkt_segs(skb) > 1 && q->config->rate_flags & CAKE_FLAG_SPLIT_GSO) {
            ...
            segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);

The earlier patches in the series ("return the classifier result to the
caller" and "use a dedicated split-GSO list iterator") keep this order.
So keys were always taken from the unsegmented skb.

The change to hashing goes the other way. The stateful set-associative
part (q->tags[], host tags, bulk counters, now cake_hash_resolve()) moves
after skb_gso_segment() and after the overlimit / ancestor refusal that
this same patch adds.

In the old code, the only rejection that came after the state-committing
cake_hash() was a skb_gso_segment() failure. The message doesn't mention
that case.

The body sentence "move the split-GSO path ahead of the resolution" is
accurate. The subject and the "The Fix:" paragraph, though, could make a
reader such as a stable backporter think cake used to hash segmented
skbs with rewritten inner headers.

Would a subject such as "resolve the flow only after the split is
admitted" describe the change more precisely?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/QDISC-BA27.v13.r0.20261127065026%40mojatatu.com
Technical Details
Message-ID: <179586772803.3135.8375156947766643480@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373109-linux-kernel-netdev=dewy.ru
References: <QDISC-BA27.v13.r0.20261127065026-4@mojatatu.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373109-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v13 4/4] net/sched: cake: hash before segmenting
 and reject an overlong split
Date: Sat, 28 Nov 2026 12:08:48 +0000
Organization: Usenet Network
Message-ID: <179586772803.3135.8375156947766643480@kernel.org>
References: <QDISC-BA27.v13.r0.20261127065026-4@mojatatu.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="943406"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:29grbJJgpHzygbhx34DjPI39/mo= sha256:U71RS6+2Dr7CsLPsYtPIb0kOmgcNAXiWbUk5X1m8RCY=
	sha1:aDqY2H0Yj2YKWOZ3cewNQ5T639Q= sha256:+p9LnoeQje1cXpRbAQAFDEBmLk7am0OrrWUljJuX0hA=
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 ABCC2125F72; Sat, 28 Nov 2026 15:09:06 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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, URIBL_BLOCKED=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 scNbKwMARb7H;
	Sat, 28 Nov 2026 15:09:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373109-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 98DE3125F70; Sat, 28 Nov 2026 15:08:54 +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 8D44B26C4D; Sat, 28 Nov 2026 12:08:50 +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=1795867730;
	b=bLieDVBbtky3QYWmMIp7mvHb2LPljbw+7r0z1U7TWDB0HeenWLRgvYNI/jQU4BczP9Zj
	 vNiR7BFXPT+DzKXqFpyUQYl+BUpeZ9vkWZaspgMwytUh5YPhXrUiM9viySM/1MiJf6fIJ
	 KmwVziD3z6HkbqOOcGNq8Q654aZiioSHaRUmdfDm+UqO6Z9iAteDH1BzRlY8kmnoQvQrn
	 wjuOQ9G2dVDlqZEEoywu3w9fXw5XYT8ez8lQCRpChfYdoROXVyUDFqEaDtSy42F7vgE/N
	 yICRRhRCNLgn2IlFythcxT2jRIf/GkkQmjgmtB0iGQ8TiX7vuOUaqNBQiqMRupq9mQg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795867730;
	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=X/lxz0ydkcA9N33IeiEx3NeLFg/SvTNdWuUSkKTVRgk=;
	b=QIGsTanR8HneOANACnvx0tXAhmw6ulbJanpjUY929SFGADcmm8gxqvDATZBvaVJu6EGf
	 osS1IYw95ZVmGznv9QH6HkNFZv2aYtkx9b6ykQZHQaTWgvYQgKDvZiGp7UPwwhKQP2Gp2
	 GgK6tW4fMnRr7qlXkMtX+3jOTOp9MVXYmFgHpcsX3lmKJLd+XVhwCP5Uns0TxQylF5KoT
	 l6TRPLskNhDpj0mrB/lxxpnh+Ahu7T7jcKFxo/7Qyb0wpKxjARMW/xTZBXroNWLtqQ1ZB
	 Z7w8aaDHPl6t5FU1NS/qfMnwdZNKzeURhnbqYvNjrysm4g0Vyz8ZXp+UvtI3Td/BNTg==
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=QdWYyGba;
	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 6420B606A324;
	Sat, 28 Nov 2026 12:08:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QdWYyGba
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=1795867729;
	b=Tbi1dlkOEtgvQi5gCzYjb662H4RmtT6OeuG61nOusgiWRIIc0+ocJ+/cT0qplU6vn5yV
	 JU60/mQkoud3Hm/qvurgXdHP060cjHypf8vxfu2vd/TPEfJn9I2f0aBB6OdrTzNL8pb4M
	 9RIwvTKYE/gnbnO7mP1ZNjDias6gW8khmMKvehEATgFu5U9sQTnG46JrhBBncTB3sCMpW
	 5H6Z22MrynRY9+zjsi5nhtZqmLMHk1KsfY2fqB+DWtpuBDW4mEYlPJrq7mfqa2mkCeLvI
	 vcC+UMPHZh3jA5meqvWr/2hOiswL5xcPZ1O9+cyw/GfiumRNXBqSlUPBkLhHcfOlQrA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795867729;
	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=X/lxz0ydkcA9N33IeiEx3NeLFg/SvTNdWuUSkKTVRgk=;
	b=NFD/081FvYGSqAJNq/pZlA9VyLgJqpZY5iMVsAzKqsv0jBZskcOhU82kFT+DOYK3cgS/
	 SWEz3GXa70e6NRxayaLFz17f5aV4iUTQE/Wwp8uAaaRKuGCVrpVUBqnNg8uircNdup9xG
	 C1PArwQMJx5TbqhHI+BFttbyxiO9TV8/0aKIjFH9P7b7X+a53JMTshy1nRCVBnu/4fXDY
	 ClJAIi/HN8NgeigPtxob+gET2p2e3qQQ4kPpGTjTZ4VkhhMRjXPIvwWEzWY3nY+XYlV+x
	 U+ekTEdk2RzR4hK60XMbbpR6OohoQ2kEN8wQw4j+Lkwpkz24WXd++YdU1jSzL36Z5dA==
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=QdWYyGba;
	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 81A77606A326
	for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 12:08:49 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 777EE1F00926;
	Sat, 28 Nov 2026 12:08:48 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795867729;
	bh=X/lxz0ydkcA9N33IeiEx3NeLFg/SvTNdWuUSkKTVRgk=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=QdWYyGba4nXTAnKbuhovu5SMyDPOf9RdxEhiYPzBmHngaQfMmUkJsfd6U8OpU1Vhg
	 FwRBlt3MuIQrJR9eRbfq64JNmxRbnl7ERnTl+eAZZNJGLu4fbaWbWhLCu2YPa/UcnX
	 sQqDbjQlsRCMDSdGGI1VwYrgC0Xrpxbrh1dN4Kh0vyw+oIZBfLrNI6379R9YF+vMWi
	 lTaBYkvLAxSSN1SPkyoH0bavCbaGZBHMq/zeP1O7d389HnkdWpQvQ3zXhfXQFp+dPd
	 nst8nqPtUjp0mVxTMx/rzZ7GmdcAU1d1tEQ6ncjTGJ8lxdyEMH4X1qRt5XOpGHVqNS
	 NOEruS2Mzc/mw==
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, jiri@resnulli.us,
 stephen@networkplumber.org, vinicius.gomes@intel.com, toke@toke.dk,
 victor@mojatatu.com, bjorn@kernel.org, sashiko-bot@kernel.org
X-In-Reply-To: <QDISC-BA27.v13.r0.20261127065026-4@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