* [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb
@ 2009-03-26 8:05 Jeff Kirsher
2009-03-26 8:05 ` [net-next PATCH 2/4] e1000e: fix loss of multicast packets Jeff Kirsher
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Jeff Kirsher @ 2009-03-26 8:05 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Alexander Duyck, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change updates the e1000e tx cleanup routine to more closely match
what already exists in igb and e1000.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000e/netdev.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 15424ba..1797412 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -621,15 +621,16 @@ 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 = 0;
+ bool cleaned;
unsigned int total_tx_bytes = 0, total_tx_packets = 0;
i = tx_ring->next_to_clean;
eop = tx_ring->buffer_info[i].next_to_watch;
eop_desc = E1000_TX_DESC(*tx_ring, eop);
- while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) {
- for (cleaned = 0; !cleaned; ) {
+ while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) &&
+ (count < tx_ring->count)) {
+ for (cleaned = 0; !cleaned; count++) {
tx_desc = E1000_TX_DESC(*tx_ring, i);
buffer_info = &tx_ring->buffer_info[i];
cleaned = (i == eop);
@@ -655,10 +656,6 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
eop = tx_ring->buffer_info[i].next_to_watch;
eop_desc = E1000_TX_DESC(*tx_ring, eop);
-#define E1000_TX_WEIGHT 64
- /* weight of a sort for tx, to avoid endless transmit cleanup */
- if (count++ == E1000_TX_WEIGHT)
- break;
}
tx_ring->next_to_clean = i;
@@ -682,8 +679,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
/* Detect a transmit hang in hardware, this serializes the
* check with the clearing of time_stamp and movement of i */
adapter->detect_tx_hung = 0;
- if (tx_ring->buffer_info[eop].time_stamp &&
- time_after(jiffies, tx_ring->buffer_info[eop].time_stamp
+ if (tx_ring->buffer_info[i].time_stamp &&
+ time_after(jiffies, tx_ring->buffer_info[i].time_stamp
+ (adapter->tx_timeout_factor * HZ))
&& !(er32(STATUS) & E1000_STATUS_TXOFF)) {
e1000_print_tx_hang(adapter);
@@ -694,7 +691,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
adapter->total_tx_packets += total_tx_packets;
adapter->net_stats.tx_bytes += total_tx_bytes;
adapter->net_stats.tx_packets += total_tx_packets;
- return cleaned;
+ return (count < tx_ring->count);
}
/**
@@ -2010,7 +2007,7 @@ static int e1000_clean(struct napi_struct *napi, int budget)
clean_rx:
adapter->clean_rx(adapter, &work_done, budget);
- if (tx_cleaned)
+ if (!tx_cleaned)
work_done = budget;
/* If budget not fully consumed, exit the polling mode */
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [net-next PATCH 2/4] e1000e: fix loss of multicast packets
2009-03-26 8:05 [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb Jeff Kirsher
@ 2009-03-26 8:05 ` Jeff Kirsher
2009-03-26 8:12 ` David Miller
2009-03-26 8:05 ` [net-next PATCH 3/4] e1000e: fix close interrupt race Jeff Kirsher
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Jeff Kirsher @ 2009-03-26 8:05 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jesse Brandeburg, Dave Boutcher, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
e1000e (and e1000, igb, ixgbe, ixgb) all do a series of operations each
time a multicast address is added. The flow goes something like
1) stack adds one multicast address
2) stack passes whole current list of unicast and multicast addresses to
driver
3) driver clears entire list in hardware
4) driver programs each multicast address using iomem in a loop
This was causing multicast packets to be lost during the reprogramming
process.
reference with test program:
http://kerneltrap.org/mailarchive/linux-netdev/2009/3/14/5160514/thread
Thanks to Dave Boutcher for his report and test program.
This driver fix prepares an array all at once in memory and programs it in
one shot to the hardware, not requiring an "erase" cycle. It would still
be possible for packets to be dropped while the receiver is off during
reprogramming.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Dave Boutcher <daveboutcher@gmail.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000e/lib.c | 62 +++++++++++++---------------------------------
1 files changed, 18 insertions(+), 44 deletions(-)
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index ac2f34e..18a4f59 100644
--- a/drivers/net/e1000e/lib.c
+++ b/drivers/net/e1000e/lib.c
@@ -159,41 +159,6 @@ void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
}
/**
- * e1000_mta_set - Set multicast filter table address
- * @hw: pointer to the HW structure
- * @hash_value: determines the MTA register and bit to set
- *
- * The multicast table address is a register array of 32-bit registers.
- * The hash_value is used to determine what register the bit is in, the
- * current value is read, the new bit is OR'd in and the new value is
- * written back into the register.
- **/
-static void e1000_mta_set(struct e1000_hw *hw, u32 hash_value)
-{
- u32 hash_bit, hash_reg, mta;
-
- /*
- * The MTA is a register array of 32-bit registers. It is
- * treated like an array of (32*mta_reg_count) bits. We want to
- * set bit BitArray[hash_value]. So we figure out what register
- * the bit is in, read it, OR in the new bit, then write
- * back the new value. The (hw->mac.mta_reg_count - 1) serves as a
- * mask to bits 31:5 of the hash value which gives us the
- * register we're modifying. The hash bit within that register
- * is determined by the lower 5 bits of the hash value.
- */
- hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
- hash_bit = hash_value & 0x1F;
-
- mta = E1000_READ_REG_ARRAY(hw, E1000_MTA, hash_reg);
-
- mta |= (1 << hash_bit);
-
- E1000_WRITE_REG_ARRAY(hw, E1000_MTA, hash_reg, mta);
- e1e_flush();
-}
-
-/**
* e1000_hash_mc_addr - Generate a multicast hash value
* @hw: pointer to the HW structure
* @mc_addr: pointer to a multicast address
@@ -281,8 +246,13 @@ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
u8 *mc_addr_list, u32 mc_addr_count,
u32 rar_used_count, u32 rar_count)
{
- u32 hash_value;
u32 i;
+ u32 *mcarray = kzalloc(hw->mac.mta_reg_count * sizeof(u32), GFP_ATOMIC);
+
+ if (!mcarray) {
+ printk(KERN_ERR "multicast array memory allocation failed\n");
+ return;
+ }
/*
* Load the first set of multicast addresses into the exact
@@ -302,20 +272,24 @@ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
}
}
- /* Clear the old settings from the MTA */
- hw_dbg(hw, "Clearing MTA\n");
- for (i = 0; i < hw->mac.mta_reg_count; i++) {
- E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
- e1e_flush();
- }
-
/* Load any remaining multicast addresses into the hash table. */
for (; mc_addr_count > 0; mc_addr_count--) {
+ u32 hash_value, hash_reg, hash_bit, mta;
hash_value = e1000_hash_mc_addr(hw, mc_addr_list);
hw_dbg(hw, "Hash value = 0x%03X\n", hash_value);
- e1000_mta_set(hw, hash_value);
+ hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
+ hash_bit = hash_value & 0x1F;
+ mta = (1 << hash_bit);
+ mcarray[hash_reg] |= mta;
mc_addr_list += ETH_ALEN;
}
+
+ /* write the hash table completely */
+ for (i = 0; i < hw->mac.mta_reg_count; i++)
+ E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, mcarray[i]);
+
+ e1e_flush();
+ kfree(mcarray);
}
/**
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [net-next PATCH 3/4] e1000e: fix close interrupt race
2009-03-26 8:05 [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb Jeff Kirsher
2009-03-26 8:05 ` [net-next PATCH 2/4] e1000e: fix loss of multicast packets Jeff Kirsher
@ 2009-03-26 8:05 ` Jeff Kirsher
2009-03-26 8:12 ` David Miller
2009-03-26 8:06 ` [net-next PATCH 4/4] e1000e: update version number Jeff Kirsher
2009-03-26 8:12 ` [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb David Miller
3 siblings, 1 reply; 8+ messages in thread
From: Jeff Kirsher @ 2009-03-26 8:05 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jesse Brandeburg, Alan Cox, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
As noticed by Alan Cox, it is possible for e1000e to exit its interrupt
handler or NAPI with interrupts enabled even when the driver is unloading or
being configured administratively down.
fix related to fix for: http://bugzilla.kernel.org/show_bug.cgi?id=12876
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000e/netdev.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 1797412..b4ae046 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -1261,7 +1261,8 @@ static irqreturn_t e1000_msix_other(int irq, void *data)
u32 icr = er32(ICR);
if (!(icr & E1000_ICR_INT_ASSERTED)) {
- ew32(IMS, E1000_IMS_OTHER);
+ if (!test_bit(__E1000_DOWN, &adapter->state))
+ ew32(IMS, E1000_IMS_OTHER);
return IRQ_NONE;
}
@@ -1278,7 +1279,8 @@ static irqreturn_t e1000_msix_other(int irq, void *data)
}
no_link_interrupt:
- ew32(IMS, E1000_IMS_LSC | E1000_IMS_OTHER);
+ if (!test_bit(__E1000_DOWN, &adapter->state))
+ ew32(IMS, E1000_IMS_LSC | E1000_IMS_OTHER);
return IRQ_HANDLED;
}
@@ -2015,10 +2017,12 @@ clean_rx:
if (adapter->itr_setting & 3)
e1000_set_itr(adapter);
napi_complete(napi);
- if (adapter->msix_entries)
- ew32(IMS, adapter->rx_ring->ims_val);
- else
- e1000_irq_enable(adapter);
+ if (!test_bit(__E1000_DOWN, &adapter->state)) {
+ if (adapter->msix_entries)
+ ew32(IMS, adapter->rx_ring->ims_val);
+ else
+ e1000_irq_enable(adapter);
+ }
}
return work_done;
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [net-next PATCH 4/4] e1000e: update version number
2009-03-26 8:05 [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb Jeff Kirsher
2009-03-26 8:05 ` [net-next PATCH 2/4] e1000e: fix loss of multicast packets Jeff Kirsher
2009-03-26 8:05 ` [net-next PATCH 3/4] e1000e: fix close interrupt race Jeff Kirsher
@ 2009-03-26 8:06 ` Jeff Kirsher
2009-03-26 8:12 ` David Miller
2009-03-26 8:12 ` [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb David Miller
3 siblings, 1 reply; 8+ messages in thread
From: Jeff Kirsher @ 2009-03-26 8:06 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jesse Brandeburg, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000e/netdev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index b4ae046..bfb2d6c 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -48,7 +48,7 @@
#include "e1000.h"
-#define DRV_VERSION "0.3.3.4-k2"
+#define DRV_VERSION "0.3.3.4-k4"
char e1000e_driver_name[] = "e1000e";
const char e1000e_driver_version[] = DRV_VERSION;
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb
2009-03-26 8:05 [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb Jeff Kirsher
` (2 preceding siblings ...)
2009-03-26 8:06 ` [net-next PATCH 4/4] e1000e: update version number Jeff Kirsher
@ 2009-03-26 8:12 ` David Miller
3 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2009-03-26 8:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, alexander.h.duyck
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 26 Mar 2009 01:05:03 -0700
> From: Alexander Duyck <alexander.h.duyck@intel.com>
>
> This change updates the e1000e tx cleanup routine to more closely match
> what already exists in igb and e1000.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [net-next PATCH 2/4] e1000e: fix loss of multicast packets
2009-03-26 8:05 ` [net-next PATCH 2/4] e1000e: fix loss of multicast packets Jeff Kirsher
@ 2009-03-26 8:12 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2009-03-26 8:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, jesse.brandeburg, daveboutcher
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 26 Mar 2009 01:05:21 -0700
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
>
> e1000e (and e1000, igb, ixgbe, ixgb) all do a series of operations each
> time a multicast address is added. The flow goes something like
...
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> CC: Dave Boutcher <daveboutcher@gmail.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [net-next PATCH 3/4] e1000e: fix close interrupt race
2009-03-26 8:05 ` [net-next PATCH 3/4] e1000e: fix close interrupt race Jeff Kirsher
@ 2009-03-26 8:12 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2009-03-26 8:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, jesse.brandeburg, alan
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 26 Mar 2009 01:05:41 -0700
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
>
> As noticed by Alan Cox, it is possible for e1000e to exit its interrupt
> handler or NAPI with interrupts enabled even when the driver is unloading or
> being configured administratively down.
>
> fix related to fix for: http://bugzilla.kernel.org/show_bug.cgi?id=12876
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> CC: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [net-next PATCH 4/4] e1000e: update version number
2009-03-26 8:06 ` [net-next PATCH 4/4] e1000e: update version number Jeff Kirsher
@ 2009-03-26 8:12 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2009-03-26 8:12 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, jesse.brandeburg
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 26 Mar 2009 01:06:01 -0700
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
>
> 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] 8+ messages in thread
end of thread, other threads:[~2009-03-26 8:12 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-26 8:05 [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb Jeff Kirsher
2009-03-26 8:05 ` [net-next PATCH 2/4] e1000e: fix loss of multicast packets Jeff Kirsher
2009-03-26 8:12 ` David Miller
2009-03-26 8:05 ` [net-next PATCH 3/4] e1000e: fix close interrupt race Jeff Kirsher
2009-03-26 8:12 ` David Miller
2009-03-26 8:06 ` [net-next PATCH 4/4] e1000e: update version number Jeff Kirsher
2009-03-26 8:12 ` David Miller
2009-03-26 8:12 ` [net-next PATCH 1/4] e1000e: commonize tx cleanup routine to match e1000 & igb David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).