🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24740

[PATCH net-next v15 0/4] net/sched: cap the accounted backlog before it can wrap

#24740
From: Jamal Hadi Salim
Date: Mon, 30 Nov 2026 18:38
86 lines
14680 bytes
This series bounds the shared qdisc backlog (sch->qstats.backlog) so that
it cannot wrap mod 2^32.  A qdisc with per-CPU statistics books into
cpu_qstats and is outside this guard (stats-only).

  1/4  cake: classifier refactor: cake_tcf_classify() returns its result
       to the caller.
  2/4  cake: use a dedicated split-GSO list iterator.
  3/4  the fix: drop at enqueue once the stored backlog cannot represent
       the packet's accounted length, saturate the fixed-removal helpers,
       and keep the tree reconciliation modular.  The ancestor-room check
       is shared by tbf, dualpi2, netem and cake.
  4/4  cake: split cake_hash() into key extraction (on the unsegmented
       skb) and resolution (after admission), move the split-GSO path
       ahead of the resolution, and refuse a split an ancestor cannot
       absorb.

For the sashikos: net-next, no Fixes: (the aggregate wrap predates every
touched qdisc).

1/4 and 2/4 are unchanged from v14 and carry no revision-history block.

Changes in v15:
  - the offload exemption is the pre-existing TCQ_F_OFFLOADED flag again;
    the per-qdisc latch added in v14 is dropped, and the flag is cleared
    only on a failed setup.  The exemption is deliberately coarse: an
    exact latch would have to follow the driver's own writes to
    qstats.backlog, and the offload stats path still makes those.
  - the ancestor-room walk crosses a NOPARENT child, so a parent that
    mirrors the child still sees the growth.
  - taprio rebuilds its counters from the children plus the packets
    parked on the qdisc, instead of overwriting with the child sum; the
    resync runs in ->dump() so the reported qlen and backlog are one
    sample.
  - the default taprio children are stamped NOPARENT, so their net change
    is mirrored once.
  - netem's corrupt-GSO split now applies the same ancestor-room check as
    tbf and dualpi2.
  - the split sites reserve two copies of the growth, because a netem
    duplicate books its clone a second time.
  - the remaining 32-bit net changes are cast to s64 where the tree
    reconciliation takes them.
  - 3/4 and 4/4 carry the v14 -> v15 block; 1/4 and 2/4 are unchanged.


Jamal Hadi Salim (4):
  net/sched: cake: return the classifier result to the caller
  net/sched: cake: use a dedicated split-GSO list iterator
  net/sched: cap the accounted backlog before it can wrap
  net/sched: cake: hash before segmenting and reject an overlong split

 include/net/pkt_sched.h   |   1 -
 include/net/sch_generic.h |  48 +++++++++-
 net/sched/sch_api.c       |  62 +++++++++++--
 net/sched/sch_cake.c      | 191 +++++++++++++++++++++++++++-----------
 net/sched/sch_cbs.c       |   6 ++
 net/sched/sch_choke.c     |   6 ++
 net/sched/sch_codel.c     |  16 ++--
 net/sched/sch_drr.c       |   6 ++
 net/sched/sch_dualpi2.c   |  22 ++++-
 net/sched/sch_etf.c       |   6 ++
 net/sched/sch_ets.c       |   6 ++
 net/sched/sch_fifo.c      |  15 ++-
 net/sched/sch_fq.c        |   6 ++
 net/sched/sch_fq_codel.c  |  11 ++-
 net/sched/sch_fq_pie.c    |   3 +-
 net/sched/sch_generic.c   |   9 ++
 net/sched/sch_gred.c      |   9 ++
 net/sched/sch_hfsc.c      |   6 ++
 net/sched/sch_hhf.c       |  23 ++++-
 net/sched/sch_htb.c       |  16 +++-
 net/sched/sch_netem.c     |  56 ++++++++++-
 net/sched/sch_pie.c       |   3 +-
 net/sched/sch_plug.c      |   3 +-
 net/sched/sch_prio.c      |   6 ++
 net/sched/sch_qfq.c       |   6 ++
 net/sched/sch_red.c       |  10 ++
 net/sched/sch_sfb.c       |   6 ++
 net/sched/sch_sfq.c       |   8 +-
 net/sched/sch_skbprio.c   |  19 +++-
 net/sched/sch_taprio.c    | 150 ++++++++++++++++++++++++++----
 net/sched/sch_tbf.c       |  29 +++++-
 31 files changed, 651 insertions(+), 113 deletions(-)

-- 
2.43.0
Technical Details
Message-ID: <20261130183825.229246-1-jhs@mojatatu.com>
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-374387-linux-kernel-netdev=dewy.ru

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-374387-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v15 0/4] net/sched: cap the accounted backlog before it can wrap
Date: Mon, 30 Nov 2026 13:38:21 -0500
Organization: Usenet Network
Message-ID: <20261130183825.229246-1-jhs@mojatatu.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1502605"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:RC/heixrTG83oqZHK2RDQ/MRefo= sha256:9PRbUGHRKYZmZAGIOCcrOnkDa/ueF8V6pBlxHo5YOzw=
	sha1:kU2NRJ2J8Jou2txzcZEtJcAJV/A= sha256:wgSsXd2JnkiVr80I+/Oqn19kdb92wbnld4KtfucWZO4=
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 B9A13126006; Mon, 30 Nov 2026 21:38:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	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 (1024-bit key)
	header.d=mojatatu.com
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 qekm_vz4Yey7;
	Mon, 30 Nov 2026 21:38:52 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374387-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mojatatu.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id D6E84126003; Mon, 30 Nov 2026 21:38:43 +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 8F0A925943; Mon, 30 Nov 2026 18:38: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=1796063921;
	b=LiHPw9Wu4TX2KPgMzX6QIvPuFKufr8YpvnTyN0g+2BSAIZRgMQ7FZxqhZ9Tiuwkvd9Pp
	 bXTKDUWL92NhMXh45Gk1LB5LkdNKHl2YWQ993BjgCyt1P4HGVeO9SJhEebVoESK4Hiu9H
	 abV9aNtLME2cwxSp8TFtC3fgeQdICHe4PwIQCwcawzUoU1t9JIZ7QL0M6xXmrkIy9yMTb
	 DcHlEU0vpT6t3OrrDd3KYuOhWe9GXfYyxNUv2iXMyQYdmwQgp9J2naZc7CkoMDNkMq4zT
	 rk7IqtJ7nAeRRlsrfi0Dk6/Lszn6k4F/v2qwRNNR9gzoO4n1DKQEiLx8t+Bxu9ryXSg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796063921;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=cYL3alsiJgz3BxwRZ5aiuRyDNgKF6G7D7I2yJedR4iw=;
	b=araXHdK6+S4BEPe4GI1sT0wXKjvq02jm8JnogfNOetE48iqu8SJHHIjf+px4DKUE/VFu
	 MF3AadKnc2eokz+ry0P7tBLpqgpSuIcNTLk3jKgH/CAJnB4F/w+Zv/oxhkpe9xV0IC+wd
	 1/Cjv6kTSkSl05GVFwyIN+vnKHkIHq39K5yeGlz9KWD00qb7d/mjR/xb0Z5BJ5t8p4ZkK
	 kN1uIxxqntbOcVAxdeF9ZasRRbAJnqsJbqknMETL+Cnl9U/ZVFmOnOH6LzAVPBB8drN/2
	 GbZt/qpzAse0cNXIF8HuzN1vbQjfjzYnzCjl/JC+xWyQsjCnbkdFIn4wvZkjQEyVQ0g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=TR3aX4Fg;
	dmarc=none header.from=mojatatu.com;
	spf=none smtp.mailfrom=mojatatu.com;
	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 67392606A32E;
	Mon, 30 Nov 2026 18:38:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=TR3aX4Fg
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.175
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796063920;
	b=v10HsPEu79E+psnpmepcwvCHjtfanFJ9gVkEQE+wPXcDs2GPMbKcrxHiBKezDpcy3j5x
	 S1/B/2wLsz4GiziBdWGj87SPLCTqhouIO+a9vKYUaNpBcOwFiCVEB2yfmwRSEhAXib7U4
	 Ugn0WhJdINoWs9WErlSxfLjcGLF9uCrAiC10E41busNpVGYYTaCLS7pOzxYL54oBCH9gU
	 Z7Ctj3lXOAqMwemZxq4uKnIoRc6j+SgBF05OqPIj2sNa0MFtX42aXx2UZCyuEK1VEzcAS
	 MkJuop4gwpOhaUHe6TILMgiVMmb916zGNAqf8kV0mdNl62RxQ1DLzLot84IwoSNdXmA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796063920;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-Id:X-Mailer:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=cYL3alsiJgz3BxwRZ5aiuRyDNgKF6G7D7I2yJedR4iw=;
	b=rknzzg39+7Y3N7DjWZcLDKrZS46/HF0svmbPTEaxi3WHqCDzh3ZdPfmAstqo6T6j6BOG
	 o1gLshzVNkEDGqCw0EcXBGSCzHLPqRg8zM36WZBrpYKLIjtE9NFfs7hk/7q1mGaeaZFXE
	 8ouHxWHZrJH5HWAMRAHS3szlmhNMu/etJp2aneWiBEH0Pq/zAF/L8B2OUcXxw3kgE1aMR
	 glZg+NtTKP0LhNzVkvjxq6W992fgHeJD8dY+GDwjuV4Ddk/nIlK9vWCy7pYwZez8G5niK
	 xm/WKtqb2q619jy873So0EJxJLAscABsrgsipa8CR10HSDnLNCMWp/qC6kz0RTyTxGg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=mojatatu.com;
	spf=none smtp.mailfrom=mojatatu.com;
	dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=TR3aX4Fg;
	arc=none smtp.remote-ip=209.85.222.175
