diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2020-07-09 09:16:08 -0700 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2020-07-23 15:26:09 -0700 |
commit | b4e813dd04e87610503f1972ecd74d87ea062be9 (patch) | |
tree | 3f21f51ff0daefad9bb4e116beabb45115628047 /drivers/net/ethernet/intel/ice/ice_main.c | |
parent | ea78ce4dab05f435b1eff178a5b79d98e1847b2d (diff) |
ice: support Total Port Shutdown on devices that support it
When the Port Disable bit is set in the Link Default Override Mask TLV PFA
module in the NVM, Total Port Shutdown mode is supported and enabled. In
this mode, the driver should act as if the link-down-on-close ethtool
private flag is always enabled and dis-allow any change to that flag.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_main.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 9580c6096e56..c8c570f95b92 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -1446,6 +1446,8 @@ out: /** * ice_init_link_dflt_override - Initialize link default override * @pi: port info structure + * + * Initialize link default override and PHY total port shutdown during probe */ static void ice_init_link_dflt_override(struct ice_port_info *pi) { @@ -1453,7 +1455,17 @@ static void ice_init_link_dflt_override(struct ice_port_info *pi) struct ice_pf *pf = pi->hw->back; ldo = &pf->link_dflt_override; - ice_get_link_default_override(ldo, pi); + if (ice_get_link_default_override(ldo, pi)) + return; + + if (!(ldo->options & ICE_LINK_OVERRIDE_PORT_DIS)) + return; + + /* Enable Total Port Shutdown (override/replace link-down-on-close + * ethtool private flag) for ports with Port Disable bit set. + */ + set_bit(ICE_FLAG_TOTAL_PORT_SHUTDOWN_ENA, pf->flags); + set_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, pf->flags); } /** |