[next,S76-V2,10/13] i40e: Fix link down message when interface is brought up

Message ID 20170714131019.52530-10-alice.michael@intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show

Commit Message

Alice Michael July 14, 2017, 1:10 p.m.
From: Sudheer Mogilappagari <sudheer.mogilappagari@intel.com>

i40e_print_link_message() is intended to compare new
link state with current link state and print log message
only if the new state is different from current state.

However in current driver the new state does not get updated
when link is going down because of the if condition. When an
interface is brought down, vsi->state is set to I40E_VSI_DOWN
in i40e_vsi_close() and later i40e_print_link_message() does
not get invoked in i40e_link_event due to if condition. Hence
link down message doesn't appear when link is going down. The
down state is seen  later during i40e_open() and old state
gets printed. The actual link state doesn't get updated in
i40e_close() or i40e_open() but when i40e_handle_link_event is
called inside i40e_clean_adminq_subtask.

This change allows i40e_print_link_message() to be called when
interface is going down and keeps the state information updated.

Signed-off-by: Mogilappagari, Sudheer <sudheer.mogilappagari@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Bowers, AndrewX July 20, 2017, 6:15 p.m. | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, July 14, 2017 6:10 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan@lists.osuosl.org
> Cc: Mogilappagari@osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S76-V2 10/13] i40e: Fix link down
> message when interface is brought up
> 
> From: Sudheer Mogilappagari <sudheer.mogilappagari@intel.com>
> 
> i40e_print_link_message() is intended to compare new link state with
> current link state and print log message only if the new state is different from
> current state.
> 
> However in current driver the new state does not get updated when link is
> going down because of the if condition. When an interface is brought down,
> vsi->state is set to I40E_VSI_DOWN in i40e_vsi_close() and later
> i40e_print_link_message() does not get invoked in i40e_link_event due to if
> condition. Hence link down message doesn't appear when link is going down.
> The down state is seen  later during i40e_open() and old state gets printed.
> The actual link state doesn't get updated in
> i40e_close() or i40e_open() but when i40e_handle_link_event is called inside
> i40e_clean_adminq_subtask.
> 
> This change allows i40e_print_link_message() to be called when interface is
> going down and keeps the state information updated.
> 
> Signed-off-by: Mogilappagari, Sudheer <sudheer.mogilappagari@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index beeeeeb..b4844e2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6406,8 +6406,7 @@  static void i40e_link_event(struct i40e_pf *pf)
 	     new_link == netif_carrier_ok(vsi->netdev)))
 		return;
 
-	if (!test_bit(__I40E_VSI_DOWN, vsi->state))
-		i40e_print_link_message(vsi, new_link);
+	i40e_print_link_message(vsi, new_link);
 
 	/* Notify the base of the switch tree connected to
 	 * the link.  Floating VEBs are not notified.