Skip to contentSkip to conversation

ibmvnic: fixes in reset path

PATCH In review Lijun Pan 2 participants 6 messages Nov 20, 2020

Subsystems (4)
lore
Share & tools
lore

Lijun Pan

author
#0 lore raw

v2 cover ibmvnic: fixes in reset path

Patch 1/3 and 2/3 notify peers in failover and migration reset. Patch 3/3 skips timeout reset if it is already resetting.

Lijun Pan (3):
ibmvnic: fix call_netdevice_notifiers in do_reset
ibmvnic: notify peers when failover and migration happen
ibmvnic: skip tx timeout reset while in resetting

 drivers/net/ethernet/ibm/ibmvnic.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
Signature · 1 line
2.23.0
author
#1 lore raw

PATCH v2 1/3 ibmvnic: fix call_netdevice_notifiers in do_reset

When netdev_notify_peers was substituted in
commit 986103e7920c ("net/ibmvnic: Fix RTNL deadlock during device reset"), call_netdevice_notifiers(NETDEV_RESEND_IGMP, dev) was missed. Fix it now.

Fixes 986103e7920c ("net/ibmvnic: Fix RTNL deadlock during device reset")

---
v2: split from v1's 1/2

 drivers/net/ethernet/ibm/ibmvnic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmvnic.c +3 -1
index da15913879f8..eface3543b2c 100644
@@ -2074,8 +2074,10 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 	for (i = 0; i < adapter->req_rx_queues; i++)
 		napi_schedule(&adapter->napi[i]);
 
-	if (adapter->reset_reason != VNIC_RESET_FAILOVER)
+	if (adapter->reset_reason != VNIC_RESET_FAILOVER) {
 		call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
+		call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev);
+	}
 
 	rc = 0;
 
Signature · 1 line
2.23.0
Reviewed-by Dany Madden on v2 1/3
#2 lore raw

Re: [PATCH net v2 1/3] ibmvnic: fix call_netdevice_notifiers in do_reset

Quoted 7 lines · Lijun Pan

When netdev_notify_peers was substituted in
commit 986103e7920c ("net/ibmvnic: Fix RTNL deadlock during device reset"), call_netdevice_notifiers(NETDEV_RESEND_IGMP, dev) was missed. Fix it now.

Fixes 986103e7920c ("net/ibmvnic: Fix RTNL deadlock during device reset")
Quoted 23 lines

---
v2: split from v1's 1/2

 drivers/net/ethernet/ibm/ibmvnic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmvnic.c +3 -1
index da15913879f8..eface3543b2c 100644
@@ -2074,8 +2074,10 @@ static int do_reset(struct ibmvnic_adapter 
 *adapter,
 	for (i = 0; i < adapter->req_rx_queues; i++)
 		napi_schedule(&adapter->napi[i]);
 
-	if (adapter->reset_reason != VNIC_RESET_FAILOVER)
+	if (adapter->reset_reason != VNIC_RESET_FAILOVER) {
 		call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
+		call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev);
+	}
 
 	rc = 0;
author
#3 lore raw

PATCH v2 2/3 ibmvnic: notify peers when failover and migration happen

In reply to Lijun Pan

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")

---
v2: split from v1's 1/2
explain why "notify peers" is needed for failover

 drivers/net/ethernet/ibm/ibmvnic.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmvnic.c +5 -1
index eface3543b2c..9665532a9ed2 100644
@@ -2074,7 +2074,8 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 	for (i = 0; i < adapter->req_rx_queues; i++)
 		napi_schedule(&adapter->napi[i]);
 
-	if (adapter->reset_reason != VNIC_RESET_FAILOVER) {
+	if (adapter->reset_reason == VNIC_RESET_FAILOVER ||
+	    adapter->reset_reason == VNIC_RESET_MOBILITY) {
 		call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
 		call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev);
 	}
@@ -2147,6 +2148,9 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter,
 	if (rc)
 		return IBMVNIC_OPEN_FAILED;
 
+	call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
+	call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev);
+
 	return 0;
 }
 
Signature · 1 line
2.23.0
author
#4 lore raw

PATCH v2 3/3 ibmvnic: skip tx timeout reset while in resetting

In reply to Lijun Pan

Sometimes it takes longer than 5 seconds (watchdog timeout) to complete failover, migration, and other resets. In stead of scheduling another timeout reset, we wait for the current one to complete.

---
v2: no change

 drivers/net/ethernet/ibm/ibmvnic.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ethernet/ibm/ibmvnic.c +6 -0
index 9665532a9ed2..2aa40b2f225c 100644
@@ -2356,6 +2356,12 @@ static void ibmvnic_tx_timeout(struct net_device *dev, unsigned int txqueue)
 {
 	struct ibmvnic_adapter *adapter = netdev_priv(dev);
 
+	if (test_bit(0, &adapter->resetting)) {
+		netdev_err(adapter->netdev,
+			   "Adapter is resetting, skip timeout reset\n");
+		return;
+	}
+
 	ibmvnic_reset(adapter, VNIC_RESET_TIMEOUT);
 }
 
Signature · 1 line
2.23.0
Reviewed-by Dany Madden on v2 3/3
#5 lore raw

Re: [PATCH net v2 3/3] ibmvnic: skip tx timeout reset while in resetting

Quoted 6 lines · Lijun Pan

Sometimes it takes longer than 5 seconds (watchdog timeout) to complete failover, migration, and other resets. In stead of scheduling another timeout reset, we wait for the current one to complete.

Quoted 24 lines

---
v2: no change

 drivers/net/ethernet/ibm/ibmvnic.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ethernet/ibm/ibmvnic.c +6 -0
index 9665532a9ed2..2aa40b2f225c 100644
@@ -2356,6 +2356,12 @@ static void ibmvnic_tx_timeout(struct
 net_device *dev, unsigned int txqueue)
 {
 	struct ibmvnic_adapter *adapter = netdev_priv(dev);
 
+	if (test_bit(0, &adapter->resetting)) {
+		netdev_err(adapter->netdev,
+			   "Adapter is resetting, skip timeout reset\n");
+		return;
+	}
+
 	ibmvnic_reset(adapter, VNIC_RESET_TIMEOUT);
 }