From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796573183; b=YeXgxWOpb8Hxzb5xdkcEt33Y5p2IY/0uRdYICDi4U/BnZm7UR2biSHywwFUqCVwQlyyn k3RXIhtMeYJRCpEfHKDBQlk6x16NxsfIFYiSF7DSCLgikaBYPnHnbis65+wwe2n/5yH5q aMz4OMo6TLsz0cZlppehP1fi/noKospMyk90VMJoNZTYuvKgnGixFSwCWbRnAdzcLIvvV wEhJ5KGk2BiK/89c/tRNd9glQMNCAshtcw+fRwMPIaqHES6g+tmAAfUDFh5qow5CQDFyz QoFySkLqZnlpiIVX8gwIfkhpjdjOsZv40f7/Sgj/xLipKM0ZNEV5TlPxiRDqkdrTUCA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796573183; 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=gagKfS9HLAUQyMo1CUG0CwpsRQmHjY1qjVRgNIgDtI4=; b=ShlV/sGbul5B4Wb1bQ4syR3/BOe2FXEO1XCus25TElbUF0YKyL8AVXkS1It5YsTWaBmj +BxP0iSDwXzqqZe6bVp0juuo8JUV9zvGwFUkdkrSzOIIo9xl39vm7r7WUoSR8r8tYeyCe eXOKPG+zQjC46m6Nxs/yYM3N7vtse8kmzcf/dI75SpDK/l0s3AN0nasT6NQg9QdbVqx6V KsLflXjQtihVAfq0Wy3LImbxD6eM0yzUY/+YNaW3ObWPZbmtvJ2jN5sd9cdO7aqTKp/2k 1HSIdh1vkHojofL4Keg36EM1oUoPllFxWFvRLlfHjknEr0D5mJf/Ns01fbvzxyO2gXA== 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=Z7UM0UWG; arc=none smtp.remote-ip=100.103.45.18 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 BC82F606A31F for ; Sun, 6 Dec 2026 16:06:23 +0000 (UTC) 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=Z7UM0UWG Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABA641F0092B; Sun, 6 Dec 2026 16:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796573183; bh=gagKfS9HLAUQyMo1CUG0CwpsRQmHjY1qjVRgNIgDtI4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Z7UM0UWGRQlV8/lwyIxeazXyHGOd+hWpHCIh6WuzhbKhHhp2mXUx/k3DTyEdyw13T vXGvmBi/uQpGuiUP6rWYbnggHEBiy7ILvxgKIRaoRH1kruWYQ8NlGaT8TkqAIDtZnU dxcQjk0xsMPMgQVKAahbW1krt3UOEbNwuKEpkx7WLy5tiz9r5huje3nE9/D2QB1iMU l9g+gJlZz0hkCW7EvWfoFUM/ie34QTm9VPBAvLc+Nohaa3AnbDs7gH+f4yNGAO2Sb0 QfUVbJqig4JOCjng6nI0sc9l5b18Xi7wzhLNYpxwQWbqu6VXh+/1mI8yOK6cBSxhvt oGKeVKIY+M0QQ== Subject: Re: [PATCH net 2/2] net/sched: sch_cake: charge an SCTP GSO packet by its own segments From: netdev-bot+sashiko@kernel.org To: julius@bairaktaris.de Cc: toke@toke.dk, netdev@vger.kernel.org, jhs@mojatatu.com, jiri@resnulli.us, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org Date: Sun, 06 Dec 2026 16:06:22 +0000 Message-ID: <179657318220.3148.12465726452993772879@kernel.org> In-Reply-To: <20261205151201.2705110-3-julius@bairaktaris.de> References: <20261205151201.2705110-3-julius@bairaktaris.de> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] net/sched: cake_overhead() returns 0 for GSO_BY_FRAGS with NULL frag_list -- > diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c > --- a/net/sched/sch_cake.c > +++ b/net/sched/sch_cake.c > @@ -1426,6 +1426,20 @@ static u32 cake_overhead(struct cake_sched_data *q, const struct sk_buff *skb) > if (segs == 1) > return cake_calc_overhead(q, len, off); > > + /* SCTP: each skb on the frag list is one packet, sent behind the > + * headers of the head > + */ > + if (shinfo->gso_size == GSO_BY_FRAGS) { > + const struct sk_buff *frag; > + u32 hdr = skb->len, adjlen = 0; > + > + skb_walk_frags(skb, frag) > + hdr -= frag->len; > + skb_walk_frags(skb, frag) > + adjlen += cake_calc_overhead(q, hdr + frag->len, off); > + return adjlen; > + } > + > /* borrowed from qdisc_pkt_len_segs_init() */ > if (!skb->encapsulation) > hdr_len = skb_transport_offset(skb); [Severity: Medium] If this branch is entered with skb_shinfo(skb)->frag_list == NULL, both skb_walk_frags() loops run zero times and cake_overhead() returns 0. Before this patch the function always went through cake_calc_overhead(), so it could never return 0. gso_size == GSO_BY_FRAGS together with qdisc_pkt_segs() != 1 does not guarantee a frag list, though. A cls_bpf program calling bpf_skb_pull_data(skb, skb->len), or act_pedit through skb_ensure_writable(), ends up in __pskb_pull_tail(). That pulls the frag_list skbs into the head and clears frag_list, but leaves gso_size and the pkt_segs value cached by qdisc_pkt_len_segs_init() alone. With no-split-gso on a device that advertises NETIF_F_GSO_SCTP (veth, lo, ifb, ...), that skb reaches cake_overhead() unsegmented. xen-netback also accepts a guest-supplied gso.size of 0xffff on TCP frames, which never have a frag list there. For header-only frames gso_segs comes out as 0, so even the default split-gso path does not catch it. With adjusted_len == 0: - cake_advance_shaper() charges nothing to the tin, global and failsafe shapers. - cake_dequeue() takes nothing out of flow->deficit or b->tin_deficit. - The mpu, overhead and ATM/PTM handling in cake_calc_overhead(), and the netlen and adjlen statistics, are skipped entirely. Such packets are sent for free and their flow is never made to yield. Could this path be limited to skb_has_frag_list(skb), with anything else charged as a single packet via cake_calc_overhead(q, len, off)? Or do you see a better way to account for how such an skb will actually go out? Either way, cake_overhead() should not be able to return 0 here. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261205151201.2705110-1-julius%40bairaktaris.de