aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2011-05-12 22:22:40 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-06-24 01:45:44 -0400
commit3a28926451a22a2b699962e738c8540da642c319 (patch)
treeea1b8dfe33ae2cfcc8c376edf5505dd11ed6c67a /drivers/net/ixgbe/ixgbe_ethtool.c
parente4911d57a45ca30771c64b56e552891fcd105070 (diff)
ixgbe: move setting RSC into a separate function
Move setting RSC into a separate function to allow for reuse in other parts of the code. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 2965b6e7728b..405c5ba1d561 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -459,6 +459,21 @@ static int ixgbe_set_rx_csum(struct net_device *netdev, u32 data)
459 return 0; 459 return 0;
460} 460}
461 461
462static void ixgbe_set_rsc(struct ixgbe_adapter *adapter)
463{
464 int i;
465
466 for (i = 0; i < adapter->num_rx_queues; i++) {
467 struct ixgbe_ring *ring = adapter->rx_ring[i];
468 if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
469 set_ring_rsc_enabled(ring);
470 ixgbe_configure_rscctl(adapter, ring);
471 } else {
472 ixgbe_clear_rscctl(adapter, ring);
473 }
474 }
475}
476
462static u32 ixgbe_get_tx_csum(struct net_device *netdev) 477static u32 ixgbe_get_tx_csum(struct net_device *netdev)
463{ 478{
464 return (netdev->features & NETIF_F_IP_CSUM) != 0; 479 return (netdev->features & NETIF_F_IP_CSUM) != 0;
@@ -2281,25 +2296,12 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data)
2281 } else { 2296 } else {
2282 adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED; 2297 adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED;
2283 switch (adapter->hw.mac.type) { 2298 switch (adapter->hw.mac.type) {
2299 case ixgbe_mac_X540:
2300 ixgbe_set_rsc(adapter);
2301 break;
2284 case ixgbe_mac_82599EB: 2302 case ixgbe_mac_82599EB:
2285 need_reset = true; 2303 need_reset = true;
2286 break; 2304 break;
2287 case ixgbe_mac_X540: {
2288 int i;
2289 for (i = 0; i < adapter->num_rx_queues; i++) {
2290 struct ixgbe_ring *ring =
2291 adapter->rx_ring[i];
2292 if (adapter->flags2 &
2293 IXGBE_FLAG2_RSC_ENABLED) {
2294 ixgbe_configure_rscctl(adapter,
2295 ring);
2296 } else {
2297 ixgbe_clear_rscctl(adapter,
2298 ring);
2299 }
2300 }
2301 }
2302 break;
2303 default: 2305 default:
2304 break; 2306 break;
2305 } 2307 }