🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20994

Re: [PATCH net v6 1/3] net/sched: sch_teql: unshare the header before writing and fix retry strip

#20994
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 13:01
116 lines
11820 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 new comment in __teql_resolve() ("Each attempt starts from
  the network header, as neigh_resolve_output() does.") and the matching…

--

net/sched: sch_teql: unshare the header before writing and fix retry strip

This patch calls skb_cow_head() in __teql_resolve() before the neighbour
can write or queue the skb, so a cloned header is not corrupted. It also
pulls the skb to its network header before resolving. On retry,
teql_master_xmit() now pulls back only the link header length the slave
added.

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..44730a5e89178 100644
> --- a/net/sched/sch_teql.c
> +++ b/net/sched/sch_teql.c

[ ... ]

> @@ -292,6 +292,18 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res,
>  		n = mn;
>  	}
>  
> +	/* Unshare the head before the neighbour can write or queue it. */
> +	if (skb_cow_head(skb, LL_RESERVED_SPACE(dev)) < 0) {
> +		err = -ENOMEM;
> +		goto out;
> +	}
> +
> +	/* Each attempt starts from the network header, as
> +	 * neigh_resolve_output() does.
> +	 */
> +	if (skb_network_offset(skb) > 0)
> +		__skb_pull(skb, skb_network_offset(skb));
> +
>  	if (neigh_event_send(n, skb_res) == 0) {

[Severity: Low]
Is this comment accurate? The commit message makes the same claim:

  "Start every attempt from the network header, as neigh_resolve_output()
  does"

The pull only runs when three things hold: the slave has header_ops, the
skb has a dst, and the neighbour lookup succeeds. teql_resolve() still
returns early, before it calls __teql_resolve():

net/sched/sch_teql.c:teql_resolve() {
    ...
	if (!dev->header_ops || !dst)
		return 0;
    ...
}

Also, __teql_resolve() returns -ENOENT or PTR_ERR(mn) before it reaches
the pull.

Take an skb that has a dst and skb_network_offset() > 0. One example is
the tc-mirred redirect from a physical device's clsact egress that the
commit message mentions.

If a slave without header_ops is tried first, it transmits the skb with
the incoming link-layer bytes still in front of the network header.

If a header_ops slave was tried earlier in the same round and failed or
was busy, that same slave gets the skb starting at the network header.
So what goes on the wire still depends on slave order.

The comparison with neigh_resolve_output() is also not exact. That
function only pulls once the neighbour has resolved:

net/core/neighbour.c:neigh_resolve_output() {
	if (!neigh_event_send(neigh, skb)) {
		...
		do {
			__skb_pull(skb, skb_network_offset(skb));
    ...
}

Here the pull runs before neigh_event_send(), whatever that returns. On
the -EAGAIN and queued paths the leading bytes are dropped while *hlen
stays 0.

The retry comment in teql_master_xmit() is accurate about the header
that was pushed:

	/* Pull back only the header this slave added. */
	if (hlen > 0)
		__skb_pull(skb, hlen);

However, the link-layer bytes that the earlier pull in __teql_resolve()
removed are never restored. So the skb does not go back to the state it
was in before the attempt, and neither comment says so.

The old unconditional retry pull already behaved in this order-dependent
way, so this is only about the wording. Could the comments and the commit
message be changed to describe what the code actually does?

> @@ -299,9 +311,12 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res,

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/QDISC-6HS9.v6.r0.20261119070330%40mojatatu.com
Technical Details
Message-ID: <179543888086.3135.17583427226707859195@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369371-linux-kernel-netdev=dewy.ru
References: <QDISC-6HS9.v6.r0.20261119070330-1@mojatatu.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369371-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v6 1/3] net/sched: sch_teql: unshare the header before
 writing and fix retry strip
Date: Mon, 23 Nov 2026 13:01:20 +0000
Organization: Usenet Network
Message-ID: <179543888086.3135.17583427226707859195@kernel.org>
References: <QDISC-6HS9.v6.r0.20261119070330-1@mojatatu.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3882713"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:xoi0HfrOOqj1gPif1/gbvPqGn0s= sha256:tTbv4O7vpC13Kp9j2ZJaR/3TtxIhfoDsaDwSjUGhU2w=
	sha1:8bLG95Kh5izNtMjldpdrI00Lik0= sha256:g/06KgL4NyiEWUL6qT9YuY+v+yg5BFo08FHojsdhaPk=
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 957E6125DAD; Mon, 23 Nov 2026 16:01:52 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 fm1Jbo1b9W6Y;
	Mon, 23 Nov 2026 16:01:44 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369371-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 2FE99125DB0; Mon, 23 Nov 2026 16:01:25 +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 BFD752DE27; Mon, 23 Nov 2026 13:01:23 +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=1795438883;
	b=t/VieiBeN3LnRcz96hGNeWCruHm0Z0pTSQ3H3yj6CPQs3LMGYm+yV7givbXB0CwUphL3
	 DHqkNAwWM+YseeqxTMt8NaVITeK94Z37mnPJszGJV+EriMY5rz0yfBnqPx/VNHoH64Jux
	 Hcq5EFVyOXHWUqobGaWB15+7cNOpwfU8xg8uuLMfzlFyoJ0szNZIejIcvF8L9FJkxAYAW
	 018gvrmB0tobApGIK4Tn5DmczQL8mDkqpYGQvJm7ZOaWZNgHaXzeV/IWaAhwJvw2OZejE
	 kHziyy6AazLT0E4clGXzEzrJFfDNUWu5qTUxdSLsuEuereLa8COGWKVMQC35y4Rf+hA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795438883;
	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=eslbTwCS3DOxu5OkG+CmAJ6KLSRI8ONcb53rubmd8D4=;
	b=g9Ls/hA8VNuknkp1TkPJoRkUKChkMCkvEWtv8DTFCt1b0hgs2Eou55fVnx7Wzbhw+7sR
	 pck239nR+eweCquUeT2UwMQ9Y6sugSnOAJ6O2hz02KbPW6MbeO07m3zhso+Mforvfv1H1
	 dLFJw/KV2lJI/k85VPpi1wPugFeW6YW3E1nJ1tpKv0cpYoUL3d8O+YfOk3+3Hc566vQG7
	 GXwvzsTjh0ctUoVL9QA6uHu8bHVPkO14/D+TBU5FVDFfJXbm66tWrGyFM5CRl7//HIL0U
	 9Bn3pzxq3rTqxLNuWfU4lCvAUJ8wifWJW6E6XbxIQc+3OUGUwnxEkeyOTaL7nRLvjaw==
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=ivys1QOH;
	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 80517606A331;
	Mon, 23 Nov 2026 13:01:23 +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=ivys1QOH
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=1795438882;
	b=u0pk6nR8lmoritb2eKF/uJ+a45E+bjJAy61iksq7ZjnTwDBdU0flCassrE8telibbPMk
	 L5kc9V/rfVRPq8EIUU8S7c8oNoFK8cegUQYnW8f12dNBmTfEA0O+5PvLsjyYdG/k3S/eo
	 2LBJV0SjMwcjHEogO4CtD0wa6lzp/ym9dEFfmBjkYcnqh9r1VWl7wZVlLkBs9VIDD+CrO
	 c9krmAlMGoaTb9s5Ov0JEYwjOSUmtPZbEjGW6EqRraOWRa5GYyoNjFUhNUH3f1HNGVbTg
	 pT/9fENx7+ZCqStQ2pLwWUD/wmgC99tzZKJ3qrhFmujToEMEJ9d8r+99pf5aoKTLY/Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795438882;
	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=eslbTwCS3DOxu5OkG+CmAJ6KLSRI8ONcb53rubmd8D4=;
	b=5nuYJ3hS7je5q1VQB50olUgArKvu+kRL+ojXSPXQe2mb/F03xU6JCThkRuzK2/e4KwJw
	 siGZj1oiOs6SUm8vs8sqxEJJKm8aRRdeUGHMgvwXuPheglvJCtWwvuaoaGjmgfVM6Ss6E
	 kDAenBYmujN1K4pKuPUkXw6SWpab0Wvg58CoTpMlsT1dUALYzlIznb83b/0lS16OTVNdL
	 ahmvRo5rn+B7bNKpUupN0524pz5mr9b39b9D8ImpNZBVTe7Z7RxmLROoNPyzXYXC2vgz7
	 NUwrbCVg0/OUSN0IefMQ89UrY76o58ljU2w0MxnGS6M94XV67fVrofh/rJUQW+IcaWg==
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=ivys1QOH;
	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 A02B0606A31E;
	Mon, 23 Nov 2026 13:01:22 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 546901F000E0;
	Mon, 23 Nov 2026 13:01:21 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795438881;
	bh=eslbTwCS3DOxu5OkG+CmAJ6KLSRI8ONcb53rubmd8D4=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=ivys1QOH3tQj2lONDekX2iV3dojbsWZsnOsDbtJ7DY57xT3h2WF5+Q82ZAKuJgczD
	 8vrAEXW3LLvPCkwvth+lKnpV1vgDG0e7RtcjQFLx9NMhlDsRVN2OdkyQwbiCYcMH7a
	 Uoxdbkq5tlJBY4w3bX00bXH0EOT/JtmkHmNXOKRpoSRLYRgXNYisdewpeza//+DxuT
	 ev/5I/Yy9GVILZcumqAknoa58gGtFzQjFit9R5vFc0Y3HHhWz+JKhIlQ0M7whN8cri
	 nty8CaMd0mFsiTm1emb4Gfv9jbpQfdpDJlQAmAs3fycR163FZSTs7+znC87WzTJ/iR
	 y13+5yK9q2Dkg==
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.v6.r0.20261119070330-1@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