From: netdev-bot+sashiko@kernel.org
To: omar@blockcast.net
Cc: ap420073@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
shuah@kernel.org, horms@kernel.org, netdev@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
willemb@google.com, dsahern@kernel.org, idosch@nvidia.com
Subject: Re: [PATCH net-next v6 07/12] amt: send the AMT gateway control plane over IPv6
Date: Thu, 03 Dec 2026 04:33:20 +0000 [thread overview]
Message-ID: <179627240022.3146.8274048803110548214@kernel.org> (raw)
In-Reply-To: <20261202043200.286260-8-omar@blockcast.net>
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] The new gateway IPv6 control path never counts transmit
failures that happen after routing.
--
amt: send the AMT gateway control plane over IPv6
This commit lets an AMT gateway send its Discovery, Request and Membership
Update messages with an IPv6 outer header. Discovery and Request are built
on the stack and sent via amt_send_ctrl_v6(). The Membership Update goes
through amt_udp_xmit().
> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index 79702b002d14f..40481b0f9d5ef 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c
[ ... ]
> @@ -824,10 +825,36 @@ static int amt_send_ctrl_v6(struct amt_dev *amt, const struct in6_addr *saddr,
> ip6_dst_hoplimit(dst), 0, sport, dport, false, 0);
> err = 0;
> out:
> - rcu_read_unlock();
> + rcu_read_unlock_bh();
> return err;
> }
>
> +static void amt_send_discovery_v6(struct amt_dev *amt)
> +{
> + struct amt_header_discovery amtd = {
> + .type = AMT_MSG_DISCOVERY,
> + .nonce = amt->nonce,
> + };
> +
> + if (!amt_send_ctrl_v6(amt, &amt->local_ipv6, &amt->discovery_ipv6,
> + amt->gw_port, amt->relay_port,
> + &amtd, sizeof(amtd)))
> + amt_update_gw_status(amt, AMT_STATUS_SENT_DISCOVERY, true);
> +}
> +
> +/* The inner family @v6 sets the P bit, independent of the outer one. */
> +static void amt_send_request_v6(struct amt_dev *amt, bool v6)
> +{
> + struct amt_header_request amtrh = {
> + .type = AMT_MSG_REQUEST,
> + .p = v6,
> + .nonce = amt->nonce,
> + };
> +
> + amt_send_ctrl_v6(amt, &amt->local_ipv6, &amt->remote_ipv6,
> + amt->gw_port, amt->relay_port, &amtrh, sizeof(amtrh));
> +}
[Severity: Medium]
Does the IPv6 Discovery and Request path stop counting tx_errors on
amt->dev when a send fails after routing?
amt_send_ctrl_v6() passes a NULL net_device to udp_tunnel6_xmit_skb() and
then sets err = 0 unconditionally:
udp_tunnel6_xmit_skb(dst, sk, skb, NULL, saddr, daddr, AMT_TOS,
ip6_dst_hoplimit(dst), 0, sport, dport, false, 0);
err = 0;
In ip6tunnel_xmit(), all of the error accounting sits behind a dev check.
That covers both the recursion-limit drop and the ip6_local_out() failure:
include/net/ip6_tunnel.h:ip6tunnel_xmit() {
...
if (unlikely(dev_recursion_level() > IP_TUNNEL_RECURSION_LIMIT)) {
if (dev) {
...
DEV_STATS_INC(dev, tx_errors);
}
...
err = ip6_local_out(skb_dst_dev_net(skb), sk, skb);
if (dev) {
if (unlikely(net_xmit_eval(err)))
pkt_len = -1;
iptunnel_xmit_stats(dev, pkt_len);
}
...
}
So a Discovery or Request that netfilter drops, that fails in the
neighbour or xmit path, or that hits the recursion limit will not be
counted in amt->dev tx_errors.
The IPv4 code paths that these functions replace, amt_send_discovery() and
amt_send_request(), do count these failures:
err = ip_local_out(amt->net, sk, skb);
if (unlikely(net_xmit_eval(err)))
DEV_STATS_INC(amt->dev, tx_errors);
The IPv6 Membership Update path in amt_udp_xmit() passes amt->dev to the
same udp_tunnel6_xmit_skb(). On one device, IPv6 Update failures are
counted but IPv6 Discovery/Request failures are not.
amt_v6() is always false at this commit. Later in the series, "amt: add
netlink attributes for an IPv6 outer transport" sets local_ipv6 from
IFLA_AMT_LOCAL_IP6, which makes this path reachable. The final state of the
series still passes NULL here.
Passing amt->dev directly would also add tx_packets and tx_bytes for
control messages, which the IPv4 control path does not count. Would it
make sense to count tx_errors in amt_send_ctrl_v6() itself, so that it
matches the IPv4 behaviour?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202043200.286260-1-omar%40blockcast.net
next prev parent reply other threads:[~2026-12-03 4:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 4:31 [PATCH net-next v6 00/12] amt: add an IPv6 outer transport Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 01/12] amt: create an AF_INET6 encapsulation socket for an IPv6 outer address Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 02/12] amt: send the Relay Advertisement over IPv6 Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 03/12] amt: key relay tunnels on a union amt_addr endpoint Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:31 ` [PATCH net-next v6 04/12] amt: send the Membership Query over IPv6 Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:31 ` [PATCH net-next v6 05/12] amt: forward multicast data " Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:31 ` [PATCH net-next v6 06/12] amt: size the encapsulation headroom by the outer IP version Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 07/12] amt: send the AMT gateway control plane over IPv6 Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko [this message]
2026-12-02 4:31 ` [PATCH net-next v6 08/12] amt: receive " Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:31 ` [PATCH net-next v6 09/12] amt: add netlink attributes for an IPv6 outer transport Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 10/12] MAINTAINERS: amt: cover the amt headers and selftests Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:32 ` [PATCH net-next v6 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Omar Ramadan
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=179627240022.3146.8274048803110548214@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=omar@blockcast.net \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemb@google.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