X-Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18119606A320
	for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 18:38:39 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 18119606A320
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com
X-Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-949680e6d83so996936585a.3
        for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 10:38:39 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=mojatatu.com; s=google; t=1796063919; x=1796668719; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=cYL3alsiJgz3BxwRZ5aiuRyDNgKF6G7D7I2yJedR4iw=;
        b=TR3aX4Fga2XW+pZPY4OEykC7NenlsmgASKu9KX3IEJnPVvg0TzDsT4BQ1zx74MeIf5
         8EEMPPN9kUgZGednPiWEA6mtVtvFrQ7VL45AouaA5swRJM4n0lAUzDe6pjaoSjGD14Lm
         O9l4uumaeaJXxIhusF1WeBXxyV5k8EpQptJeA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796063919; x=1796668719;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=cYL3alsiJgz3BxwRZ5aiuRyDNgKF6G7D7I2yJedR4iw=;
        b=TX6LmivSW7nMu5H5XEP1GqerYPIuri4iEcahnockYs2T6CnOnU5qGlqE1KEI/vuqf5
         gXTi0zA/FjmtAhlQmnXHnCuVZQvOdjsCXFsTI3yHZ/aqC1Xudcpk/WEBYfAE5lw3mx/x
         6pR3YJ9kzG3p/0YQPDyBq7pyxWXYGKvC3UirJohG+pg0a+oK1PWCONleFdpLugqnHv7b
         5qw7WKFtaSuIns2BN5aIn5qwlPZLnSu27r5ECFISPIm9j4rfIjS++5+115IN3jWLzCgZ
         yU9G52tFSGjv2QKn4Xnl0yxYHPy18Aqa7UYHEIxLbC6d9R4hQFKUaGjh/tsnN9WnI3C4
         GJkw==
X-Gm-Message-State: APuU4Z+0vDQ3BHkBH8hNpP1SHQ5ui/2QU5bOD0rt5fr6MRddkWj1vEWr
	kHH52cj3eoBFCxx1uO2xcM4C/yPCUdLeEfk0YH+3EKQ9hQeuVS7s6SoaPh5IeAdRdw0+PwG3SWV
	/oLRGkQ==
X-Gm-Gg: AZFdTZfYJeC4vrmJF0cfgIfxJYJlIN605vDhHjZeyuWAgyo1eiNo16+I9iNch/xJ2Vt
	acF2vNt5gTdwsIw3TPmbWy9SbyMREe3pvlwpToP5mzChtRwAKtg00Dfn5uN/qn/Qe3f70oOJM1P
	YelLfLHR7cLmnHpel1Rs5zfgIm//QoMR3PhHZ3W4CtqQ1HXv1FW/jadO/2o4WhAJjCDWmm9XcrW
	kYBnIw4OCHjCRinnnWdji2CGuQAJDlGbDrxZ1eONO0ol8IljqPFKkSkYDyxbRiQ7RT/uKzuTrKs
	5u8XyIodLj6Tl71t4RGyvAhQ0RB4Y20+dojSiMCTHm1zHQNLdGT1PUUA3SLHl3OThyLMso1YAKW
	V4Fqx80kLSjNFMvxXJTXl+7jV3gXD3HGRk4lwm2g5j8Gg1RCvngBdkF5aM4VV/UG2hR9RixSD9a
	onvbuncfe0k0qA5HFaoUEZAw5lGoxiQvlXci3AG9a5drTw/NylXwu+Dt9E7TrtsH9kbeR36SKiI
	wUIUkgPrxEZHlBgVnGV0WWQZPDcUS1bZB0cwXPSMieowPOK7EtGR+NsT6GcJ1COT1ZtsuKWuOPA
	vRwk7pEYt0EKax9pDrCqcXVmPXX5lc3CHtP24D0JybLDMFw5o94jcAiYwTKnJvTYSGBhAxs/865
	tmyn+O0vPk6QYQ1n3DFqGahgACfAaBoq17PueIHlybFk7EsyUCtCYOG1PVtCTamr7xw==
X-Received: by 2002:a05:620a:1a07:b0:949:77c5:a57f with SMTP id af79cd13be357-949ba9e01b6mr6479548685a.47.1796063918818;
        Mon, 30 Nov 2026 10:38:38 -0800 (PST)
X-Received: from majuu.waya ([184.147.180.207])
        by smtp.gmail.com with ESMTPSA id af79cd13be357-949ca846322sm2444717785a.34.2026.11.30.10.38.37
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 30 Nov 2026 10:38:38 -0800 (PST)
X-Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>,
	Jiri Pirko <jiri@resnulli.us>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Toke Høiland-Jørgensen <toke@toke.dk>,
	cake@lists.bufferbloat.net,
	Victor Nogueira <victor@mojatatu.com>,
	Björn Töpel <bjorn@kernel.org>,
	Sashiko <sashiko-bot@kernel.org>
X-Mailer: git-send-email 2.34.1
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