aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 583cc5a3c4f9..1c110459d33b 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -283,6 +283,7 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
283{ 283{
284 struct ixgbe_adapter *adapter = netdev_priv(netdev); 284 struct ixgbe_adapter *adapter = netdev_priv(netdev);
285 struct ixgbe_hw *hw = &adapter->hw; 285 struct ixgbe_hw *hw = &adapter->hw;
286 struct ixgbe_fc_info fc;
286 287
287#ifdef CONFIG_DCB 288#ifdef CONFIG_DCB
288 if (adapter->dcb_cfg.pfc_mode_enable || 289 if (adapter->dcb_cfg.pfc_mode_enable ||
@@ -291,26 +292,37 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
291 return -EINVAL; 292 return -EINVAL;
292 293
293#endif 294#endif
295
296 fc = hw->fc;
297
294 if (pause->autoneg != AUTONEG_ENABLE) 298 if (pause->autoneg != AUTONEG_ENABLE)
295 hw->fc.disable_fc_autoneg = true; 299 fc.disable_fc_autoneg = true;
296 else 300 else
297 hw->fc.disable_fc_autoneg = false; 301 fc.disable_fc_autoneg = false;
298 302
299 if (pause->rx_pause && pause->tx_pause) 303 if (pause->rx_pause && pause->tx_pause)
300 hw->fc.requested_mode = ixgbe_fc_full; 304 fc.requested_mode = ixgbe_fc_full;
301 else if (pause->rx_pause && !pause->tx_pause) 305 else if (pause->rx_pause && !pause->tx_pause)
302 hw->fc.requested_mode = ixgbe_fc_rx_pause; 306 fc.requested_mode = ixgbe_fc_rx_pause;
303 else if (!pause->rx_pause && pause->tx_pause) 307 else if (!pause->rx_pause && pause->tx_pause)
304 hw->fc.requested_mode = ixgbe_fc_tx_pause; 308 fc.requested_mode = ixgbe_fc_tx_pause;
305 else if (!pause->rx_pause && !pause->tx_pause) 309 else if (!pause->rx_pause && !pause->tx_pause)
306 hw->fc.requested_mode = ixgbe_fc_none; 310 fc.requested_mode = ixgbe_fc_none;
307 else 311 else
308 return -EINVAL; 312 return -EINVAL;
309 313
310#ifdef CONFIG_DCB 314#ifdef CONFIG_DCB
311 adapter->last_lfc_mode = hw->fc.requested_mode; 315 adapter->last_lfc_mode = fc.requested_mode;
312#endif 316#endif
313 hw->mac.ops.setup_fc(hw, 0); 317
318 /* if the thing changed then we'll update and use new autoneg */
319 if (memcmp(&fc, &hw->fc, sizeof(struct ixgbe_fc_info))) {
320 hw->fc = fc;
321 if (netif_running(netdev))
322 ixgbe_reinit_locked(adapter);
323 else
324 ixgbe_reset(adapter);
325 }
314 326
315 return 0; 327 return 0;
316} 328}