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>
This commit is contained in:
parent
9f644d518f
commit
0989aa4316
|
@ -634,6 +634,9 @@ e1000_set_ringparam(struct net_device *netdev,
|
||||||
struct e1000_rx_ring *rxdr, *rx_old, *rx_new;
|
struct e1000_rx_ring *rxdr, *rx_old, *rx_new;
|
||||||
int i, err, tx_ring_size, rx_ring_size;
|
int i, err, tx_ring_size, rx_ring_size;
|
||||||
|
|
||||||
|
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues;
|
tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues;
|
||||||
rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues;
|
rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues;
|
||||||
|
|
||||||
|
@ -661,9 +664,6 @@ e1000_set_ringparam(struct net_device *netdev,
|
||||||
txdr = adapter->tx_ring;
|
txdr = adapter->tx_ring;
|
||||||
rxdr = adapter->rx_ring;
|
rxdr = adapter->rx_ring;
|
||||||
|
|
||||||
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
rxdr->count = max(ring->rx_pending,(uint32_t)E1000_MIN_RXD);
|
rxdr->count = max(ring->rx_pending,(uint32_t)E1000_MIN_RXD);
|
||||||
rxdr->count = min(rxdr->count,(uint32_t)(mac_type < e1000_82544 ?
|
rxdr->count = min(rxdr->count,(uint32_t)(mac_type < e1000_82544 ?
|
||||||
E1000_MAX_RXD : E1000_MAX_82544_RXD));
|
E1000_MAX_RXD : E1000_MAX_82544_RXD));
|
||||||
|
|
Loading…
Reference in New Issue