Article View: linux.kernel.netdev
Article #19102Re: [PATCH net v5 1/3] net/sched: sch_teql: unshare the header before writing and fix retry strip
From: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 10:38
Date: Thu, 19 Nov 2026 10:38
147 lines
13472 bytes
13472 bytes
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] This patch changes how teql_master_xmit()
(net/sched/sch_teql.c) retries when an skb has a dst attached and…
--
net/sched: sch_teql: unshare the header before writing and fix retry strip
This patch calls skb_cow_head() in __teql_resolve() before the slave
neighbour can write or queue the skb, so a cloned header is not
corrupted. It also changes the retry path in teql_master_xmit(). The
retry now pulls back only the bytes the current slave pushed, instead of
pulling to the network header, so AF_PACKET frames without a dst keep
their own link header.
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/QDISC-6HS9.v4.r0.20261111094338-1%40mojatatu.com
Link: https://lore.kernel.org/netdev/20260824115928.4099988-1-victor@mojatatu.com/
Link: https://lore.kernel.org/netdev/20261110101908.2e64e8e9@kernel.org/
> diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
> index dc21cd9704a25..626dc001ec231 100644
> --- a/net/sched/sch_teql.c
> +++ b/net/sched/sch_teql.c
[ ... ]
> if (neigh_event_send(n, skb_res) == 0) {
> + int off = skb_network_offset(skb);
> char haddr[MAX_ADDR_LEN];
>
> neigh_ha_snapshot(haddr, n, dev);
> if (dev_hard_header(skb, dev, ntohs(skb_protocol(skb, false)),
> haddr, NULL, skb->len) < 0)
> err = -EINVAL;
> + /* The bytes prepended above skb->data, pulled back on retry. */
> + *hlen = skb_network_offset(skb) - off;
> } else {
> err = (skb_res == NULL) ? -EAGAIN : 1;
> }
[ ... ]
> @@ -408,8 +421,10 @@ static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
> nores = 1;
> break;
> }
> + /* Pull back only the header this slave added. */
> + if (hlen > 0)
> + __skb_pull(skb, hlen);
> skb->dev = dev;
> - __skb_pull(skb, skb_network_offset(skb));
> } while ((q = rcu_dereference(NEXT_SLAVE(q))) != start);
[Severity: Medium]
What happens on retry when the skb has a dst and already carries
link-layer bytes in front of its network header?
The old retry reset skb->data to the network header. That matches what
neigh_resolve_output() and neigh_connected_output() do before building
a header:
net/core/neighbour.c:neigh_resolve_output() {
...
do {
__skb_pull(skb, skb_network_offset(skb));
seq = read_seqbegin(&neigh->ha_lock);
err = dev_hard_header(skb, dev, ntohs(skb->protocol),
neigh->ha, NULL, skb->len);
...
}
__teql_resolve() pushes the slave header at skb->data without pulling
to the network header first, and hlen only counts that push. So with
the new retry, any L2 bytes already present when teql_master_xmit() was
entered stay in place across every retry.
One path that still delivers such an skb, even with the rest of the
series applied, is nft fwd ... neigh on a netdev egress chain.
nft_fwd_validate() allows NF_NETDEV_EGRESS, and nft_fwd_neigh_eval()
neither pulls to the network header nor drops the dst:
net/netfilter/nft_fwd_netdev.c:nft_fwd_neigh_eval() {
...
skb->dev = dev;
skb_clear_tstamp(skb);
nf_dev_xmit_recursion_inc();
neigh_xmit(neigh_table, dev, addr, skb);
...
}
teql0 has no header_ops, so arp_constructor() installs
neigh_direct_output() for it:
nft_fwd_neigh_eval()
neigh_xmit()
neigh_direct_output()
dev_queue_xmit(teql0)
teql_master_xmit()
__teql_resolve()
The skb arrives with eth0's header in front of the IP header (network
offset 14) and eth0's route dst still attached. Because dst->dev !=
slave, __teql_resolve() looks up the slave's neighbour. From there:
If the slave neighbour is resolved, dev_hard_header() pushes 14 bytes
and hlen = 14. If the trylock then fails or the slave returns
NETDEV_TX_BUSY, the retry pulls only 14 bytes. The next slave sends
slave header + eth0 header + IP, while the old code pulled 28 bytes
and sent a single header.
If the slave neighbour is unresolved (-EAGAIN, nores), hlen = 0 and
nothing is pulled. The next slave in the same pass gets the double
header, while the old code pulled the stale 14 bytes.
At this commit alone there is a second trigger: an arp_queue skb
drained back into teql0 after neigh_resolve_output() wrote an eth0
header. Here skb->dev = slave is only set inside case 0, so the parked
skb still has skb->dev pointing at teql0.
That second trigger is closed later in the series. "net/sched: sch_teql:
keep skb->dev consistent on the arp-queue path" sets skb->dev = slave
before teql_resolve(). "net: neighbour: reinject a parked skb through a
headerless output device" only reverts skb->dev to a headerless
n1->dev, whose output is neigh_direct_output(), so no header is written
in that case. The nft fwd path above is not affected by either change.
The AF_PACKET case in the commit message only seems to need the
dst == NULL early return in teql_resolve(), where hlen is always 0.
Would it work to keep pulling to the network header for skbs with a
dst? Another option would be to pull to the network header in
__teql_resolve() before dev_hard_header(), as neigh_resolve_output()
does.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/QDISC-6HS9.v5.r0.20261116052927%40mojatatu.com
Technical Details
Message-ID:
<179508471843.3136.7272721682226577890@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366944-linux-kernel-netdev=dewy.ruReferences:
<QDISC-6HS9.v5.r0.20261116052927-1@mojatatu.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366944-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v5 1/3] net/sched: sch_teql: unshare the header before writing and fix retry strip Date: Thu, 19 Nov 2026 10:38:38 +0000 Organization: Usenet Network Message-ID: <179508471843.3136.7272721682226577890@kernel.org> References: <QDISC-6HS9.v5.r0.20261116052927-1@mojatatu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2850365"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:jRNR9jEbsUM8QGuG4b0tHBVE2c8= sha256:/8RPLznDhBpU2zzAWnsfotF8nz22wPE2gfymVgtiwuM= sha1:pIKHwBUCXdCWwyLoOXFzF/JNNCA= sha256:SoxWC4Z1azerPZO+aDfjveXu6lqtdzTzlYl30OWax1M= 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 8E3E9115580; Thu, 19 Nov 2026 13:39:08 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[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] 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 4Yts_rM1bLhq; Thu, 19 Nov 2026 13:38:56 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-366944-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 021651155BF; Thu, 19 Nov 2026 13:38:46 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 1B119726720; Thu, 19 Nov 2026 10:38:46 +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=1795084725; b=EJp43mzAZtXlzdxZrQDxQVpdAC/BwdLYyIt3N+z8NM/ihn8qKsJUeluKOENiTU9TQNi2 m0zA3qsu47th72cILMPhIpJ6DgHwc0QhIPMsR+B9RfQ+sVmTfdtA9qruF1MlTW6MVhKzU bZUER8YRWLZ61ixCTn4po2UObMDU/9hrYSaMkpsB/SQ2nQ5BHytVO8rwelvICrYZtMOvp U4f4gpw2p/sHrG3peU7GKrsqUAC8XlRpnqdND1MSDPaGiBgq+IO+P7RwcZ9X9iO9ab11u q4dlEPerANNHC58bMzwtIpGQ19xlnlUjE52jwT+osC9Y2F10HO+eQEDEVFXPEjSUNCg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795084725; 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=hjEdvfgVocBOV4KmDkOIrforBlOl/M8Z8/JkOXSBrAs=; b=1LDfBjV4Yy5Erf8oEAtXM5yFPMjtO37XP6vzEvv7eH8UZvp54aQGElU40lewL7utXKE8 IwyIFWFAeGBvkpr+yygt96MPuo5mapu+SyD7rsTUPDMsA6F6d8nt9Yid1CIWP2srd/LOB TU38sU6yA2rKEBXm59O5k8yVAmMJ79rHBGavQHPGuN+/Lhcw+mgp9mZLi3EUz5ZEE0TKW 8ygEdkgqPSTSIY2kzyoVIibIAZ0bZBd7UxNuL6T9byhLkQoYkTplhGeZivMINgA7uqQpR midGg49pQwZ4z9l9Wk9iU6iCHzzdd4PQP964L4zQKVExLmY943vKKTyqM5bTk9t591g== 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=Hf57v2F+; 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 A699A60A2606; Thu, 19 Nov 2026 10:38:45 +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=Hf57v2F+ 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=1795084719; b=j7YiZ8eAh8dixRkTi/LCDr2Whdei+fjRnZr9k0ENmZwa7xNrS41bFa/1kF47eqsmK2jx kC5dPzvZlfOqO30tFw7ANY7EbtyMpa7WjOYso64zodnCfj8V3vyr5KVCZ9jQarjCH5KyP /hZBhWNUBABZXCmnUEWKuFKNjrIUbPCpzdocrKx/tXhwDSQYXFd6msVCBsc4ByMTwD8zq QbnlEpvQq7Wzz6N8HXlcIoqMS7V66ZgqvVz2AGDQbD6ReXudyim4aMsyoXHWIMVBSOBs7 tH3ZjfG1IFIwaC80o8Xjr7eV7QkggYw0uUMpl1QIINhK16sqJfI/ouqSSnSku33a1nQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795084719; 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=hjEdvfgVocBOV4KmDkOIrforBlOl/M8Z8/JkOXSBrAs=; b=uV7OjQQfbZqm4Kg2IPFCx8DJlDhZ4zlSRt1wXMPbmTdHHpu0J8CLn6dmMf5G0s9/ge7o 88srv/5P2FG5EbVLoWXzKyVjGyMCH2SIg5U8PQJm0+5yO3c4MLmdEZUzxN3jbe0f2GYnT 5zq0uazbz886SVhm3tM4qJ9KoNScgTrzUFT6L6fbmsmzDk/+1bDKne5GTV0Kq3AMkwi4r hGGtvKN6mEKkSqOJ3fZDn5xcC/co5j1RuKWMNnVf8YAM5akyT/09w4NKGj4v01N7hWhh8 vx1pRPxP7Xb0c4v9FVt0AMVND+uczQ3Q8NPRVq0/IwQjrZPVTbEeWMXVkJmiCKis6/g== 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=Hf57v2F+; 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 C7B56606A324; Thu, 19 Nov 2026 10:38:39 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8FC41F000C5; Thu, 19 Nov 2026 10:38:38 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795084719; bh=hjEdvfgVocBOV4KmDkOIrforBlOl/M8Z8/JkOXSBrAs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Hf57v2F+ibzubEBZpj90Q0MsmF+VIHuKYRsvNjDDPsgYDRZKgkNvhYJtidRlZFRIY 1iWhCaaY2w8yqrLaKkUpltW+JjZzoUIV+uJkOPUszLtvyNI/JNvaD1TQONtVFnJbP9 9ANZFH4fjf5/Y/GU2W3OhE3AoKIo4lITazhv4GKd81CHnXxIDD/jYZp1KSEkRGHRUb oGj7xXegMiIidUo9j1eSx89lhQpmo4SJk6Qg1TdCN53gA+1wzcwTdZ6keCM1u9V0um Pwb0xE80tFM74Y+G2qvnivLdjoGzFgWk2cW2RUsrv/oZ8oPs8iRRq3Q+oxyTjoR44r fluVph+6r3kFg== X-Cc: netdev@vger.kernel.org, victor@mojatatu.com, jiri@resnulli.us, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, stable@vger.kernel.org, sashiko-bot@kernel.org X-In-Reply-To: <QDISC-6HS9.v5.r0.20261116052927-1@mojatatu.com> X-sashiko-severity: Medium 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