diff options
| -rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index c50a7541ffec..3a93a81872b8 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
| @@ -2077,25 +2077,6 @@ static int ixgbe_get_coalesce(struct net_device *netdev, | |||
| 2077 | return 0; | 2077 | return 0; |
| 2078 | } | 2078 | } |
| 2079 | 2079 | ||
| 2080 | /* | ||
| 2081 | * this function must be called before setting the new value of | ||
| 2082 | * rx_itr_setting | ||
| 2083 | */ | ||
| 2084 | static bool ixgbe_reenable_rsc(struct ixgbe_adapter *adapter, | ||
| 2085 | struct ethtool_coalesce *ec) | ||
| 2086 | { | ||
| 2087 | /* check the old value and enable RSC if necessary */ | ||
| 2088 | if ((adapter->rx_itr_setting == 0) && | ||
| 2089 | (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)) { | ||
| 2090 | adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED; | ||
| 2091 | adapter->netdev->features |= NETIF_F_LRO; | ||
| 2092 | DPRINTK(PROBE, INFO, "rx-usecs set to %d, re-enabling RSC\n", | ||
| 2093 | ec->rx_coalesce_usecs); | ||
| 2094 | return true; | ||
| 2095 | } | ||
| 2096 | return false; | ||
| 2097 | } | ||
| 2098 | |||
| 2099 | static int ixgbe_set_coalesce(struct net_device *netdev, | 2080 | static int ixgbe_set_coalesce(struct net_device *netdev, |
| 2100 | struct ethtool_coalesce *ec) | 2081 | struct ethtool_coalesce *ec) |
| 2101 | { | 2082 | { |
| @@ -2124,9 +2105,6 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
| 2124 | (1000000/ec->rx_coalesce_usecs < IXGBE_MIN_INT_RATE)) | 2105 | (1000000/ec->rx_coalesce_usecs < IXGBE_MIN_INT_RATE)) |
| 2125 | return -EINVAL; | 2106 | return -EINVAL; |
| 2126 | 2107 | ||
| 2127 | /* check the old value and enable RSC if necessary */ | ||
| 2128 | need_reset = ixgbe_reenable_rsc(adapter, ec); | ||
| 2129 | |||
| 2130 | /* store the value in ints/second */ | 2108 | /* store the value in ints/second */ |
| 2131 | adapter->rx_eitr_param = 1000000/ec->rx_coalesce_usecs; | 2109 | adapter->rx_eitr_param = 1000000/ec->rx_coalesce_usecs; |
| 2132 | 2110 | ||
| @@ -2135,9 +2113,6 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
| 2135 | /* clear the lower bit as its used for dynamic state */ | 2113 | /* clear the lower bit as its used for dynamic state */ |
| 2136 | adapter->rx_itr_setting &= ~1; | 2114 | adapter->rx_itr_setting &= ~1; |
| 2137 | } else if (ec->rx_coalesce_usecs == 1) { | 2115 | } else if (ec->rx_coalesce_usecs == 1) { |
| 2138 | /* check the old value and enable RSC if necessary */ | ||
| 2139 | need_reset = ixgbe_reenable_rsc(adapter, ec); | ||
| 2140 | |||
| 2141 | /* 1 means dynamic mode */ | 2116 | /* 1 means dynamic mode */ |
| 2142 | adapter->rx_eitr_param = 20000; | 2117 | adapter->rx_eitr_param = 20000; |
| 2143 | adapter->rx_itr_setting = 1; | 2118 | adapter->rx_itr_setting = 1; |
| @@ -2157,10 +2132,11 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
| 2157 | */ | 2132 | */ |
| 2158 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { | 2133 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { |
| 2159 | adapter->flags2 &= ~IXGBE_FLAG2_RSC_ENABLED; | 2134 | adapter->flags2 &= ~IXGBE_FLAG2_RSC_ENABLED; |
| 2160 | netdev->features &= ~NETIF_F_LRO; | 2135 | if (netdev->features & NETIF_F_LRO) { |
| 2161 | DPRINTK(PROBE, INFO, | 2136 | netdev->features &= ~NETIF_F_LRO; |
| 2162 | "rx-usecs set to 0, disabling RSC\n"); | 2137 | DPRINTK(PROBE, INFO, "rx-usecs set to 0, " |
| 2163 | 2138 | "disabling LRO/RSC\n"); | |
| 2139 | } | ||
| 2164 | need_reset = true; | 2140 | need_reset = true; |
| 2165 | } | 2141 | } |
| 2166 | } | 2142 | } |
| @@ -2255,6 +2231,9 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data) | |||
| 2255 | } | 2231 | } |
| 2256 | } else if (!adapter->rx_itr_setting) { | 2232 | } else if (!adapter->rx_itr_setting) { |
| 2257 | netdev->features &= ~ETH_FLAG_LRO; | 2233 | netdev->features &= ~ETH_FLAG_LRO; |
| 2234 | if (data & ETH_FLAG_LRO) | ||
| 2235 | DPRINTK(PROBE, INFO, "rx-usecs set to 0, " | ||
| 2236 | "LRO/RSC cannot be enabled.\n"); | ||
| 2258 | } | 2237 | } |
| 2259 | } | 2238 | } |
| 2260 | 2239 | ||
