diff mbox series

[4.19,11/32] ibmvnic: notify peers when failover and migration happen

Message ID 20201206111556.317195640@linuxfoundation.org
State New
Headers show
Series None | expand

Commit Message

Greg KH Dec. 6, 2020, 11:17 a.m. UTC
From: Lijun Pan <ljp@linux.ibm.com>

[ Upstream commit 98025bce3a6200a0c4637272a33b5913928ba5b8 ]

Commit 61d3e1d9bc2a ("ibmvnic: Remove netdev notify for failover resets")
excluded the failover case for notify call because it said
netdev_notify_peers() can cause network traffic to stall or halt.
Current testing does not show network traffic stall
or halt because of the notify call for failover event.
netdev_notify_peers may be used when a device wants to inform the
rest of the network about some sort of a reconfiguration
such as failover or migration.

It is unnecessary to call that in other events like
FATAL, NON_FATAL, CHANGE_PARAM, and TIMEOUT resets
since in those scenarios the hardware does not change.
If the driver must do a hard reset, it is necessary to notify peers.

Fixes: 61d3e1d9bc2a ("ibmvnic: Remove netdev notify for failover resets")
Suggested-by: Brian King <brking@linux.vnet.ibm.com>
Suggested-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
Signed-off-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/ibm/ibmvnic.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Greg KH Dec. 8, 2020, 9:06 a.m. UTC | #1
On Sun, Dec 06, 2020 at 06:07:08PM +0100, Pavel Machek wrote:
> Hi!

> 

> > From: Lijun Pan <ljp@linux.ibm.com>

> > 

> > [ Upstream commit 98025bce3a6200a0c4637272a33b5913928ba5b8 ]

> > 

> > Commit 61d3e1d9bc2a ("ibmvnic: Remove netdev notify for failover resets")

> > excluded the failover case for notify call because it said

> > netdev_notify_peers() can cause network traffic to stall or halt.

> > Current testing does not show network traffic stall

> > or halt because of the notify call for failover event.

> > netdev_notify_peers may be used when a device wants to inform the

> > rest of the network about some sort of a reconfiguration

> > such as failover or migration.

> > 

> > It is unnecessary to call that in other events like

> > FATAL, NON_FATAL, CHANGE_PARAM, and TIMEOUT resets

> > since in those scenarios the hardware does not change.

> > If the driver must do a hard reset, it is necessary to notify peers.

> 

> Something went wrong here.

> 

> > @@ -1877,8 +1877,9 @@ static int do_reset(struct ibmvnic_adapt

> >  	for (i = 0; i < adapter->req_rx_queues; i++)

> >  		napi_schedule(&adapter->napi[i]);

> >  

> > -	if (adapter->reset_reason != VNIC_RESET_FAILOVER &&

> > -	    adapter->reset_reason != VNIC_RESET_CHANGE_PARAM) {

> > +	if ((adapter->reset_reason != VNIC_RESET_FAILOVER &&

> > +	     adapter->reset_reason != VNIC_RESET_CHANGE_PARAM) ||

> > +	     adapter->reset_reason == VNIC_RESET_MOBILITY) {

> 

> This condition does not make sense... part after || is redundant.

> 

> Mainline changed != in FAILOVER test to ==, so it does not have same

> problem.


Odd, ok, I'll just go drop this patch from the queue, thanks.

greg k-h
diff mbox series

Patch

--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1877,8 +1877,9 @@  static int do_reset(struct ibmvnic_adapt
 	for (i = 0; i < adapter->req_rx_queues; i++)
 		napi_schedule(&adapter->napi[i]);
 
-	if (adapter->reset_reason != VNIC_RESET_FAILOVER &&
-	    adapter->reset_reason != VNIC_RESET_CHANGE_PARAM) {
+	if ((adapter->reset_reason != VNIC_RESET_FAILOVER &&
+	     adapter->reset_reason != VNIC_RESET_CHANGE_PARAM) ||
+	     adapter->reset_reason == VNIC_RESET_MOBILITY) {
 		call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
 		call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev);
 	}
@@ -2106,6 +2107,9 @@  static int ibmvnic_reset(struct ibmvnic_
 	netdev_dbg(adapter->netdev, "Scheduling reset (reason %d)\n", reason);
 	schedule_work(&adapter->ibmvnic_reset);
 
+	call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
+	call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev);
+
 	return 0;
 err:
 	if (adapter->wait_for_reset)