ibmvnic: fixes in reset path
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
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.
---
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
@@ -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
PATCH v2 2/3 ibmvnic: notify peers when failover and migration happen
In reply to Lijun PanCommit 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.
---
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
@@ -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
PATCH v2 3/3 ibmvnic: skip tx timeout reset while in resetting
In reply to Lijun PanSometimes 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
@@ -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
Re: [PATCH net v2 1/3] ibmvnic: fix call_netdevice_notifiers in do_reset
In reply to Lijun PanQuoted 7 lines · Lijun Pan
When
netdev_notify_peerswas substituted in
commit986103e7920c("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 <[email protected]>
Quoted 23 lines
---
v2: split from v1's 1/2drivers/net/ethernet/ibm/ibmvnic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/ethernet/ibm/ibmvnic.c +3
-1@@ -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 ;
Re: [PATCH net v2 3/3] ibmvnic: skip tx timeout reset while in resetting
In reply to Lijun PanQuoted 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.
Suggested-by Brian King <[email protected]>Signed-off-by Lijun Pan <[email protected]>
Quoted 24 lines
---
v2: no changedrivers/net/ethernet/ibm/ibmvnic.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/net/ethernet/ibm/ibmvnic.c +6
-0@@ -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 ); }