Thread (12 messages) 12 messages, 4 authors, 2018-02-28

Re: [net-next 1/7] i40e: link_down_on_close private flag support

From: Jakub Kicinski <hidden>
Date: 2018-02-27 02:19:57

On Mon, 26 Feb 2018 13:39:25 -0800, Jeff Kirsher wrote:
From: Mariusz Stachura <redacted>

This patch introduces new ethtool private flag used for
forcing true link state. Function i40e_force_link_state that implements
this functionality was added, it sets phy_type = 0 in order to
work-around firmware's LESM. False positive error messages were
suppressed.

The ndo_open() should not succeed if there were issues with forcing link
state to be UP.

Added I40E_PHY_TYPES_BITMASK define with all phy types OR-ed together in
one bitmask.  Added after phy type definition, so it will be hard to
forget to include new phy types to the bitmask.

CC: Jakub Kicinski <redacted>
Signed-off-by: Mariusz Stachura <redacted>
Signed-off-by: Mitch Williams <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
Thanks, from functional perspective this looks reasonable AFAICT.

We may want to have a conversation about priv flags like this at later
time, since I guess more NICs won't bring the link down when netdev is
closed today..  Although it maybe a larger endeavour, perhaps it would 
be cool to communicate to the user the reason why MAC/PHY is on in some
standard way..  NC-SI and multi-host comes to mind.  
quoted hunk ↗ jump to hunk
@@ -7524,6 +7596,9 @@ int i40e_open(struct net_device *netdev)
 
 	netif_carrier_off(netdev);
 
+	if (i40e_force_link_state(pf, true))
+		return -EAGAIN;
There are some minor style issues with the rest of the patch, but here
you may want to (a) propagate the actual error value;
 	err = i40e_vsi_open(vsi);
 	if (err)
 		return err;
(b) undo the link state if vsi_open() fails.

Maybe that's a bit of a nitpick...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help