* [net-2.6 PATCH 1/2] e1000e: fix bug in restart queue logic
@ 2009-04-17 2:59 Jeff Kirsher
2009-04-17 2:59 ` [net-2.6 PATCH 2/2] e1000: fix transmit routine exit bug Jeff Kirsher
2009-04-17 8:10 ` [net-2.6 PATCH 1/2] e1000e: fix bug in restart queue logic David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Jeff Kirsher @ 2009-04-17 2:59 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jesse Brandeburg, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
If the e1000e transmit cleanup inner loop exited early, then
cleaned might not be true. This could cause tx hangs or other
badness. Use count to track the total number of descriptors
cleaned instead of basing a tx queue restart off of a temporary
working state variable.
This code now makes the flow the same for e1000/e1000e/igb/ixgbe
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000e/netdev.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 1693ed1..ca82f19 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -621,7 +621,6 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
struct e1000_buffer *buffer_info;
unsigned int i, eop;
unsigned int count = 0;
- bool cleaned = false;
unsigned int total_tx_bytes = 0, total_tx_packets = 0;
i = tx_ring->next_to_clean;
@@ -630,7 +629,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) &&
(count < tx_ring->count)) {
- for (cleaned = 0; !cleaned; count++) {
+ bool cleaned = false;
+ for (; !cleaned; count++) {
tx_desc = E1000_TX_DESC(*tx_ring, i);
buffer_info = &tx_ring->buffer_info[i];
cleaned = (i == eop);
@@ -661,8 +661,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
tx_ring->next_to_clean = i;
#define TX_WAKE_THRESHOLD 32
- if (cleaned && netif_carrier_ok(netdev) &&
- e1000_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD) {
+ if (count && netif_carrier_ok(netdev) &&
+ e1000_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD) {
/* Make sure that anybody stopping the queue after this
* sees the new next_to_clean.
*/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [net-2.6 PATCH 2/2] e1000: fix transmit routine exit bug
2009-04-17 2:59 [net-2.6 PATCH 1/2] e1000e: fix bug in restart queue logic Jeff Kirsher
@ 2009-04-17 2:59 ` Jeff Kirsher
2009-04-17 8:10 ` David Miller
2009-04-17 8:10 ` [net-2.6 PATCH 1/2] e1000e: fix bug in restart queue logic David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Jeff Kirsher @ 2009-04-17 2:59 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jesse Brandeburg, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
If the e1000 transmit cleanup inner loop exited early, then
cleaned might not be true. This could cause tx hangs or other
badness. Use count to track the total number of descriptors
cleaned instead of basing a tx queue restart off of a temporary
working state variable.
This code now makes the flow the same for e1000/e1000e/igb/ixgbe
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000/e1000_main.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index ef12931..6a46cee 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3834,7 +3834,6 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
struct e1000_buffer *buffer_info;
unsigned int i, eop;
unsigned int count = 0;
- bool cleaned = false;
unsigned int total_tx_bytes=0, total_tx_packets=0;
i = tx_ring->next_to_clean;
@@ -3843,7 +3842,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) &&
(count < tx_ring->count)) {
- for (cleaned = false; !cleaned; count++) {
+ bool cleaned = false;
+ for ( ; !cleaned; count++) {
tx_desc = E1000_TX_DESC(*tx_ring, i);
buffer_info = &tx_ring->buffer_info[i];
cleaned = (i == eop);
@@ -3871,7 +3871,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
tx_ring->next_to_clean = i;
#define TX_WAKE_THRESHOLD 32
- if (unlikely(cleaned && netif_carrier_ok(netdev) &&
+ if (unlikely(count && netif_carrier_ok(netdev) &&
E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD)) {
/* Make sure that anybody stopping the queue after this
* sees the new next_to_clean.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net-2.6 PATCH 1/2] e1000e: fix bug in restart queue logic
2009-04-17 2:59 [net-2.6 PATCH 1/2] e1000e: fix bug in restart queue logic Jeff Kirsher
2009-04-17 2:59 ` [net-2.6 PATCH 2/2] e1000: fix transmit routine exit bug Jeff Kirsher
@ 2009-04-17 8:10 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2009-04-17 8:10 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, jesse.brandeburg
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 16 Apr 2009 19:59:28 -0700
> If the e1000e transmit cleanup inner loop exited early, then
> cleaned might not be true. This could cause tx hangs or other
> badness. Use count to track the total number of descriptors
> cleaned instead of basing a tx queue restart off of a temporary
> working state variable.
>
> This code now makes the flow the same for e1000/e1000e/igb/ixgbe
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net-2.6 PATCH 2/2] e1000: fix transmit routine exit bug
2009-04-17 2:59 ` [net-2.6 PATCH 2/2] e1000: fix transmit routine exit bug Jeff Kirsher
@ 2009-04-17 8:10 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-04-17 8:10 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, jesse.brandeburg
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 16 Apr 2009 19:59:47 -0700
> If the e1000 transmit cleanup inner loop exited early, then
> cleaned might not be true. This could cause tx hangs or other
> badness. Use count to track the total number of descriptors
> cleaned instead of basing a tx queue restart off of a temporary
> working state variable.
>
> This code now makes the flow the same for e1000/e1000e/igb/ixgbe
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-17 8:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-17 2:59 [net-2.6 PATCH 1/2] e1000e: fix bug in restart queue logic Jeff Kirsher
2009-04-17 2:59 ` [net-2.6 PATCH 2/2] e1000: fix transmit routine exit bug Jeff Kirsher
2009-04-17 8:10 ` David Miller
2009-04-17 8:10 ` [net-2.6 PATCH 1/2] e1000e: fix bug in restart queue logic David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox