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=1796272401; b=yI4c+S6rHvZY1eIuF6E1cP1CaO0jCLOLXugfyyJo2b0jn/yOpQ++9C9XdOtmEFUIOFnb drxXzMnGmoigrsJNRcTz2Nx7Kvc7ZlqFqHNu62FBNt0W3giCsOHWuzdWtDo9g9JIj7mUS PjdgCYMp0g0XNT1ogP4qqJfbMpuCN6K8WTjCoAZenkirI98oYTZst8a04YXVBUa6Tqn0o uYRcrtMoe/0le7rVyV0MQLgwjTLOHpNfr9nyMJHIYQ8NYB4HW6qiOzMrdFGDuPizZVPxS I7Zg27JjhywJQipETj/Wa08VZxFPpAdfre/xU4jkQl9RsgH5+WOlZaYVUp7csH0RJCQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796272401; 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=TdwXQjvijuoHz17ZUDzVPw/4SKV4Qkh2tNOXXHZcNrQ=; b=mSSahwvnKHBeEKRJjOFkEn3pCv2CPqFhk2hAOJIe9PbqpTZnTPCYhxj0DmJDCFQ0JjyS GKqFCzq+5ueTc+vvknaJhU84LmBYsAcbzBO3HwtgG8odlkkaz6XG7JhGhotyWVN98IAbn ITIjy3TuoCSS+plWhi+5Uhizx8KZoBjMOe4d1DE3mBUk7N4H9rb7YK4KGf3G40qIJz5ov sVOQ6k5U6c+Hn+X6+OUlHeEYPCyjriUbWjG2FY9YO/CbrMikHaSEzXBXWiBCfASDyehXf PufmzIlRXdvAZFYaYQIpW8qYINjBIjE5W1W/AnSgYGfaVIiwookIQGNyP7lS+tDfGjw== 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=PfdQ6YdB; 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 BC151606A6A4; Thu, 3 Dec 2026 04:33:21 +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=PfdQ6YdB Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D5671F00926; Thu, 3 Dec 2026 04:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796272401; bh=TdwXQjvijuoHz17ZUDzVPw/4SKV4Qkh2tNOXXHZcNrQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=PfdQ6YdBV3VzGEJvbORIv5r5AdpyrM2GmgL81oOIWB9lZIiLJTayyIsb+inNKl0WX 8o8KJ1EVbz9CYVRhsemI51CbXDB86eiPams3vigA3aa5j1UO6Xqyh0OzMRUnQIcYm8 HRhpwnim1exf+E8ZDY2NxBqK3xWoTHigbS295+fpYRnCMuZuopD90kAaAB8yFtaKPN sTlf8dCrpyHtkAULjRSFTqr0Hv0nHM1wY+0UfhJPzXbk3+9hpGxaEtqeQw+2kPDVHp e4zqLRt4FFCHTR1k/fgSurIyU2oNfWzV6qO2IJvzVnV+eaFWJ5zd1EzdY0++RFxsMl MokF036WQCfmQ== Subject: Re: [PATCH net-next v6 07/12] amt: send the AMT gateway control plane over IPv6 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 Date: Thu, 03 Dec 2026 04:33:20 +0000 Message-ID: <179627240022.3146.8274048803110548214@kernel.org> In-Reply-To: <20261202043200.286260-8-omar@blockcast.net> References: <20261202043200.286260-8-omar@blockcast.net> 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] 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