diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2009-03-31 17:35:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-02 04:02:32 -0400 |
commit | 71fd570b23ee74bca052beb9e88f8f57fb668ac7 (patch) | |
tree | 8b5bdc6a968da24553eed355e38faaaf0bc61c1e /drivers | |
parent | a20a1199a8a7f2bc92bd2a01e212980328e42bc7 (diff) |
ixgbe: fix ethtool -A|a behavior
We were basicly ignoring ethtool users request for FC autoneg
and replying to queries with a "best guess". This patch
enables the driver to store if we want to enable/disable
autoneg FC and do the correct behavior.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82598.c | 3 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_common.c | 3 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 19 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 2 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 1 |
5 files changed, 23 insertions, 5 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index ed265a7a898f..de4db0dc7879 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -411,7 +411,8 @@ static s32 ixgbe_setup_fc_82598(struct ixgbe_hw *hw, s32 packetbuf_num) | |||
411 | 411 | ||
412 | /* Decide whether to use autoneg or not. */ | 412 | /* Decide whether to use autoneg or not. */ |
413 | hw->mac.ops.check_link(hw, &speed, &link_up, false); | 413 | hw->mac.ops.check_link(hw, &speed, &link_up, false); |
414 | if (hw->phy.multispeed_fiber && (speed == IXGBE_LINK_SPEED_1GB_FULL)) | 414 | if (!hw->fc.disable_fc_autoneg && hw->phy.multispeed_fiber && |
415 | (speed == IXGBE_LINK_SPEED_1GB_FULL)) | ||
415 | ret_val = ixgbe_fc_autoneg(hw); | 416 | ret_val = ixgbe_fc_autoneg(hw); |
416 | 417 | ||
417 | if (ret_val) | 418 | if (ret_val) |
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index 8cfd3fd309a0..63ab6671d08e 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -1937,7 +1937,8 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw, s32 packetbuf_num) | |||
1937 | 1937 | ||
1938 | /* Decide whether to use autoneg or not. */ | 1938 | /* Decide whether to use autoneg or not. */ |
1939 | hw->mac.ops.check_link(hw, &speed, &link_up, false); | 1939 | hw->mac.ops.check_link(hw, &speed, &link_up, false); |
1940 | if (hw->phy.multispeed_fiber && (speed == IXGBE_LINK_SPEED_1GB_FULL)) | 1940 | if (!hw->fc.disable_fc_autoneg && hw->phy.multispeed_fiber && |
1941 | (speed == IXGBE_LINK_SPEED_1GB_FULL)) | ||
1941 | ret_val = ixgbe_fc_autoneg(hw); | 1942 | ret_val = ixgbe_fc_autoneg(hw); |
1942 | 1943 | ||
1943 | if (ret_val) | 1944 | if (ret_val) |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 34b4a84d2e77..55970ec72de3 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -234,7 +234,16 @@ static void ixgbe_get_pauseparam(struct net_device *netdev, | |||
234 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 234 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
235 | struct ixgbe_hw *hw = &adapter->hw; | 235 | struct ixgbe_hw *hw = &adapter->hw; |
236 | 236 | ||
237 | pause->autoneg = (hw->fc.current_mode == ixgbe_fc_full ? 1 : 0); | 237 | /* |
238 | * Flow Control Autoneg isn't on if | ||
239 | * - we didn't ask for it OR | ||
240 | * - it failed, we know this by tx & rx being off | ||
241 | */ | ||
242 | if (hw->fc.disable_fc_autoneg || | ||
243 | (hw->fc.current_mode == ixgbe_fc_none)) | ||
244 | pause->autoneg = 0; | ||
245 | else | ||
246 | pause->autoneg = 1; | ||
238 | 247 | ||
239 | if (hw->fc.current_mode == ixgbe_fc_rx_pause) { | 248 | if (hw->fc.current_mode == ixgbe_fc_rx_pause) { |
240 | pause->rx_pause = 1; | 249 | pause->rx_pause = 1; |
@@ -252,8 +261,12 @@ static int ixgbe_set_pauseparam(struct net_device *netdev, | |||
252 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 261 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
253 | struct ixgbe_hw *hw = &adapter->hw; | 262 | struct ixgbe_hw *hw = &adapter->hw; |
254 | 263 | ||
255 | if ((pause->autoneg == AUTONEG_ENABLE) || | 264 | if (pause->autoneg != AUTONEG_ENABLE) |
256 | (pause->rx_pause && pause->tx_pause)) | 265 | hw->fc.disable_fc_autoneg = true; |
266 | else | ||
267 | hw->fc.disable_fc_autoneg = false; | ||
268 | |||
269 | if (pause->rx_pause && pause->tx_pause) | ||
257 | hw->fc.requested_mode = ixgbe_fc_full; | 270 | hw->fc.requested_mode = ixgbe_fc_full; |
258 | else if (pause->rx_pause && !pause->tx_pause) | 271 | else if (pause->rx_pause && !pause->tx_pause) |
259 | hw->fc.requested_mode = ixgbe_fc_rx_pause; | 272 | hw->fc.requested_mode = ixgbe_fc_rx_pause; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index ae2af45eb8f1..286ecc0e6ab7 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3167,10 +3167,12 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
3167 | 3167 | ||
3168 | /* default flow control settings */ | 3168 | /* default flow control settings */ |
3169 | hw->fc.requested_mode = ixgbe_fc_full; | 3169 | hw->fc.requested_mode = ixgbe_fc_full; |
3170 | hw->fc.current_mode = ixgbe_fc_full; /* init for ethtool output */ | ||
3170 | hw->fc.high_water = IXGBE_DEFAULT_FCRTH; | 3171 | hw->fc.high_water = IXGBE_DEFAULT_FCRTH; |
3171 | hw->fc.low_water = IXGBE_DEFAULT_FCRTL; | 3172 | hw->fc.low_water = IXGBE_DEFAULT_FCRTL; |
3172 | hw->fc.pause_time = IXGBE_DEFAULT_FCPAUSE; | 3173 | hw->fc.pause_time = IXGBE_DEFAULT_FCPAUSE; |
3173 | hw->fc.send_xon = true; | 3174 | hw->fc.send_xon = true; |
3175 | hw->fc.disable_fc_autoneg = false; | ||
3174 | 3176 | ||
3175 | /* enable itr by default in dynamic mode */ | 3177 | /* enable itr by default in dynamic mode */ |
3176 | adapter->itr_setting = 1; | 3178 | adapter->itr_setting = 1; |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 2b2ecba7b609..030ff0a9ea67 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -2005,6 +2005,7 @@ struct ixgbe_fc_info { | |||
2005 | u16 pause_time; /* Flow Control Pause timer */ | 2005 | u16 pause_time; /* Flow Control Pause timer */ |
2006 | bool send_xon; /* Flow control send XON */ | 2006 | bool send_xon; /* Flow control send XON */ |
2007 | bool strict_ieee; /* Strict IEEE mode */ | 2007 | bool strict_ieee; /* Strict IEEE mode */ |
2008 | bool disable_fc_autoneg; /* Turn off autoneg FC mode */ | ||
2008 | enum ixgbe_fc_mode current_mode; /* FC mode in effect */ | 2009 | enum ixgbe_fc_mode current_mode; /* FC mode in effect */ |
2009 | enum ixgbe_fc_mode requested_mode; /* FC mode requested by caller */ | 2010 | enum ixgbe_fc_mode requested_mode; /* FC mode requested by caller */ |
2010 | }; | 2011 | }; |