netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 0/3] ibmvnic: fixes in reset path
@ 2020-11-20 22:40 Lijun Pan
  2020-11-20 22:40 ` [PATCH net v2 1/3] ibmvnic: fix call_netdevice_notifiers in do_reset Lijun Pan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lijun Pan @ 2020-11-20 22:40 UTC (permalink / raw)
  To: netdev; +Cc: sukadev, drt, Lijun Pan

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

-- 
2.23.0


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

* [PATCH net v2 1/3] ibmvnic: fix call_netdevice_notifiers in do_reset
  2020-11-20 22:40 [PATCH net v2 0/3] ibmvnic: fixes in reset path Lijun Pan
@ 2020-11-20 22:40 ` Lijun Pan
  2020-11-20 22:52   ` drt
  2020-11-20 22:40 ` [PATCH net v2 2/3] ibmvnic: notify peers when failover and migration happen Lijun Pan
  2020-11-20 22:40 ` [PATCH net v2 3/3] ibmvnic: skip tx timeout reset while in resetting Lijun Pan
  2 siblings, 1 reply; 6+ messages in thread
From: Lijun Pan @ 2020-11-20 22:40 UTC (permalink / raw)
  To: netdev; +Cc: sukadev, drt, 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")
Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
---
v2: split from v1's 1/2

 drivers/net/ethernet/ibm/ibmvnic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index da15913879f8..eface3543b2c 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -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;
 
-- 
2.23.0


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

* [PATCH net v2 2/3] ibmvnic: notify peers when failover and migration happen
  2020-11-20 22:40 [PATCH net v2 0/3] ibmvnic: fixes in reset path Lijun Pan
  2020-11-20 22:40 ` [PATCH net v2 1/3] ibmvnic: fix call_netdevice_notifiers in do_reset Lijun Pan
@ 2020-11-20 22:40 ` Lijun Pan
  2020-11-20 22:40 ` [PATCH net v2 3/3] ibmvnic: skip tx timeout reset while in resetting Lijun Pan
  2 siblings, 0 replies; 6+ messages in thread
From: Lijun Pan @ 2020-11-20 22:40 UTC (permalink / raw)
  To: netdev; +Cc: sukadev, drt, Lijun Pan, Brian King, Pradeep Satyanarayana

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

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index eface3543b2c..9665532a9ed2 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -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;
 }
 
-- 
2.23.0


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

* [PATCH net v2 3/3] ibmvnic: skip tx timeout reset while in resetting
  2020-11-20 22:40 [PATCH net v2 0/3] ibmvnic: fixes in reset path Lijun Pan
  2020-11-20 22:40 ` [PATCH net v2 1/3] ibmvnic: fix call_netdevice_notifiers in do_reset Lijun Pan
  2020-11-20 22:40 ` [PATCH net v2 2/3] ibmvnic: notify peers when failover and migration happen Lijun Pan
@ 2020-11-20 22:40 ` Lijun Pan
  2020-11-20 22:55   ` drt
  2 siblings, 1 reply; 6+ messages in thread
From: Lijun Pan @ 2020-11-20 22:40 UTC (permalink / raw)
  To: netdev; +Cc: sukadev, drt, Lijun Pan, Brian King

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.

Suggested-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
---
v2: no change

 drivers/net/ethernet/ibm/ibmvnic.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 9665532a9ed2..2aa40b2f225c 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -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);
 }
 
-- 
2.23.0


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

* Re: [PATCH net v2 1/3] ibmvnic: fix call_netdevice_notifiers in do_reset
  2020-11-20 22:40 ` [PATCH net v2 1/3] ibmvnic: fix call_netdevice_notifiers in do_reset Lijun Pan
@ 2020-11-20 22:52   ` drt
  0 siblings, 0 replies; 6+ messages in thread
From: drt @ 2020-11-20 22:52 UTC (permalink / raw)
  To: Lijun Pan; +Cc: netdev, sukadev, drt

On 2020-11-20 14:40, Lijun Pan wrote:
> 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")
> Signed-off-by: Lijun Pan <ljp@linux.ibm.com>

Reviewed-by: Dany Madden <drt@linux.ibm.com>

> ---
> v2: split from v1's 1/2
> 
>  drivers/net/ethernet/ibm/ibmvnic.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
> b/drivers/net/ethernet/ibm/ibmvnic.c
> index da15913879f8..eface3543b2c 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -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;

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

* Re: [PATCH net v2 3/3] ibmvnic: skip tx timeout reset while in resetting
  2020-11-20 22:40 ` [PATCH net v2 3/3] ibmvnic: skip tx timeout reset while in resetting Lijun Pan
@ 2020-11-20 22:55   ` drt
  0 siblings, 0 replies; 6+ messages in thread
From: drt @ 2020-11-20 22:55 UTC (permalink / raw)
  To: Lijun Pan; +Cc: netdev, sukadev, drt, Brian King

On 2020-11-20 14:40, Lijun Pan wrote:
> 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.
> 
> Suggested-by: Brian King <brking@linux.vnet.ibm.com>
> Signed-off-by: Lijun Pan <ljp@linux.ibm.com>

Reviewed-by: Dany Madden <drt@linux.ibm.com>

> ---
> v2: no change
> 
>  drivers/net/ethernet/ibm/ibmvnic.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
> b/drivers/net/ethernet/ibm/ibmvnic.c
> index 9665532a9ed2..2aa40b2f225c 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -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);
>  }

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

end of thread, other threads:[~2020-11-20 22:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 22:40 [PATCH net v2 0/3] ibmvnic: fixes in reset path Lijun Pan
2020-11-20 22:40 ` [PATCH net v2 1/3] ibmvnic: fix call_netdevice_notifiers in do_reset Lijun Pan
2020-11-20 22:52   ` drt
2020-11-20 22:40 ` [PATCH net v2 2/3] ibmvnic: notify peers when failover and migration happen Lijun Pan
2020-11-20 22:40 ` [PATCH net v2 3/3] ibmvnic: skip tx timeout reset while in resetting Lijun Pan
2020-11-20 22:55   ` drt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).