public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Ido Schimmel <idosch@nvidia.com>
Cc: David Ahern <dsahern@kernel.org>,
	netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>
Subject: Re: [RFC PATCH net] net: ipv4/ipv6 addrconf: call igmp{,6}_group_dropped() while dev is still up
Date: Mon, 10 Apr 2023 13:09:58 +0300	[thread overview]
Message-ID: <20230410100958.4o3ub7yy7gxnzzpy@skbuf> (raw)
In-Reply-To: <ZDPA1pv7tqOvKHqe@shredder>

Hi Ido,

On Mon, Apr 10, 2023 at 10:55:02AM +0300, Ido Schimmel wrote:
> > > The proposal is to respond to that slightly earlier notifier with the
> > > IGMP address deletion, so that the ndo_set_rx_mode() of the device does
> > > actually get called. I am not familiar with the details of these layers,
> > > but it appeared to me that NETDEV_DOWN needed to be replaced everywhere
> > > with NETDEV_GOING_DOWN, so I blindly did that and it worked.
> 
> I think there is a confusion here between the netdev notifier and
> inetaddr notifiers. They all use "NETDEV_DOWN", but in the inetaddr
> notifiers it means that an address is being deleted. Changing the event
> to "NETDEV_GOING_DOWN" is going to break a lot of users since none of
> the inetaddr listeners respond to "NETDEV_GOING_DOWN".
> 
> IOW, I believe you only need this change for IPv4 (and similarly for
> IPv6):
> 
> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index 5deac0517ef7..679c9819f25b 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -1588,7 +1588,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
>  		/* Send gratuitous ARP to notify of link change */
>  		inetdev_send_gratuitous_arp(dev, in_dev);
>  		break;
> -	case NETDEV_DOWN:
> +	case NETDEV_GOING_DOWN:
>  		ip_mc_down(in_dev);
>  		break;
>  	case NETDEV_PRE_TYPE_CHANGE:

You are correct, only that portion is needed for IPv4. When I open my
eyes, I see it too :)

Although it would have been a lot less confusing for someone looking at
the code for the first time if the inetaddr and inet6addr notifiers did
not use events from the same NETDEV_ namespace as the netdev notifiers...

So, how do you think I should proceed with this? One patch or two
(for IPv4 and IPv6)? Is the Fixes: tag ok?

  reply	other threads:[~2023-04-10 10:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06 23:30 [RFC PATCH net] net: ipv4/ipv6 addrconf: call igmp{,6}_group_dropped() while dev is still up Vladimir Oltean
2023-04-10  2:08 ` David Ahern
2023-04-10  7:55   ` Ido Schimmel
2023-04-10 10:09     ` Vladimir Oltean [this message]
2023-04-10 11:43       ` Ido Schimmel
2023-04-10 17:07         ` Vladimir Oltean

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=20230410100958.4o3ub7yy7gxnzzpy@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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