netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: kuniyu@google.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, dsahern@kernel.org, idosch@nvidia.com,
	horms@kernel.org, steffen.klassert@secunet.com,
	herbert@gondor.apana.org.au, kuni1840@gmail.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH v1 net-next 1/7] ipmr: Call ->dellink() to remove DVMRP tunnel device.
Date: Wed, 09 Sep 2026 01:58:39 +0000	[thread overview]
Message-ID: <178891911928.219967.7580029616723211694@kernel.org> (raw)
In-Reply-To: <20260907225846.3787676-2-kuniyu@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 0 · Low: 1

- [Low] The commit message of "ipmr: Call ->dellink() to remove DVMRP
  tunnel device." states the rationale inverted: "This is fine because…

--

ipmr: Call ->dellink() to remove DVMRP tunnel device.

The patch converts the two places in net/ipv4/ipmr.c that removed DVMRP
tunnel devices with unregister_netdevice()/unregister_netdevice_queue()
into calls to the device's ->dellink() followed by unregistration, in
preparation for moving ip_tunnel_del() from ip_tunnel_uninit() to
ip_tunnel_dellink().

> ipmr.c uses unregister_netdevice() to remove DVMRP tunnel devices
> created in ipmr_new_tunnel().
>
> This is fine because currently ipip_link_ops.dellink() is no-op
> for non-fallback tunnel devices.

[Severity: Low]
Is this sentence inverted?  ipip_link_ops sets .dellink = ip_tunnel_dellink,
and that function looks like this:

net/ipv4/ip_tunnel.c:ip_tunnel_dellink() {
	itn = net_generic(tunnel->net, tunnel->ip_tnl_net_id);

	if (itn->fb_tunnel_dev != dev) {
		ip_tunnel_del(itn, netdev_priv(dev));
		unregister_netdevice_queue(dev, head);
	}
}

So it does real work (unhash plus queue unregister) for non-fallback
devices, and is a no-op only for the fallback device (itn->fb_tunnel_dev).

The dvmrp%d devices ipmr creates go through tunl0's
ndo_tunnel_ctl(SIOCADDTUNNEL) -> ip_tunnel_create -> ip_tunnel_add, so
they are non-fallback and hashed in itn->tunnels[].

Isn't the reason the current unregister_netdevice() calls in ipmr.c are
harmless instead that ip_tunnel_uninit(), which runs as ndo_uninit from
the unregister path, also calls ip_tunnel_del()?

net/ipv4/ip_tunnel.c:ip_tunnel_uninit() {
	itn = net_generic(net, tunnel->ip_tnl_net_id);
	ip_tunnel_del(itn, netdev_priv(dev));
	...
}

ip_tunnel_del() uses hlist_del_init_rcu(), so calling it from both
->dellink() and ndo_uninit is idempotent and this conversion is
behaviour-preserving today.

Could the message be reworded to cite ip_tunnel_uninit() rather than
describing ->dellink() as a no-op for non-fallback devices?  As written it
suggests this preparatory patch has no interaction with ipmr, which is the
opposite of what the follow-up "ip_tunnel: Centralise ip_tunnel_del() to
ip_tunnel_dellink()." depends on.  The code change itself looks fine, and
dev->rtnl_link_ops is always set for ioctl-created tunnels by
__ip_tunnel_create(), so the new ->dellink() dereferences in
ipmr_new_tunnel() and vif_delete() cannot be NULL.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260907225846.3787676-1-kuniyu%40google.com

  reply	other threads:[~2026-09-09  1:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 22:56 [PATCH v1 net-next 0/7] ip_tunnel: Support per-netns device unregistration Kuniyuki Iwashima
2026-09-07 22:56 ` [PATCH v1 net-next 1/7] ipmr: Call ->dellink() to remove DVMRP tunnel device Kuniyuki Iwashima
2026-09-09  1:58   ` netdev-bot+sashiko [this message]
2026-09-09  4:13     ` Kuniyuki Iwashima
2026-09-07 22:56 ` [PATCH v1 net-next 2/7] ip_tunnel: Set itn->fb_tunnel_dev to NULL in ip_tunnel_delete_net() Kuniyuki Iwashima
2026-09-09  1:58   ` netdev-bot+sashiko
2026-09-09  4:13     ` Kuniyuki Iwashima
2026-09-07 22:56 ` [PATCH v1 net-next 3/7] ip_tunnel: Don't pass rtnl_link_ops to ip_tunnel_delete_net() Kuniyuki Iwashima
2026-09-07 22:56 ` [PATCH v1 net-next 4/7] ip_tunnel: Centralise ip_tunnel_del() to ip_tunnel_dellink() Kuniyuki Iwashima
2026-09-07 22:56 ` [PATCH v1 net-next 5/7] ip_tunnel: Unify error paths in ip_tunnel_newlink() and ip_tunnel_changelink() Kuniyuki Iwashima
2026-09-07 22:56 ` [PATCH v1 net-next 6/7] ip_tunnel: Protect ip_tunnel_net.tunnels[] with mutex Kuniyuki Iwashima
2026-09-07 22:56 ` [PATCH v1 net-next 7/7] ip_tunnel: Support per-netns device unregistration Kuniyuki Iwashima
2026-09-09  1:58   ` netdev-bot+sashiko
2026-09-09  4:12     ` Kuniyuki Iwashima

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=178891911928.219967.7580029616723211694@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steffen.klassert@secunet.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;
as well as URLs for NNTP newsgroup(s).