On Mon, 26 Feb 2018 13:39:25 -0800, Jeff Kirsher wrote: > From: Mariusz Stachura <mariusz.stach...@intel.com> > > 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 <kubak...@wp.pl> > Signed-off-by: Mariusz Stachura <mariusz.stach...@intel.com> > Signed-off-by: Mitch Williams <mitch.a.willi...@intel.com> > Tested-by: Andrew Bowers <andrewx.bow...@intel.com> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirs...@intel.com>
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. > @@ -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...