aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2006-03-02 21:17:16 -0500
committerroot <root@jk-desktop.jf.intel.com>2006-03-02 21:17:16 -0500
commit0989aa431636ffb347314f0e2f367fdd16d7a57f (patch)
treeb5890adc27313a97abe920fdfabf3f8e32b4bc7f /drivers/net/e1000
parent9f644d518f35903ecaff062d6e9e4f7080d80cfb (diff)
e1000: Fix lock up while setting ring parameters
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: John Ronciak <john.ronciak@intel.com>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000_ethtool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 9c77413faf0c..f7e81e96a191 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -634,6 +634,9 @@ e1000_set_ringparam(struct net_device *netdev,
634 struct e1000_rx_ring *rxdr, *rx_old, *rx_new; 634 struct e1000_rx_ring *rxdr, *rx_old, *rx_new;
635 int i, err, tx_ring_size, rx_ring_size; 635 int i, err, tx_ring_size, rx_ring_size;
636 636
637 if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
638 return -EINVAL;
639
637 tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues; 640 tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues;
638 rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues; 641 rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues;
639 642
@@ -661,9 +664,6 @@ e1000_set_ringparam(struct net_device *netdev,
661 txdr = adapter->tx_ring; 664 txdr = adapter->tx_ring;
662 rxdr = adapter->rx_ring; 665 rxdr = adapter->rx_ring;
663 666
664 if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
665 return -EINVAL;
666
667 rxdr->count = max(ring->rx_pending,(uint32_t)E1000_MIN_RXD); 667 rxdr->count = max(ring->rx_pending,(uint32_t)E1000_MIN_RXD);
668 rxdr->count = min(rxdr->count,(uint32_t)(mac_type < e1000_82544 ? 668 rxdr->count = min(rxdr->count,(uint32_t)(mac_type < e1000_82544 ?
669 E1000_MAX_RXD : E1000_MAX_82544_RXD)); 669 E1000_MAX_RXD : E1000_MAX_82544_RXD));