Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: jhs@mojatatu.com
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
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	[thread overview]
Message-ID: <179543888086.3135.17583427226707859195@kernel.org> (raw)
In-Reply-To: <QDISC-6HS9.v6.r0.20261119070330-1@mojatatu.com>

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

  reply	other threads:[~2026-11-23 13:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 12:40 [PATCH net v6 0/3] net/sched: sch_teql: keep the transmit path's skb geometry and device lifetime intact Jamal Hadi Salim
2026-11-19 12:40 ` [PATCH net v6 1/3] net/sched: sch_teql: unshare the header before writing and fix retry strip Jamal Hadi Salim
2026-11-23 13:01   ` netdev-bot+sashiko [this message]
2026-11-19 12:40 ` [PATCH net v6 2/3] net: neighbour: reinject a parked skb through a headerless output device Jamal Hadi Salim
2026-11-23 13:01   ` netdev-bot+sashiko
2026-11-19 12:40 ` [PATCH net v6 3/3] net/sched: sch_teql: keep skb->dev consistent on the arp-queue path Jamal Hadi Salim
2026-11-23 13:01   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179543888086.3135.17583427226707859195@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sashiko-bot@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=victor@mojatatu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox