From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 088334F7980; Tue, 13 Oct 2026 12:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791895017; cv=none; b=Bf8N2M9vPyCmnx7mvlU0az48c0DjCZgaTLQxG8odl4o70vweLi2DJ3ymqTqjlD+O2gkPnOG/6A1KVojPcZD+5d1Dvi3xN62tNYAPl7HNH8PvuHE+l0hUSE/uQDzShDJ/OXRWdHnxTBrQnmIxbD5NKB/bQPFCxGRu0y/SWuJDjDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791895017; c=relaxed/simple; bh=bTBMaO64OeG2oMBXSa3vUajqwkcDye4WRKM4yH1TyQI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Na1qp6f7XUU/NV3J2vfNhwbwZ1Jl96JIT5lfSZ83MUb3e9NxWxZ0pV0ZrA6Ynbbng9pImVSk9DPo6sFFFPCbEUy7L35i89AzbNyEYx5KPsnjD88gcquCUnEL0L9xLGAwMXnzbGBZkd+/E8GZ8oDuTKpRr3VNAIM54I5TYHboCZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KTNACaSV; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KTNACaSV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CF921F000FF; Tue, 13 Oct 2026 12:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791895015; bh=KEzFUt1yirqs723j5xFvPNImAkYzLS2dZODs2Rklots=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KTNACaSVl94P35O83K7ipikEQgYx0A+YXIRmj5K/peQ6R0G1KWwFHHWDDPAywimAS jh6M3SHnIR+ETtyi8Mv798/wCmuqKa/bYQKypRrgohWScdLaakQsIR63Uj6ST4FHvI 9swL37PhzXRsMF5RwxzHEx5ieI/nN4R2cZepy1BQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Sashiko (nipa)" , Jamal Hadi Salim , Paolo Abeni , Sasha Levin Subject: [PATCH 6.12 089/497] net/sched: sch_codel: match the no-drop threshold to the packet size Date: Tue, 13 Oct 2026 13:34:16 +0200 Message-ID: <20261013112910.002058137@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112907.864180619@linuxfoundation.org> References: <20261013112907.864180619@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jamal Hadi Salim [ Upstream commit 54518e0e827f4ca9229ae657022c60bf60f5c1bf ] commit 6439461f1618 ("net/sched: sch_codel: clamp default mtu to avoid disabling CoDel") clamped q->params.mtu to [256, 1 << 20]. The value is the CoDel no-drop threshold (codel_impl.h "*backlog <= params->mtu"), so on a link whose maximum transmitted packet size is below 256 the floor extends CoDel's minimum-backlog exemption beyond one packet and delays drop or mark eligibility by several small packets. Keep the upper bound that guards the original overflow (psched_mtu() wrapping to ~2 GiB on a huge-MTU device) but drop the 256 floor, so the threshold tracks the real device packet size. Conditions to recreate the bug: attach a codel qdisc on a link whose MTU plus hard_header_len is below 256 (e.g. a CAN interface). At that MTU the no-drop threshold must equal the device MTU plus its hard-header length; before this patch it was forced to 256. Requires CAP_NET_ADMIN in a user namespace. Fixes: 6439461f1618 ("net/sched: sch_codel: clamp default mtu to avoid disabling CoDel") Reported-by: Sashiko (nipa) Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260819143136.57350-1-jhs@mojatatu.com Signed-off-by: Jamal Hadi Salim Link: https://patch.msgid.link/QDISC-34MS.v1.20260925165535@mojatatu.com.2 Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/sched/sch_codel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_codel.c b/net/sched/sch_codel.c index d6819c4e41982..f12a8f491108e 100644 --- a/net/sched/sch_codel.c +++ b/net/sched/sch_codel.c @@ -203,7 +203,7 @@ static int codel_init(struct Qdisc *sch, struct nlattr *opt, codel_params_init(&q->params); codel_vars_init(&q->vars); codel_stats_init(&q->stats); - q->params.mtu = clamp_t(u32, psched_mtu(qdisc_dev(sch)), 256, 1 << 20); + q->params.mtu = min_t(u32, psched_mtu(qdisc_dev(sch)), 1 << 20); if (opt) { int err = codel_change(sch, opt, extack); -- 2.53.0