From: Thomas Falcon <hidden> Date: 2018-03-07 23:51:54
This patch set cleans up and reorganizes the driver's net_device
close function and leverages that to fix up a bug that can occur
during some device resets. Some reset cases require the backing
adapter to be disabled before continuing, but other cases, such as
during a device failover or partition migration, do not require this
step. Since the device will not be initialized at this stage and
its command-processing queue is closed, do not send the request to
disable the device as it could result in an error or timeout
disrupting the reset.
Thomas Falcon (3):
ibmvnic: Clean up device close
ibmvnic: Reorganize device close
ibmvnic: Do not disable device during failover or partition migration
drivers/net/ethernet/ibm/ibmvnic.c | 48 ++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 25 deletions(-)
--
1.8.3.1
From: Thomas Falcon <hidden> Date: 2018-03-07 23:51:55
Remove some dead code now that RX pools are being cleaned. This
was included to wait until any pending RX queue interrupts are
processed, but NAPI polling should be disabled by this point.
Another minor change is to use the net device parameter for any
print functions instead of accessing it from the adapter structure.
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
From: Thomas Falcon <hidden> Date: 2018-03-07 23:51:55
Introduce a function to halt network operations and clean up any
unused or outstanding socket buffers. Then, during device close,
disable backing adapter before halting all queues and performing
cleanup. This ensures all backing device operations will be
stopped before the driver cleans up shared resources.
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
@@ -1143,14 +1143,11 @@ static void clean_tx_pools(struct ibmvnic_adapter *adapter)}}-staticint__ibmvnic_close(structnet_device*netdev)+staticvoidibmvnic_cleanup(structnet_device*netdev){structibmvnic_adapter*adapter=netdev_priv(netdev);-intrc=0;inti;-adapter->state=VNIC_CLOSING;-/* ensure that transmissions are stopped if called by do_reset */if(adapter->resetting)netif_tx_disable(netdev);
@@ -1168,10 +1165,6 @@ static int __ibmvnic_close(struct net_device *netdev)}}-rc=set_link_state(adapter,IBMVNIC_LOGICAL_LNK_DN);-if(rc)-returnrc;-if(adapter->rx_scrq){for(i=0;i<adapter->req_rx_queues;i++){if(adapter->rx_scrq[i]->irq){
@@ -1183,8 +1176,20 @@ static int __ibmvnic_close(struct net_device *netdev)}clean_rx_pools(adapter);clean_tx_pools(adapter);+}++staticint__ibmvnic_close(structnet_device*netdev)+{+structibmvnic_adapter*adapter=netdev_priv(netdev);+intrc=0;++adapter->state=VNIC_CLOSING;+rc=set_link_state(adapter,IBMVNIC_LOGICAL_LNK_DN);+if(rc)+returnrc;+ibmvnic_cleanup(netdev);adapter->state=VNIC_CLOSED;-returnrc;+return0;}staticintibmvnic_close(structnet_device*netdev)
From: Thomas Falcon <hidden> Date: 2018-03-07 23:51:57
During a device failover or partition migration reset, it is not
necessary to disable the backing adapter since it should not be
running yet and its Command-Response Queue is closed. Sending
device commands during this time could result in an error or
timeout disrupting the reset process. In these cases, just halt
transmissions, clean up resources, and continue with reset.
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2018-03-08 17:52:01
From: Thomas Falcon <redacted>
Date: Wed, 7 Mar 2018 17:51:44 -0600
This patch set cleans up and reorganizes the driver's net_device
close function and leverages that to fix up a bug that can occur
during some device resets. Some reset cases require the backing
adapter to be disabled before continuing, but other cases, such as
during a device failover or partition migration, do not require this
step. Since the device will not be initialized at this stage and
its command-processing queue is closed, do not send the request to
disable the device as it could result in an error or timeout
disrupting the reset.