All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
@ 2019-11-06  0:06 ` Thomas Falcon
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Falcon @ 2019-11-06  0:06 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: netdev, nathanl, tyreld, msuchanek, Thomas Falcon

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.

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/mobility.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index b571285f6c14..c1abc14cf2bb 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -17,6 +17,9 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/stringify.h>
+#include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
+#include <net/net_namespace.h>
 
 #include <asm/machdep.h>
 #include <asm/rtas.h>
@@ -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();
+
 	return;
 }
 
-- 
2.12.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
@ 2019-11-06  0:06 ` Thomas Falcon
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Falcon @ 2019-11-06  0:06 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: nathanl, netdev, Thomas Falcon, msuchanek, tyreld

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.

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/mobility.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index b571285f6c14..c1abc14cf2bb 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -17,6 +17,9 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/stringify.h>
+#include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
+#include <net/net_namespace.h>
 
 #include <asm/machdep.h>
 #include <asm/rtas.h>
@@ -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();
+
 	return;
 }
 
-- 
2.12.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
  2019-11-06  0:06 ` Thomas Falcon
  (?)
@ 2019-11-06  4:13 ` Russell Currey
  2019-11-06  4:47   ` Thomas Falcon
  -1 siblings, 1 reply; 12+ messages in thread
From: Russell Currey @ 2019-11-06  4:13 UTC (permalink / raw)
  To: Thomas Falcon, linuxppc-dev; +Cc: nathanl, netdev, msuchanek, tyreld

On Tue, 2019-11-05 at 18:06 -0600, Thomas Falcon wrote:
> 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.
> 
> Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>

Hi Thomas,

> ---
>  arch/powerpc/platforms/pseries/mobility.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/arch/powerpc/platforms/pseries/mobility.c
> b/arch/powerpc/platforms/pseries/mobility.c
> index b571285f6c14..c1abc14cf2bb 100644
> --- a/arch/powerpc/platforms/pseries/mobility.c
> +++ b/arch/powerpc/platforms/pseries/mobility.c
> @@ -17,6 +17,9 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/stringify.h>
> +#include <linux/netdevice.h>
> +#include <linux/rtnetlink.h>
> +#include <net/net_namespace.h>
>  
>  #include <asm/machdep.h>
>  #include <asm/rtas.h>
> @@ -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);

Without curly braces following the "if" statment, the second line
(below) will be executed unconditionally, which I assume with this
indentation isn't what you want.

(reported by snowpatch)

- Russell

> +				call_netdevice_notifiers(NETDEV_RESEND_
> IGMP,
> +							 netdev);
> +		}
> +	}
> +	rtnl_unlock();
> +
>  	return;
>  }
>  


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
  2019-11-06  4:13 ` Russell Currey
@ 2019-11-06  4:47   ` Thomas Falcon
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Falcon @ 2019-11-06  4:47 UTC (permalink / raw)
  To: Russell Currey, linuxppc-dev; +Cc: nathanl, netdev, msuchanek, tyreld


On 11/5/19 10:13 PM, Russell Currey wrote:
> On Tue, 2019-11-05 at 18:06 -0600, Thomas Falcon wrote:
>> 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.
>>
>> Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
> Hi Thomas,
>
>> ---
>>   arch/powerpc/platforms/pseries/mobility.c | 20 ++++++++++++++++++++
>>   1 file changed, 20 insertions(+)
>>
>> diff --git a/arch/powerpc/platforms/pseries/mobility.c
>> b/arch/powerpc/platforms/pseries/mobility.c
>> index b571285f6c14..c1abc14cf2bb 100644
>> --- a/arch/powerpc/platforms/pseries/mobility.c
>> +++ b/arch/powerpc/platforms/pseries/mobility.c
>> @@ -17,6 +17,9 @@
>>   #include <linux/delay.h>
>>   #include <linux/slab.h>
>>   #include <linux/stringify.h>
>> +#include <linux/netdevice.h>
>> +#include <linux/rtnetlink.h>
>> +#include <net/net_namespace.h>
>>   
>>   #include <asm/machdep.h>
>>   #include <asm/rtas.h>
>> @@ -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);
> Without curly braces following the "if" statment, the second line
> (below) will be executed unconditionally, which I assume with this
> indentation isn't what you want.
>
> (reported by snowpatch)
>
> - Russell

Thanks for catching that! I'll fix that and send a v2 soon.

Tom


>> +				call_netdevice_notifiers(NETDEV_RESEND_
>> IGMP,
>> +							 netdev);
>> +		}
>> +	}
>> +	rtnl_unlock();
>> +
>>   	return;
>>   }
>>   

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
  2019-11-06  0:06 ` Thomas Falcon
@ 2019-11-06 22:14   ` Nathan Lynch
  -1 siblings, 0 replies; 12+ messages in thread
From: Nathan Lynch @ 2019-11-06 22:14 UTC (permalink / raw)
  To: Thomas Falcon; +Cc: netdev, tyreld, msuchanek, linuxppc-dev

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?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
@ 2019-11-06 22:14   ` Nathan Lynch
  0 siblings, 0 replies; 12+ messages in thread
From: Nathan Lynch @ 2019-11-06 22:14 UTC (permalink / raw)
  To: Thomas Falcon; +Cc: linuxppc-dev, netdev, msuchanek, tyreld

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?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
  2019-11-06  0:06 ` Thomas Falcon
                   ` (2 preceding siblings ...)
  (?)
@ 2019-11-07  1:33 ` Michael Ellerman
  2019-11-07 21:16   ` Thomas Falcon
  -1 siblings, 1 reply; 12+ messages in thread
From: Michael Ellerman @ 2019-11-07  1:33 UTC (permalink / raw)
  To: Thomas Falcon, linuxppc-dev
  Cc: nathanl, netdev, Thomas Falcon, msuchanek, tyreld

Hi Thomas,

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.
>
> Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
> ---
>  arch/powerpc/platforms/pseries/mobility.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)

This patch is in powerpc code, but it's doing networking stuff that I
don't really understand.

So I'd like an Ack from Dave or someone else in netdev land before I
merge it.

cheers


> diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
> index b571285f6c14..c1abc14cf2bb 100644
> --- a/arch/powerpc/platforms/pseries/mobility.c
> +++ b/arch/powerpc/platforms/pseries/mobility.c
> @@ -17,6 +17,9 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/stringify.h>
> +#include <linux/netdevice.h>
> +#include <linux/rtnetlink.h>
> +#include <net/net_namespace.h>
>  
>  #include <asm/machdep.h>
>  #include <asm/rtas.h>
> @@ -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();
> +
>  	return;
>  }
>  
> -- 
> 2.12.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
  2019-11-07  1:33 ` Michael Ellerman
@ 2019-11-07 21:16   ` Thomas Falcon
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Falcon @ 2019-11-07 21:16 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: nathanl, netdev, msuchanek, tyreld


On 11/6/19 7:33 PM, Michael Ellerman wrote:
> Hi Thomas,
>
> 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.
>>
>> Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
>> ---
>>   arch/powerpc/platforms/pseries/mobility.c | 20 ++++++++++++++++++++
>>   1 file changed, 20 insertions(+)
> This patch is in powerpc code, but it's doing networking stuff that I
> don't really understand.
>
> So I'd like an Ack from Dave or someone else in netdev land before I
> merge it.

Thanks, I've already included netdev in the CC list. I'll wait and keep 
an eye out for any comments from that side.

Tom



>
> cheers
>
>
>> diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
>> index b571285f6c14..c1abc14cf2bb 100644
>> --- a/arch/powerpc/platforms/pseries/mobility.c
>> +++ b/arch/powerpc/platforms/pseries/mobility.c
>> @@ -17,6 +17,9 @@
>>   #include <linux/delay.h>
>>   #include <linux/slab.h>
>>   #include <linux/stringify.h>
>> +#include <linux/netdevice.h>
>> +#include <linux/rtnetlink.h>
>> +#include <net/net_namespace.h>
>>   
>>   #include <asm/machdep.h>
>>   #include <asm/rtas.h>
>> @@ -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();
>> +
>>   	return;
>>   }
>>   
>> -- 
>> 2.12.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
  2019-11-06 22:14   ` Nathan Lynch
@ 2019-11-07 21:30     ` Thomas Falcon
  -1 siblings, 0 replies; 12+ messages in thread
From: Thomas Falcon @ 2019-11-07 21:30 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: netdev, tyreld, msuchanek, linuxppc-dev


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
@ 2019-11-07 21:30     ` Thomas Falcon
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Falcon @ 2019-11-07 21:30 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-dev, netdev, msuchanek, tyreld


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
  2019-11-06  0:06 ` Thomas Falcon
                   ` (3 preceding siblings ...)
  (?)
@ 2019-11-07 21:44 ` kbuild test robot
  -1 siblings, 0 replies; 12+ messages in thread
From: kbuild test robot @ 2019-11-07 21:44 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3899 bytes --]

