qede: Don't report link change needlessly
authorYuval Mintz <Yuval.Mintz@qlogic.com>
Wed, 24 Feb 2016 14:52:47 +0000 (16:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Feb 2016 21:54:44 +0000 (16:54 -0500)
There are several corner cases where driver might get a 2nd notification
about the same link change. Don't log any additional changes if the
physical carrier is already reported as it should.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede_main.c

index f07b9a9063524e80652a460b230edb7360ff3fb6..c0dd23614ed85b8ae358575dad03afa8602d5282 100644 (file)
@@ -2780,13 +2780,17 @@ static void qede_link_update(void *dev, struct qed_link_output *link)
        }
 
        if (link->link_up) {
-               DP_NOTICE(edev, "Link is up\n");
-               netif_tx_start_all_queues(edev->ndev);
-               netif_carrier_on(edev->ndev);
+               if (!netif_carrier_ok(edev->ndev)) {
+                       DP_NOTICE(edev, "Link is up\n");
+                       netif_tx_start_all_queues(edev->ndev);
+                       netif_carrier_on(edev->ndev);
+               }
        } else {
-               DP_NOTICE(edev, "Link is down\n");
-               netif_tx_disable(edev->ndev);
-               netif_carrier_off(edev->ndev);
+               if (netif_carrier_ok(edev->ndev)) {
+                       DP_NOTICE(edev, "Link is down\n");
+                       netif_tx_disable(edev->ndev);
+                       netif_carrier_off(edev->ndev);
+               }
        }
 }