From: Alexander Duyck Date: Wed, 8 Feb 2012 07:49:23 +0000 (+0000) Subject: ixgbe: Do no clear Tx status bits since eop_desc provides enough info X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~106 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2c0df0a6f09d3c48dc240edea65e33b392179941;p=users%2Fjedix%2Flinux-maple.git ixgbe: Do no clear Tx status bits since eop_desc provides enough info There isn't any need to clear the status bits in the descriptors due to the fact that the eop_desc provides enough information for us to know that we have cleaned to the last packet that the software has put on the ring. The status bits are cleared as a part of putting the frame on the ring so as long as we do not read the descriptor bit prior to reading the value eop_desc we should be able to guarantee that we will not clean beyond the end of the current data stream. (cherry picked from commit 7f83a9e6292b49d1540f82f295ac8710ba562c5f) Signed-off-by: Alexander Duyck Tested-by: Stephen Ko Signed-off-by: Jeff Kirsher Signed-off-by: Joe Jin --- diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index f46e41244076..2cd718676076 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -760,6 +760,9 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, if (!eop_desc) break; + /* prevent any other reads prior to eop_desc */ + rmb(); + /* if DD is not set pending work has not been completed */ if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD))) break; @@ -770,12 +773,8 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, /* clear next_to_watch to prevent false hangs */ tx_buffer->next_to_watch = NULL; - /* prevent any other reads prior to eop_desc being verified */ - rmb(); - do { ixgbe_unmap_tx_resource(tx_ring, tx_buffer); - tx_desc->wb.status = 0; if (likely(tx_desc == eop_desc)) { eop_desc = NULL; dev_kfree_skb_any(tx_buffer->skb);