From: Bruce Allan Date: Thu, 19 Nov 2009 12:35:08 +0000 (+0000) Subject: e1000e: set flow control thresholds properly after enabling/disabling pause X-Git-Tag: v2.6.32~30^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29afd690636dab36fe437c54b3a9d5e093bdcd9b;p=profile%2Fcommon%2Fkernel-common.git e1000e: set flow control thresholds properly after enabling/disabling pause When flow control (pause) parameters were changed via ethtool (i.e. enabled or disabled), the newly calculated thresholds were not being written to the device for non-fiber media. Signed-off-by: Bruce Allan Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 1bf4d2a..e82638e 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c @@ -327,10 +327,18 @@ static int e1000_set_pauseparam(struct net_device *netdev, hw->fc.current_mode = hw->fc.requested_mode; - retval = ((hw->phy.media_type == e1000_media_type_fiber) ? - hw->mac.ops.setup_link(hw) : e1000e_force_mac_fc(hw)); + if (hw->phy.media_type == e1000_media_type_fiber) { + retval = hw->mac.ops.setup_link(hw); + /* implicit goto out */ + } else { + retval = e1000e_force_mac_fc(hw); + if (retval) + goto out; + e1000e_set_fc_watermarks(hw); + } } +out: clear_bit(__E1000_RESETTING, &adapter->state); return retval; }