All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Falcon <tlfalcon@linux.ibm.com>
To: Nathan Lynch <nathanl@linux.ibm.com>
Cc: netdev@vger.kernel.org, tyreld@linux.ibm.com, msuchanek@suse.com,
	linuxppc-dev@ozlabs.org
Subject: Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
Date: Thu, 7 Nov 2019 15:30:58 -0600	[thread overview]
Message-ID: <83835ea7-e76b-35c1-88a8-e37dae5bb26e@linux.ibm.com> (raw)
In-Reply-To: <87lfss7ivo.fsf@linux.ibm.com>


On 11/6/19 4:14 PM, Nathan Lynch wrote:
> Hi Tom,
>
> Thomas Falcon <tlfalcon@linux.ibm.com> writes:
>> After a migration, it is necessary to send a gratuitous ARP
>> from all running interfaces so that the rest of the network
>> is aware of its new location. However, some supported network
>> devices are unaware that they have been migrated. To avoid network
>> interruptions and other unwanted behavior, force a GARP on all
>> valid, running interfaces as part of the post_mobility_fixup
>> routine.
> [...]
>
>> @@ -331,6 +334,8 @@ void post_mobility_fixup(void)
>>   {
>>   	int rc;
>>   	int activate_fw_token;
>> +	struct net_device *netdev;
>> +	struct net *net;
>>   
>>   	activate_fw_token = rtas_token("ibm,activate-firmware");
>>   	if (activate_fw_token == RTAS_UNKNOWN_SERVICE) {
>> @@ -371,6 +376,21 @@ void post_mobility_fixup(void)
>>   	/* Possibly switch to a new RFI flush type */
>>   	pseries_setup_rfi_flush();
>>   
>> +	/* need to force a gratuitous ARP on running interfaces */
>> +	rtnl_lock();
>> +	for_each_net(net) {
>> +		for_each_netdev(net, netdev) {
>> +			if (netif_device_present(netdev) &&
>> +			    netif_running(netdev) &&
>> +			    !(netdev->flags & (IFF_NOARP | IFF_LOOPBACK)))
>> +				call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
>> +							 netdev);
>> +				call_netdevice_notifiers(NETDEV_RESEND_IGMP,
>> +							 netdev);
>> +		}
>> +	}
>> +	rtnl_unlock();
>> +
> This isn't an outright nak, but this is not nice. It illustrates the
> need to rethink the pseries partition migration code. There is no
> mechanism for drivers and other interested code to prepare for a
> migration or to adjust to the destination. So post_mobility_fixup() will
> continue to grow into a fragile collection of calls into unrelated
> subsystems until there is a better design -- either a pseries-specific
> notification/callback mechanism, or something based on the pm framework.
>
> My understanding is that this is needed specifically for ibmveth and,
> unlike ibmvnic, the platform does not provide any notification to that
> driver that a migration has occurred, right?

Correct, the ibmveth device, unlike ibmvnic, receives no signal or 
notification at all in the event of a partition migration, so it can not 
handle it or send a gratuitous ARP because from the driver's perspective 
nothing has changed.  As you've described, there is no existing notifier 
in the kernel to inform interested parties that the system has migrated 
or is about to migrate. Without adding the needed infrastructure to do 
that, I'm not sure how else to fix this.

Tom


WARNING: multiple messages have this Message-ID (diff)
From: Thomas Falcon <tlfalcon@linux.ibm.com>
To: Nathan Lynch <nathanl@linux.ibm.com>
Cc: linuxppc-dev@ozlabs.org, netdev@vger.kernel.org,
	msuchanek@suse.com, tyreld@linux.ibm.com
Subject: Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
Date: Thu, 7 Nov 2019 15:30:58 -0600	[thread overview]
Message-ID: <83835ea7-e76b-35c1-88a8-e37dae5bb26e@linux.ibm.com> (raw)
In-Reply-To: <87lfss7ivo.fsf@linux.ibm.com>


On 11/6/19 4:14 PM, Nathan Lynch wrote:
> Hi Tom,
>
> Thomas Falcon <tlfalcon@linux.ibm.com> writes:
>> After a migration, it is necessary to send a gratuitous ARP
>> from all running interfaces so that the rest of the network
>> is aware of its new location. However, some supported network
>> devices are unaware that they have been migrated. To avoid network
>> interruptions and other unwanted behavior, force a GARP on all
>> valid, running interfaces as part of the post_mobility_fixup
>> routine.
> [...]
>
>> @@ -331,6 +334,8 @@ void post_mobility_fixup(void)
>>   {
>>   	int rc;
>>   	int activate_fw_token;
>> +	struct net_device *netdev;
>> +	struct net *net;
>>   
>>   	activate_fw_token = rtas_token("ibm,activate-firmware");
>>   	if (activate_fw_token == RTAS_UNKNOWN_SERVICE) {
>> @@ -371,6 +376,21 @@ void post_mobility_fixup(void)
>>   	/* Possibly switch to a new RFI flush type */
>>   	pseries_setup_rfi_flush();
>>   
>> +	/* need to force a gratuitous ARP on running interfaces */
>> +	rtnl_lock();
>> +	for_each_net(net) {
>> +		for_each_netdev(net, netdev) {
>> +			if (netif_device_present(netdev) &&
>> +			    netif_running(netdev) &&
>> +			    !(netdev->flags & (IFF_NOARP | IFF_LOOPBACK)))
>> +				call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
>> +							 netdev);
>> +				call_netdevice_notifiers(NETDEV_RESEND_IGMP,
>> +							 netdev);
>> +		}
>> +	}
>> +	rtnl_unlock();
>> +
> This isn't an outright nak, but this is not nice. It illustrates the
> need to rethink the pseries partition migration code. There is no
> mechanism for drivers and other interested code to prepare for a
> migration or to adjust to the destination. So post_mobility_fixup() will
> continue to grow into a fragile collection of calls into unrelated
> subsystems until there is a better design -- either a pseries-specific
> notification/callback mechanism, or something based on the pm framework.
>
> My understanding is that this is needed specifically for ibmveth and,
> unlike ibmvnic, the platform does not provide any notification to that
> driver that a migration has occurred, right?

Correct, the ibmveth device, unlike ibmvnic, receives no signal or 
notification at all in the event of a partition migration, so it can not 
handle it or send a gratuitous ARP because from the driver's perspective 
nothing has changed.  As you've described, there is no existing notifier 
in the kernel to inform interested parties that the system has migrated 
or is about to migrate. Without adding the needed infrastructure to do 
that, I'm not sure how else to fix this.

Tom


  reply	other threads:[~2019-11-07 21:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06  0:06 [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration Thomas Falcon
2019-11-06  0:06 ` Thomas Falcon
2019-11-06  4:13 ` Russell Currey
2019-11-06  4:47   ` Thomas Falcon
2019-11-06 22:14 ` Nathan Lynch
2019-11-06 22:14   ` Nathan Lynch
2019-11-07 21:30   ` Thomas Falcon [this message]
2019-11-07 21:30     ` Thomas Falcon
2019-11-07  1:33 ` Michael Ellerman
2019-11-07 21:16   ` Thomas Falcon
2019-11-07 21:44 ` kbuild test robot
2019-11-08 16:56 ` kbuild test robot

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=83835ea7-e76b-35c1-88a8-e37dae5bb26e@linux.ibm.com \
    --to=tlfalcon@linux.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=msuchanek@suse.com \
    --cc=nathanl@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=tyreld@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.