Hi Thomas,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on powerpc/next]
[also build test ERROR on v5.4-rc6 next-20191107]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Thomas-Falcon/powerpc-pseries-mobility-notify-network-peers-after-migration/20191108-030800
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/powerpc/platforms/pseries/mobility.c: In function 'post_mobility_fixup':
>> arch/powerpc/platforms/pseries/mobility.c:383:4: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
       if (netif_device_present(netdev) &&
       ^~
   arch/powerpc/platforms/pseries/mobility.c:388:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
        call_netdevice_notifiers(NETDEV_RESEND_IGMP,
        ^~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors

vim +/if +383 arch/powerpc/platforms/pseries/mobility.c

   332	
   333	void post_mobility_fixup(void)
   334	{
   335		int rc;
   336		int activate_fw_token;
   337		struct net_device *netdev;
   338		struct net *net;
   339	
   340		activate_fw_token = rtas_token("ibm,activate-firmware");
   341		if (activate_fw_token == RTAS_UNKNOWN_SERVICE) {
   342			printk(KERN_ERR "Could not make post-mobility "
   343			       "activate-fw call.\n");
   344			return;
   345		}
   346	
   347		do {
   348			rc = rtas_call(activate_fw_token, 0, 1, NULL);
   349		} while (rtas_busy_delay(rc));
   350	
   351		if (rc)
   352			printk(KERN_ERR "Post-mobility activate-fw failed: %d\n", rc);
   353	
   354		/*
   355		 * We don't want CPUs to go online/offline while the device
   356		 * tree is being updated.
   357		 */
   358		cpus_read_lock();
   359	
   360		/*
   361		 * It's common for the destination firmware to replace cache
   362		 * nodes.  Release all of the cacheinfo hierarchy's references
   363		 * before updating the device tree.
   364		 */
   365		cacheinfo_teardown();
   366	
   367		rc = pseries_devicetree_update(MIGRATION_SCOPE);
   368		if (rc)
   369			printk(KERN_ERR "Post-mobility device tree update "
   370				"failed: %d\n", rc);
   371	
   372		cacheinfo_rebuild();
   373	
   374		cpus_read_unlock();
   375	
   376		/* Possibly switch to a new RFI flush type */
   377		pseries_setup_rfi_flush();
   378	
   379		/* need to force a gratuitous ARP on running interfaces */
   380		rtnl_lock();
   381		for_each_net(net) {
   382			for_each_netdev(net, netdev) {
 > 383				if (netif_device_present(netdev) &&
   384				    netif_running(netdev) &&
   385				    !(netdev->flags & (IFF_NOARP | IFF_LOOPBACK)))
   386					call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
   387								 netdev);
   388					call_netdevice_notifiers(NETDEV_RESEND_IGMP,
   389								 netdev);
   390			}
   391		}
   392		rtnl_unlock();
   393	
   394		return;
   395	}
   396	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 25428 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [RFC PATCH] powerpc/pseries/mobility: notify network peers after migration
  2019-11-06  0:06 ` Thomas Falcon
                   ` (4 preceding siblings ...)
  (?)
@ 2019-11-08 16:56 ` kbuild test robot
  -1 siblings, 0 replies; 12+ messages in thread
From: kbuild test robot @ 2019-11-08 16:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3851 bytes --]

Hi Thomas,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on powerpc/next]
[cannot apply to v5.4-rc6 next-20191108]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Thomas-Falcon/powerpc-pseries-mobility-notify-network-peers-after-migration/20191108-030800
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/powerpc//platforms/pseries/mobility.c: In function 'post_mobility_fixup':
>> arch/powerpc//platforms/pseries/mobility.c:383:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
       if (netif_device_present(netdev) &&
       ^~
   arch/powerpc//platforms/pseries/mobility.c:388:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
        call_netdevice_notifiers(NETDEV_RESEND_IGMP,
        ^~~~~~~~~~~~~~~~~~~~~~~~

vim +/if +383 arch/powerpc//platforms/pseries/mobility.c

   332	
   333	void post_mobility_fixup(void)
   334	{
   335		int rc;
   336		int activate_fw_token;
   337		struct net_device *netdev;
   338		struct net *net;
   339	
   340		activate_fw_token = rtas_token("ibm,activate-firmware");
   341		if (activate_fw_token == RTAS_UNKNOWN_SERVICE) {
   342			printk(KERN_ERR "Could not make post-mobility "
   343			       "activate-fw call.\n");
   344			return;
   345		}
   346	
   347		do {
   348			rc = rtas_call(activate_fw_token, 0, 1, NULL);
   349		} while (rtas_busy_delay(rc));
   350	
   351		if (rc)
   352			printk(KERN_ERR "Post-mobility activate-fw failed: %d\n", rc);
   353	
   354		/*
   355		 * We don't want CPUs to go online/offline while the device
   356		 * tree is being updated.
   357		 */
   358		cpus_read_lock();
   359	
   360		/*
   361		 * It's common for the destination firmware to replace cache
   362		 * nodes.  Release all of the cacheinfo hierarchy's references
   363		 * before updating the device tree.
   364		 */
   365		cacheinfo_teardown();
   366	
   367		rc = pseries_devicetree_update(MIGRATION_SCOPE);
   368		if (rc)
   369			printk(KERN_ERR "Post-mobility device tree update "
   370				"failed: %d\n", rc);
   371	
   372		cacheinfo_rebuild();
   373	
   374		cpus_read_unlock();
   375	
   376		/* Possibly switch to a new RFI flush type */
   377		pseries_setup_rfi_flush();
   378	
   379		/* need to force a gratuitous ARP on running interfaces */
   380		rtnl_lock();
   381		for_each_net(net) {
   382			for_each_netdev(net, netdev) {
 > 383				if (netif_device_present(netdev) &&
   384				    netif_running(netdev) &&
   385				    !(netdev->flags & (IFF_NOARP | IFF_LOOPBACK)))
   386					call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
   387								 netdev);
   388					call_netdevice_notifiers(NETDEV_RESEND_IGMP,
   389								 netdev);
   390			}
   391		}
   392		rtnl_unlock();
   393	
   394		return;
   395	}
   396	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 62901 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-11-08 16:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.