diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2018-12-19 13:03:26 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2019-01-15 13:32:59 -0500 |
commit | ab4ab73fc1ec6dec548fa36c5e383ef5faa7b4c1 (patch) | |
tree | 8dcbc39d30188abbf54dfc20b8f8f52358c2316f /drivers/net/ethernet/intel/ice/ice_main.c | |
parent | b6f934f027bbdb53b7e2653b23758e222f3dd65a (diff) |
ice: Add ethtool private flag to make forcing link down optional
Add new infrastructure for implementing ethtool private flags using the
existing pf->flags bitmap to store them, and add the link-down-on-close
ethtool private flag to optionally bring down the PHY link when the
interface is administratively downed.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@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, 8 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index b27bc7d6d605..e36db981f047 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c | |||
@@ -3029,7 +3029,7 @@ out: | |||
3029 | */ | 3029 | */ |
3030 | int ice_down(struct ice_vsi *vsi) | 3030 | int ice_down(struct ice_vsi *vsi) |
3031 | { | 3031 | { |
3032 | int i, tx_err, rx_err, link_err; | 3032 | int i, tx_err, rx_err, link_err = 0; |
3033 | 3033 | ||
3034 | /* Caller of this function is expected to set the | 3034 | /* Caller of this function is expected to set the |
3035 | * vsi->state __ICE_DOWN bit | 3035 | * vsi->state __ICE_DOWN bit |
@@ -3054,11 +3054,13 @@ int ice_down(struct ice_vsi *vsi) | |||
3054 | 3054 | ||
3055 | ice_napi_disable_all(vsi); | 3055 | ice_napi_disable_all(vsi); |
3056 | 3056 | ||
3057 | link_err = ice_force_phys_link_state(vsi, false); | 3057 | if (test_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, vsi->back->flags)) { |
3058 | if (link_err) | 3058 | link_err = ice_force_phys_link_state(vsi, false); |
3059 | netdev_err(vsi->netdev, | 3059 | if (link_err) |
3060 | "Failed to set physical link down, VSI %d error %d\n", | 3060 | netdev_err(vsi->netdev, |
3061 | vsi->vsi_num, link_err); | 3061 | "Failed to set physical link down, VSI %d error %d\n", |
3062 | vsi->vsi_num, link_err); | ||
3063 | } | ||
3062 | 3064 | ||
3063 | ice_for_each_txq(vsi, i) | 3065 | ice_for_each_txq(vsi, i) |
3064 | ice_clean_tx_ring(vsi->tx_rings[i]); | 3066 | ice_clean_tx_ring(vsi->tx_rings[i]); |