]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ibmvnic: Halt TX and report carrier off on H_CLOSED return code
authorThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Fri, 26 May 2017 14:30:42 +0000 (10:30 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 May 2017 19:32:45 +0000 (15:32 -0400)
This patch disables transmissions and reports carrier off if xmit
function returns that the hardware TX queue is closed. The driver can
then await a signal from firmware to determine the correct reset method.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index def867aaa42284f57620c80fcba1b388e5697b29..1c3f1edea9db8dc5adf519f1f267502c77f373a9 100644 (file)
@@ -1111,8 +1111,14 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
                dev_kfree_skb_any(skb);
                tx_buff->skb = NULL;
 
-               if (lpar_rc == H_CLOSED)
-                       netif_stop_subqueue(netdev, queue_num);
+               if (lpar_rc == H_CLOSED) {
+                       /* Disable TX and report carrier off if queue is closed.
+                        * Firmware guarantees that a signal will be sent to the
+                        * driver, triggering a reset or some other action.
+                        */
+                       netif_tx_stop_all_queues(netdev);
+                       netif_carrier_off(netdev);
+               }
 
                tx_send_failed++;
                tx_dropped++;