ixgbevf: Check if EOP has changed before using it
There is a chance that between the time EOP is read and the time it is used another transmit on a different CPU could have run and completed, thus leaving EOP in a bad state. Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
dc22129471
commit
98b9e48fca
|
@ -203,6 +203,9 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_adapter *adapter,
|
||||||
(count < tx_ring->work_limit)) {
|
(count < tx_ring->work_limit)) {
|
||||||
bool cleaned = false;
|
bool cleaned = false;
|
||||||
rmb(); /* read buffer_info after eop_desc */
|
rmb(); /* read buffer_info after eop_desc */
|
||||||
|
/* eop could change between read and DD-check */
|
||||||
|
if (unlikely(eop != tx_ring->tx_buffer_info[i].next_to_watch))
|
||||||
|
goto cont_loop;
|
||||||
for ( ; !cleaned; count++) {
|
for ( ; !cleaned; count++) {
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, i);
|
tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, i);
|
||||||
|
@ -232,6 +235,7 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_adapter *adapter,
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cont_loop:
|
||||||
eop = tx_ring->tx_buffer_info[i].next_to_watch;
|
eop = tx_ring->tx_buffer_info[i].next_to_watch;
|
||||||
eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop);
|
eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue