i40e: fix double 'NIC Link is Down' messages
authorSergey Nemov <sergey.nemov@intel.com>
Tue, 28 Aug 2018 17:16:06 +0000 (10:16 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 25 Sep 2018 20:06:50 +0000 (13:06 -0700)
When isup is false meaning that interface is going to shut down
set new speed to 0 to avoid double 'NIC Link is Down' messages.

Signed-off-by: Sergey Nemov <sergey.nemov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 102219cea67fb24fb92f7dc2cecfe2138a83063d..330bafe6a689103eb1328cf91fe297fb98a88982 100644 (file)
@@ -6431,7 +6431,10 @@ void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
        char *req_fec = "";
        char *an = "";
 
-       new_speed = pf->hw.phy.link_info.link_speed;
+       if (isup)
+               new_speed = pf->hw.phy.link_info.link_speed;
+       else
+               new_speed = I40E_LINK_SPEED_UNKNOWN;
 
        if ((vsi->current_isup == isup) && (vsi->current_speed == new_speed))
                return;