diff options
author | David S. Miller <davem@davemloft.net> | 2009-10-27 04:03:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-27 04:03:26 -0400 |
commit | cfadf853f6cd9689f79a63ca960c6f9d6665314f (patch) | |
tree | 35418e342d9783f0974ea33ef03875aa21d2362a /drivers/net/ixgbe | |
parent | 05423b241311c9380b7280179295bac7794281b6 (diff) | |
parent | f568a926a353d6816b3704d7367f34371df44ce7 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/sh_eth.c
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 08eccf418c67..9d2cc833691b 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -806,7 +806,7 @@ static int ixgbe_set_ringparam(struct net_device *netdev, | |||
806 | { | 806 | { |
807 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 807 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
808 | struct ixgbe_ring *temp_tx_ring, *temp_rx_ring; | 808 | struct ixgbe_ring *temp_tx_ring, *temp_rx_ring; |
809 | int i, err; | 809 | int i, err = 0; |
810 | u32 new_rx_count, new_tx_count; | 810 | u32 new_rx_count, new_tx_count; |
811 | bool need_update = false; | 811 | bool need_update = false; |
812 | 812 | ||
@@ -830,6 +830,16 @@ static int ixgbe_set_ringparam(struct net_device *netdev, | |||
830 | while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state)) | 830 | while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state)) |
831 | msleep(1); | 831 | msleep(1); |
832 | 832 | ||
833 | if (!netif_running(adapter->netdev)) { | ||
834 | for (i = 0; i < adapter->num_tx_queues; i++) | ||
835 | adapter->tx_ring[i].count = new_tx_count; | ||
836 | for (i = 0; i < adapter->num_rx_queues; i++) | ||
837 | adapter->rx_ring[i].count = new_rx_count; | ||
838 | adapter->tx_ring_count = new_tx_count; | ||
839 | adapter->rx_ring_count = new_rx_count; | ||
840 | goto err_setup; | ||
841 | } | ||
842 | |||
833 | temp_tx_ring = kcalloc(adapter->num_tx_queues, | 843 | temp_tx_ring = kcalloc(adapter->num_tx_queues, |
834 | sizeof(struct ixgbe_ring), GFP_KERNEL); | 844 | sizeof(struct ixgbe_ring), GFP_KERNEL); |
835 | if (!temp_tx_ring) { | 845 | if (!temp_tx_ring) { |
@@ -887,8 +897,7 @@ static int ixgbe_set_ringparam(struct net_device *netdev, | |||
887 | 897 | ||
888 | /* if rings need to be updated, here's the place to do it in one shot */ | 898 | /* if rings need to be updated, here's the place to do it in one shot */ |
889 | if (need_update) { | 899 | if (need_update) { |
890 | if (netif_running(netdev)) | 900 | ixgbe_down(adapter); |
891 | ixgbe_down(adapter); | ||
892 | 901 | ||
893 | /* tx */ | 902 | /* tx */ |
894 | if (new_tx_count != adapter->tx_ring_count) { | 903 | if (new_tx_count != adapter->tx_ring_count) { |
@@ -905,13 +914,8 @@ static int ixgbe_set_ringparam(struct net_device *netdev, | |||
905 | temp_rx_ring = NULL; | 914 | temp_rx_ring = NULL; |
906 | adapter->rx_ring_count = new_rx_count; | 915 | adapter->rx_ring_count = new_rx_count; |
907 | } | 916 | } |
908 | } | ||
909 | |||
910 | /* success! */ | ||
911 | err = 0; | ||
912 | if (netif_running(netdev)) | ||
913 | ixgbe_up(adapter); | 917 | ixgbe_up(adapter); |
914 | 918 | } | |
915 | err_setup: | 919 | err_setup: |
916 | clear_bit(__IXGBE_RESETTING, &adapter->state); | 920 | clear_bit(__IXGBE_RESETTING, &adapter->state); |
917 | return err; | 921 | return err; |