Skip to contentSkip to conversation

e1000e: stop cleaning when we reach tx_ring->next_to_use

PATCH Applied Jeff Kirsher 2 participants 2 messages Apr 9, 2010 – Apr 13, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000e: stop cleaning when we reach tx_ring->next_to_use

From: Terry Loftin <[email protected]>

Tx ring buffers after tx_ring->next_to_use are volatile and could change, possibly causing a crash. Stop cleaning when we hit tx_ring->next_to_use.

---

 drivers/net/e1000e/netdev.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/e1000e/netdev.c +2 -0
index e1cceb6..60288e4 100644
@@ -660,6 +660,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
 				i = 0;
 		}
 
+		if (i == tx_ring->next_to_use)
+			break;
 		eop = tx_ring->buffer_info[i].next_to_watch;
 		eop_desc = E1000_TX_DESC(*tx_ring, eop);
 	}