* [PATCH 00/22] ixgb, e1000 fixes
@ 2006-12-08 23:02 Kok, Auke
2006-12-08 23:02 ` [PATCH 01/22] e1000: Fix early TSO completion Kok, Auke
` (21 more replies)
0 siblings, 22 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:02 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Hi,
This patch series contains exclusively fixes for ixgb and e1000. Most
importantly, it addresses two issues in the recently merged msi interrupt
handler and dynamic itr code, as well as some major manageability
feature handling code.
These patches apply against netdev-2.6 #upstream-linus commit
0ae851352a87db3f829511816a2da227860bf585. Please pull:
git pull git://lost.foo-projects.org/~ahkok/git/netdev-2.6 upstream-linus
to receive them.
Cheers,
Auke
---
Bruce Allan <bruce.w.allan@intel.com>:
e1000: Fix PBA allocation calculations
e1000: set max frame size before enabling new link settings
Jesse Brandeburg <jesse.brandeburg@intel.com>:
e1000: Fix early TSO completion
ixgb: Maybe stop TX if not enough free descriptors
e1000: dynamic itr code fixes
e1000: minor tso ipv6 cleanups
e1000: omit stats for broken counter in 82543
e1000: Fix all manageability workarounds
e1000: Make copybreak parameter changeable by user.
e1000: Fire a link even interrupt instead of a watchdog at init.
e1000: Fix powerdown link loss when forced to gig speed
e1000: disable TSO when debugging slab
e1000: always turn on receives on esb2
e1000: simplify msi specific interrupt handler
e1000: Rewrite parm handling code to warn when forcing autoneg to gig only.
e1000: Don't set tipg (fiber) timings for pci-e adapters to fix fiber output
e1000: Fix poor quad port performance with NAPI
Jeff Kirsher <jeffrey.t.kirsher@intel.com>:
e1000: For older adapters, we know that the pci bus type is pci.
Auke Kok <auke-jan.h.kok@intel.com>:
e1000: display FC link properties
e1000: Version increment 7.3.20-k2 and minor cleanups
Aaron Salter <aaron.k.salter@intel.com>:
ixgb: Write RA register high word first, increment version
---
drivers/net/e1000/e1000.h | 7 +-
drivers/net/e1000/e1000_ethtool.c | 3 +
drivers/net/e1000/e1000_hw.c | 59 +++---
drivers/net/e1000/e1000_hw.h | 2 +
drivers/net/e1000/e1000_main.c | 455 ++++++++++++++++++++++++-------------
drivers/net/e1000/e1000_osdep.h | 9 +-
drivers/net/e1000/e1000_param.c | 19 +-
drivers/net/ixgb/ixgb.h | 1 +
drivers/net/ixgb/ixgb_ethtool.c | 1 +
drivers/net/ixgb/ixgb_hw.c | 3 +-
drivers/net/ixgb/ixgb_main.c | 60 +++++-
11 files changed, 398 insertions(+), 221 deletions(-)
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH 01/22] e1000: Fix early TSO completion
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
@ 2006-12-08 23:02 ` Kok, Auke
2006-12-11 14:36 ` Jeff Garzik
2006-12-08 23:02 ` [PATCH 02/22] ixgb: Maybe stop TX if not enough free descriptors Kok, Auke
` (20 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:02 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
This fix was already merged in commit 96f9c2e277768099479fbed7c3b69c294b1fadef
but reverted in commit 989316ddfeafd0e8fb51a4d811383769ad62637a. After
stresstesting we found that the fix does not add new regressions and
works around a TX hang spotted by several users.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgb/ixgb_main.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index e628126..ebc9d71 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1287,6 +1287,9 @@ ixgb_tx_map(struct ixgb_adapter *adapter
struct ixgb_buffer *buffer_info;
int len = skb->len;
unsigned int offset = 0, size, count = 0, i;
+#ifdef NETIF_F_TSO
+ unsigned int mss = skb_shinfo(skb)->gso_size;
+#endif
unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
unsigned int f;
@@ -1298,6 +1301,12 @@ ixgb_tx_map(struct ixgb_adapter *adapter
while(len) {
buffer_info = &tx_ring->buffer_info[i];
size = min(len, IXGB_MAX_DATA_PER_TXD);
+#ifdef NETIF_F_TSO
+ /* Workaround for premature desc write-backs
+ * in TSO mode. Append 4-byte sentinel desc */
+ if (unlikely(mss && !nr_frags && size == len && size > 8))
+ size -= 4;
+#endif
buffer_info->length = size;
WARN_ON(buffer_info->dma != 0);
buffer_info->dma =
@@ -1324,6 +1333,13 @@ ixgb_tx_map(struct ixgb_adapter *adapter
while(len) {
buffer_info = &tx_ring->buffer_info[i];
size = min(len, IXGB_MAX_DATA_PER_TXD);
+#ifdef NETIF_F_TSO
+ /* Workaround for premature desc write-backs
+ * in TSO mode. Append 4-byte sentinel desc */
+ if (unlikely(mss && !nr_frags && size == len
+ && size > 8))
+ size -= 4;
+#endif
buffer_info->length = size;
buffer_info->dma =
pci_map_page(adapter->pdev,
@@ -1401,8 +1417,9 @@ ixgb_tx_queue(struct ixgb_adapter *adapt
/* Tx Descriptors needed, worst case */
#define TXD_USE_COUNT(S) (((S) >> IXGB_MAX_TXD_PWR) + \
(((S) & (IXGB_MAX_DATA_PER_TXD - 1)) ? 1 : 0))
-#define DESC_NEEDED TXD_USE_COUNT(IXGB_MAX_DATA_PER_TXD) + \
- MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1
+#define DESC_NEEDED TXD_USE_COUNT(IXGB_MAX_DATA_PER_TXD) /* skb->date */ + \
+ MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 /* for context */ \
+ + 1 /* one more needed for sentinel TSO workaround */
static int
ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 02/22] ixgb: Maybe stop TX if not enough free descriptors
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
2006-12-08 23:02 ` [PATCH 01/22] e1000: Fix early TSO completion Kok, Auke
@ 2006-12-08 23:02 ` Kok, Auke
2006-12-11 14:37 ` Jeff Garzik
2006-12-08 23:02 ` [PATCH 03/22] ixgb: Write RA register high word first, increment version Kok, Auke
` (19 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:02 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
A similar patch to commit 65c7973fa5b46b024f38be208aa477e8daf9a603
but now for ixgb.
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgb/ixgb.h | 1 +
drivers/net/ixgb/ixgb_ethtool.c | 1 +
drivers/net/ixgb/ixgb_main.c | 37 ++++++++++++++++++++++++++++++++++---
3 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index 50ffe90..f4aba43 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -171,6 +171,7 @@ struct ixgb_adapter {
/* TX */
struct ixgb_desc_ring tx_ring ____cacheline_aligned_in_smp;
+ unsigned int restart_queue;
unsigned long timeo_start;
uint32_t tx_cmd_type;
uint64_t hw_csum_tx_good;
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index cd22523..82c044d 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -79,6 +79,7 @@ static struct ixgb_stats ixgb_gstrings_s
{"tx_window_errors", IXGB_STAT(net_stats.tx_window_errors)},
{"tx_deferred_ok", IXGB_STAT(stats.dc)},
{"tx_timeout_count", IXGB_STAT(tx_timeout_count) },
+ {"tx_restart_queue", IXGB_STAT(restart_queue) },
{"rx_long_length_errors", IXGB_STAT(stats.roc)},
{"rx_short_length_errors", IXGB_STAT(stats.ruc)},
#ifdef NETIF_F_TSO
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index ebc9d71..9522d5e 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1414,6 +1414,37 @@ ixgb_tx_queue(struct ixgb_adapter *adapt
IXGB_WRITE_REG(&adapter->hw, TDT, i);
}
+static int __ixgb_maybe_stop_tx(struct net_device *netdev, int size)
+{
+ struct ixgb_adapter *adapter = netdev_priv(netdev);
+ struct ixgb_desc_ring *tx_ring = &adapter->tx_ring;
+
+ netif_stop_queue(netdev);
+ /* Herbert's original patch had:
+ * smp_mb__after_netif_stop_queue();
+ * but since that doesn't exist yet, just open code it. */
+ smp_mb();
+
+ /* We need to check again in a case another CPU has just
+ * made room available. */
+ if (likely(IXGB_DESC_UNUSED(tx_ring) < size))
+ return -EBUSY;
+
+ /* A reprieve! */
+ netif_start_queue(netdev);
+ ++adapter->restart_queue;
+ return 0;
+}
+
+static int ixgb_maybe_stop_tx(struct net_device *netdev,
+ struct ixgb_desc_ring *tx_ring, int size)
+{
+ if (likely(IXGB_DESC_UNUSED(tx_ring) >= size))
+ return 0;
+ return __ixgb_maybe_stop_tx(netdev, size);
+}
+
+
/* Tx Descriptors needed, worst case */
#define TXD_USE_COUNT(S) (((S) >> IXGB_MAX_TXD_PWR) + \
(((S) & (IXGB_MAX_DATA_PER_TXD - 1)) ? 1 : 0))
@@ -1447,7 +1478,8 @@ ixgb_xmit_frame(struct sk_buff *skb, str
spin_lock_irqsave(&adapter->tx_lock, flags);
#endif
- if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) {
+ if (unlikely(ixgb_maybe_stop_tx(netdev, &adapter->tx_ring,
+ DESC_NEEDED))) {
netif_stop_queue(netdev);
spin_unlock_irqrestore(&adapter->tx_lock, flags);
return NETDEV_TX_BUSY;
@@ -1485,8 +1517,7 @@ ixgb_xmit_frame(struct sk_buff *skb, str
#ifdef NETIF_F_LLTX
/* Make sure there is space in the ring for the next send. */
- if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED))
- netif_stop_queue(netdev);
+ ixgb_maybe_stop_tx(netdev, &adapter->tx_ring, DESC_NEEDED);
spin_unlock_irqrestore(&adapter->tx_lock, flags);
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 03/22] ixgb: Write RA register high word first, increment version
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
2006-12-08 23:02 ` [PATCH 01/22] e1000: Fix early TSO completion Kok, Auke
2006-12-08 23:02 ` [PATCH 02/22] ixgb: Maybe stop TX if not enough free descriptors Kok, Auke
@ 2006-12-08 23:02 ` Kok, Auke
2006-12-11 14:37 ` Jeff Garzik
2006-12-08 23:02 ` [PATCH 04/22] e1000: display FC link properties Kok, Auke
` (18 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:02 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
We need to disable the AV bit before flushing the low register.
Signed-off-by: <aaron.k.salter@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgb/ixgb_hw.c | 3 ++-
drivers/net/ixgb/ixgb_main.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
index 02089b6..ecbf458 100644
--- a/drivers/net/ixgb/ixgb_hw.c
+++ b/drivers/net/ixgb/ixgb_hw.c
@@ -399,8 +399,9 @@ ixgb_init_rx_addrs(struct ixgb_hw *hw)
/* Zero out the other 15 receive addresses. */
DEBUGOUT("Clearing RAR[1-15]\n");
for(i = 1; i < IXGB_RAR_ENTRIES; i++) {
- IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
+ /* Write high reg first to disable the AV bit first */
IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0);
+ IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
}
return;
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 9522d5e..d70accb 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -36,7 +36,7 @@ static char ixgb_driver_string[] = "Inte
#else
#define DRIVERNAPI "-NAPI"
#endif
-#define DRV_VERSION "1.0.117-k2"DRIVERNAPI
+#define DRV_VERSION "1.0.126-k2"DRIVERNAPI
char ixgb_driver_version[] = DRV_VERSION;
static char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 04/22] e1000: display FC link properties
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (2 preceding siblings ...)
2006-12-08 23:02 ` [PATCH 03/22] ixgb: Write RA register high word first, increment version Kok, Auke
@ 2006-12-08 23:02 ` Kok, Auke
2006-12-08 23:02 ` [PATCH 05/22] e1000: dynamic itr code fixes Kok, Auke
` (17 subsequent siblings)
21 siblings, 0 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:02 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Previously there was no way of determining the actual flow control
properties of a link state. We display them at link up to provide
this information as some other drivers do. Ethtool needs probably
to add this status information.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 73f3a85..fae30c7 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2454,15 +2454,22 @@ e1000_watchdog(unsigned long data)
if (link) {
if (!netif_carrier_ok(netdev)) {
+ uint32_t ctrl;
boolean_t txb2b = 1;
e1000_get_speed_and_duplex(&adapter->hw,
&adapter->link_speed,
&adapter->link_duplex);
- DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s\n",
- adapter->link_speed,
- adapter->link_duplex == FULL_DUPLEX ?
- "Full Duplex" : "Half Duplex");
+ ctrl = E1000_READ_REG(&adapter->hw, CTRL);
+ DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s, "
+ "Flow Control: %s\n",
+ adapter->link_speed,
+ adapter->link_duplex == FULL_DUPLEX ?
+ "Full Duplex" : "Half Duplex",
+ ((ctrl & E1000_CTRL_TFCE) && (ctrl &
+ E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl &
+ E1000_CTRL_RFCE) ? "RX" : ((ctrl &
+ E1000_CTRL_TFCE) ? "TX" : "None" )));
/* tweak tx_queue_len according to speed/duplex
* and adjust the timeout factor */
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 05/22] e1000: dynamic itr code fixes
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (3 preceding siblings ...)
2006-12-08 23:02 ` [PATCH 04/22] e1000: display FC link properties Kok, Auke
@ 2006-12-08 23:02 ` Kok, Auke
2006-12-08 23:02 ` [PATCH 06/22] e1000: minor tso ipv6 cleanups Kok, Auke
` (16 subsequent siblings)
21 siblings, 0 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:02 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
The dynamic interrupt rate control patches omitted proper counting
for jumbo's and TSO. We also & out the lower bits of a user-provided
hardcoded itr setting beccause they are used for control.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 52 ++++++++++++++++++++++++++-------------
drivers/net/e1000/e1000_param.c | 4 ++-
2 files changed, 37 insertions(+), 19 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index fae30c7..f39b244 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2635,29 +2635,38 @@ static unsigned int e1000_update_itr(str
if (packets == 0)
goto update_itr_done;
-
switch (itr_setting) {
case lowest_latency:
- if ((packets < 5) && (bytes > 512))
+ /* handle TSO and jumbo frames */
+ if (bytes/packets > 8000)
+ retval = bulk_latency;
+ else if ((packets < 5) && (bytes > 512)) {
retval = low_latency;
+ }
break;
case low_latency: /* 50 usec aka 20000 ints/s */
if (bytes > 10000) {
- if ((packets < 10) ||
- ((bytes/packets) > 1200))
+ /* this if handles the TSO accounting */
+ if (bytes/packets > 8000) {
retval = bulk_latency;
- else if ((packets > 35))
+ } else if ((packets < 10) || ((bytes/packets) > 1200)) {
+ retval = bulk_latency;
+ } else if ((packets > 35)) {
retval = lowest_latency;
- } else if (packets <= 2 && bytes < 512)
+ }
+ } else if (bytes/packets > 2000) {
+ retval = bulk_latency;
+ } else if (packets <= 2 && bytes < 512) {
retval = lowest_latency;
+ }
break;
case bulk_latency: /* 250 usec aka 4000 ints/s */
if (bytes > 25000) {
- if (packets > 35)
- retval = low_latency;
- } else {
- if (bytes < 6000)
+ if (packets > 35) {
retval = low_latency;
+ }
+ } else if (bytes < 6000) {
+ retval = low_latency;
}
break;
}
@@ -2686,17 +2695,20 @@ static void e1000_set_itr(struct e1000_a
adapter->tx_itr,
adapter->total_tx_packets,
adapter->total_tx_bytes);
+ /* conservative mode (itr 3) eliminates the lowest_latency setting */
+ if (adapter->itr_setting == 3 && adapter->tx_itr == lowest_latency)
+ adapter->tx_itr = low_latency;
+
adapter->rx_itr = e1000_update_itr(adapter,
adapter->rx_itr,
adapter->total_rx_packets,
adapter->total_rx_bytes);
+ /* conservative mode (itr 3) eliminates the lowest_latency setting */
+ if (adapter->itr_setting == 3 && adapter->rx_itr == lowest_latency)
+ adapter->rx_itr = low_latency;
current_itr = max(adapter->rx_itr, adapter->tx_itr);
- /* conservative mode eliminates the lowest_latency setting */
- if (current_itr == lowest_latency && (adapter->itr_setting == 3))
- current_itr = low_latency;
-
switch (current_itr) {
/* counts and packets in update_itr are dependent on these numbers */
case lowest_latency:
@@ -3875,11 +3887,15 @@ e1000_clean_tx_irq(struct e1000_adapter
cleaned = (i == eop);
if (cleaned) {
- /* this packet count is wrong for TSO but has a
- * tendency to make dynamic ITR change more
- * towards bulk */
+ struct sk_buff *skb = buffer_info->skb;
+#ifdef NETIF_F_TSO
+ unsigned int segs = skb_shinfo(skb)->gso_segs;
+ if (segs)
+ total_tx_packets += segs;
+#endif
+
total_tx_packets++;
- total_tx_bytes += buffer_info->skb->len;
+ total_tx_bytes += skb->len;
}
e1000_unmap_and_free_tx_resource(adapter, buffer_info);
tx_desc->upper.data = 0;
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index cbfcd7f..cf2a279 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -487,7 +487,9 @@ e1000_check_options(struct e1000_adapter
e1000_validate_option(&adapter->itr, &opt,
adapter);
/* save the setting, because the dynamic bits change itr */
- adapter->itr_setting = adapter->itr;
+ /* clear the lower two bits because they are
+ * used as control */
+ adapter->itr_setting = adapter->itr & ~3;
break;
}
} else {
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 06/22] e1000: minor tso ipv6 cleanups
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (4 preceding siblings ...)
2006-12-08 23:02 ` [PATCH 05/22] e1000: dynamic itr code fixes Kok, Auke
@ 2006-12-08 23:02 ` Kok, Auke
2006-12-11 14:42 ` Jeff Garzik
2006-12-08 23:02 ` [PATCH 07/22] e1000: omit stats for broken counter in 82543 Kok, Auke
` (15 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:02 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Zero descriptor ip_config field and use skb_shinfo to detect IPV6 packet.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index f39b244..dc76e01 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2780,7 +2780,7 @@ e1000_tso(struct e1000_adapter *adapter,
cmd_length = E1000_TXD_CMD_IP;
ipcse = skb->h.raw - skb->data - 1;
#ifdef NETIF_F_TSO6
- } else if (skb->protocol == htons(ETH_P_IPV6)) {
+ } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
skb->nh.ipv6h->payload_len = 0;
skb->h.th->check =
~csum_ipv6_magic(&skb->nh.ipv6h->saddr,
@@ -2843,6 +2843,7 @@ e1000_tx_csum(struct e1000_adapter *adap
buffer_info = &tx_ring->buffer_info[i];
context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
+ context_desc->lower_setup.ip_config = 0;
context_desc->upper_setup.tcp_fields.tucss = css;
context_desc->upper_setup.tcp_fields.tucso = css + skb->csum_offset;
context_desc->upper_setup.tcp_fields.tucse = 0;
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 07/22] e1000: omit stats for broken counter in 82543
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (5 preceding siblings ...)
2006-12-08 23:02 ` [PATCH 06/22] e1000: minor tso ipv6 cleanups Kok, Auke
@ 2006-12-08 23:02 ` Kok, Auke
2006-12-11 14:42 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 08/22] e1000: Fix all manageability workarounds Kok, Auke
` (14 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:02 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
82543 does not count tx_carrier_errors properly in FD mode.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index dc76e01..7639b4d 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3592,7 +3592,12 @@ e1000_update_stats(struct e1000_adapter
adapter->net_stats.tx_errors = adapter->stats.txerrc;
adapter->net_stats.tx_aborted_errors = adapter->stats.ecol;
adapter->net_stats.tx_window_errors = adapter->stats.latecol;
- adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
+ if (adapter->hw.mac_type == e1000_82543 &&
+ adapter->link_duplex == FULL_DUPLEX) {
+ adapter->net_stats.tx_carrier_errors = 0;
+ adapter->stats.tncrs = 0;
+ } else
+ adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
/* Tx Dropped needs to be maintained elsewhere */
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 08/22] e1000: Fix all manageability workarounds
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (6 preceding siblings ...)
2006-12-08 23:02 ` [PATCH 07/22] e1000: omit stats for broken counter in 82543 Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-11 14:41 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 09/22] e1000: Fix PBA allocation calculations Kok, Auke
` (13 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Several bugs existed in how we handle various manageability issues and
workarounds. We consolidate all release and init code in two single
functions and call them from appropriate locations. This fixes several
BMC packet redirect issues and powerup/down hiccups.
Add 3 extra packet redirect counters for tracking purposes to make sure
we can test that all packets arrive properly.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_ethtool.c | 3 +
drivers/net/e1000/e1000_hw.c | 5 +
drivers/net/e1000/e1000_hw.h | 1
drivers/net/e1000/e1000_main.c | 135 +++++++++++++++++++++----------------
4 files changed, 83 insertions(+), 61 deletions(-)
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index da459f7..fb96c87 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -100,6 +100,9 @@ static const struct e1000_stats e1000_gs
{ "rx_csum_offload_errors", E1000_STAT(hw_csum_err) },
{ "rx_header_split", E1000_STAT(rx_hdr_split) },
{ "alloc_rx_buff_failed", E1000_STAT(alloc_rx_buff_failed) },
+ { "tx_smbus", E1000_STAT(stats.mgptc) },
+ { "rx_smbus", E1000_STAT(stats.mgprc) },
+ { "dropped_smbus", E1000_STAT(stats.mgpdc) },
};
#define E1000_QUEUE_STATS_LEN 0
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 3655d90..23826c7 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -7817,9 +7817,8 @@ e1000_enable_mng_pass_thru(struct e1000_
fwsm = E1000_READ_REG(hw, FWSM);
factps = E1000_READ_REG(hw, FACTPS);
- if (((fwsm & E1000_FWSM_MODE_MASK) ==
- (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT)) &&
- (factps & E1000_FACTPS_MNGCG))
+ if ((((fwsm & E1000_FWSM_MODE_MASK) >> E1000_FWSM_MODE_SHIFT) ==
+ e1000_mng_mode_pt) && !(factps & E1000_FACTPS_MNGCG))
return TRUE;
} else
if ((manc & E1000_MANC_SMBUS_EN) && !(manc & E1000_MANC_ASF_EN))
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 3321fb1..fd15f62 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1301,6 +1301,7 @@ struct e1000_ffvt_entry {
#define E1000_82542_RSSIR E1000_RSSIR
#define E1000_82542_KUMCTRLSTA E1000_KUMCTRLSTA
#define E1000_82542_SW_FW_SYNC E1000_SW_FW_SYNC
+#define E1000_82542_MANC2H E1000_MANC2H
/* Statistics counters collected by the MAC */
struct e1000_hw_stats {
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 7639b4d..0d8fd01 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -464,6 +464,53 @@ e1000_get_hw_control(struct e1000_adapte
}
}
+static void
+e1000_init_manageability(struct e1000_adapter *adapter)
+{
+ if (adapter->en_mng_pt) {
+ uint32_t manc2h = E1000_READ_REG(&adapter->hw, MANC2H);
+ uint32_t manc = E1000_READ_REG(&adapter->hw, MANC);
+
+ /* disable hardware interception of ARP */
+ manc &= ~(E1000_MANC_ARP_EN);
+
+ /* enable receiving management packets to the host */
+ /* this will probably generate destination unreachable messages
+ * from the host OS, but the packets will be handled on SMBUS */
+ if (adapter->hw.mac_type >= e1000_82571) {
+ manc |= E1000_MANC_EN_MNG2HOST;
+#define E1000_MNG2HOST_PORT_623 (1 << 5)
+#define E1000_MNG2HOST_PORT_664 (1 << 6)
+ manc2h |= E1000_MNG2HOST_PORT_623;
+ manc2h |= E1000_MNG2HOST_PORT_664;
+ E1000_WRITE_REG(&adapter->hw, MANC2H, manc2h);
+ }
+
+ E1000_WRITE_REG(&adapter->hw, MANC, manc);
+ }
+}
+
+static void
+e1000_release_manageability(struct e1000_adapter *adapter)
+{
+ if (adapter->en_mng_pt) {
+ uint32_t manc = E1000_READ_REG(&adapter->hw, MANC);
+
+ /* re-enable hardware interception of ARP */
+ manc |= E1000_MANC_ARP_EN;
+
+ if (adapter->hw.mac_type >= e1000_82571)
+ manc &= ~E1000_MANC_EN_MNG2HOST;
+
+ /* don't explicitly have to mess with MANC2H since
+ * MANC has an enable disable that gates MANC2H */
+
+ /* XXX stop the hardware watchdog ? */
+
+ E1000_WRITE_REG(&adapter->hw, MANC, manc);
+ }
+}
+
int
e1000_up(struct e1000_adapter *adapter)
{
@@ -475,6 +522,7 @@ e1000_up(struct e1000_adapter *adapter)
e1000_set_multi(netdev);
e1000_restore_vlan(adapter);
+ e1000_init_manageability(adapter);
e1000_configure_tx(adapter);
e1000_setup_rctl(adapter);
@@ -705,14 +753,7 @@ e1000_reset(struct e1000_adapter *adapte
phy_data);
}
- if ((adapter->en_mng_pt) &&
- (adapter->hw.mac_type >= e1000_82540) &&
- (adapter->hw.mac_type < e1000_82571) &&
- (adapter->hw.media_type == e1000_media_type_copper)) {
- manc = E1000_READ_REG(&adapter->hw, MANC);
- manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
- E1000_WRITE_REG(&adapter->hw, MANC, manc);
- }
+ e1000_release_manageability(adapter);
}
/**
@@ -1078,22 +1119,13 @@ e1000_remove(struct pci_dev *pdev)
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev);
- uint32_t manc;
#ifdef CONFIG_E1000_NAPI
int i;
#endif
flush_scheduled_work();
- if (adapter->hw.mac_type >= e1000_82540 &&
- adapter->hw.mac_type < e1000_82571 &&
- adapter->hw.media_type == e1000_media_type_copper) {
- manc = E1000_READ_REG(&adapter->hw, MANC);
- if (manc & E1000_MANC_SMBUS_EN) {
- manc |= E1000_MANC_ARP_EN;
- E1000_WRITE_REG(&adapter->hw, MANC, manc);
- }
- }
+ e1000_release_manageability(adapter);
/* Release control of h/w to f/w. If f/w is AMT enabled, this
* would have already happened in close and is redundant. */
@@ -3615,6 +3647,14 @@ e1000_update_stats(struct e1000_adapter
adapter->phy_stats.receive_errors += phy_tmp;
}
+ /* Management Stats */
+ if (adapter->hw.mac_type > e1000_82544) {
+ adapter->stats.mgptc += E1000_READ_REG(hw, MGTPTC);
+ adapter->stats.mgprc += E1000_READ_REG(hw, MGTPRC);
+ adapter->stats.mgpdc += E1000_READ_REG(hw, MGTPDC);
+ }
+
+
spin_unlock_irqrestore(&adapter->stats_lock, flags);
}
#ifdef CONFIG_PCI_MSI
@@ -5027,7 +5067,7 @@ e1000_suspend(struct pci_dev *pdev, pm_m
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev);
- uint32_t ctrl, ctrl_ext, rctl, manc, status;
+ uint32_t ctrl, ctrl_ext, rctl, status;
uint32_t wufc = adapter->wol;
#ifdef CONFIG_PM
int retval = 0;
@@ -5096,16 +5136,12 @@ e1000_suspend(struct pci_dev *pdev, pm_m
pci_enable_wake(pdev, PCI_D3cold, 0);
}
- if (adapter->hw.mac_type >= e1000_82540 &&
- adapter->hw.mac_type < e1000_82571 &&
- adapter->hw.media_type == e1000_media_type_copper) {
- manc = E1000_READ_REG(&adapter->hw, MANC);
- if (manc & E1000_MANC_SMBUS_EN) {
- manc |= E1000_MANC_ARP_EN;
- E1000_WRITE_REG(&adapter->hw, MANC, manc);
- pci_enable_wake(pdev, PCI_D3hot, 1);
- pci_enable_wake(pdev, PCI_D3cold, 1);
- }
+ e1000_release_manageability(adapter);
+
+ /* make sure adapter isn't asleep if manageability is enabled */
+ if (adapter->en_mng_pt) {
+ pci_enable_wake(pdev, PCI_D3hot, 1);
+ pci_enable_wake(pdev, PCI_D3cold, 1);
}
if (adapter->hw.phy_type == e1000_phy_igp_3)
@@ -5131,7 +5167,7 @@ e1000_resume(struct pci_dev *pdev)
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev);
- uint32_t manc, err;
+ uint32_t err;
pci_set_power_state(pdev, PCI_D0);
e1000_pci_restore_state(adapter);
@@ -5151,19 +5187,13 @@ e1000_resume(struct pci_dev *pdev)
e1000_reset(adapter);
E1000_WRITE_REG(&adapter->hw, WUS, ~0);
+ e1000_init_manageability(adapter);
+
if (netif_running(netdev))
e1000_up(adapter);
netif_device_attach(netdev);
- if (adapter->hw.mac_type >= e1000_82540 &&
- adapter->hw.mac_type < e1000_82571 &&
- adapter->hw.media_type == e1000_media_type_copper) {
- manc = E1000_READ_REG(&adapter->hw, MANC);
- manc &= ~(E1000_MANC_ARP_EN);
- E1000_WRITE_REG(&adapter->hw, MANC, manc);
- }
-
/* If the controller is 82573 and f/w is AMT, do not set
* DRV_LOAD until the interface is up. For all other cases,
* let the f/w know that the h/w is now under the control
@@ -5264,7 +5294,8 @@ static void e1000_io_resume(struct pci_d
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev->priv;
- uint32_t manc, swsm;
+
+ e1000_init_manageability(adapter);
if (netif_running(netdev)) {
if (e1000_up(adapter)) {
@@ -5275,26 +5306,14 @@ static void e1000_io_resume(struct pci_d
netif_device_attach(netdev);
- if (adapter->hw.mac_type >= e1000_82540 &&
- adapter->hw.mac_type < e1000_82571 &&
- adapter->hw.media_type == e1000_media_type_copper) {
- manc = E1000_READ_REG(&adapter->hw, MANC);
- manc &= ~(E1000_MANC_ARP_EN);
- E1000_WRITE_REG(&adapter->hw, MANC, manc);
- }
-
- switch (adapter->hw.mac_type) {
- case e1000_82573:
- swsm = E1000_READ_REG(&adapter->hw, SWSM);
- E1000_WRITE_REG(&adapter->hw, SWSM,
- swsm | E1000_SWSM_DRV_LOAD);
- break;
- default:
- break;
- }
+ /* If the controller is 82573 and f/w is AMT, do not set
+ * DRV_LOAD until the interface is up. For all other cases,
+ * let the f/w know that the h/w is now under the control
+ * of the driver. */
+ if (adapter->hw.mac_type != e1000_82573 ||
+ !e1000_check_mng_mode(&adapter->hw))
+ e1000_get_hw_control(adapter);
- if (netif_running(netdev))
- mod_timer(&adapter->watchdog_timer, jiffies);
}
/* e1000_main.c */
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 09/22] e1000: Fix PBA allocation calculations
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (7 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 08/22] e1000: Fix all manageability workarounds Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-08 23:03 ` [PATCH 10/22] e1000: Make copybreak parameter changeable by user Kok, Auke
` (12 subsequent siblings)
21 siblings, 0 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Assign the PBA to be large enough to contain at least 2 jumbo frames on
all adapters. This dramatically increases performance on several adapters
and fixes TX performance degradation issues where the PBA was misallocated
in the old algorithm.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 100 ++++++++++++++++++++++++++++++++++------
1 files changed, 86 insertions(+), 14 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 0d8fd01..a7dba40 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -662,16 +662,34 @@ e1000_reinit_locked(struct e1000_adapter
void
e1000_reset(struct e1000_adapter *adapter)
{
- uint32_t pba, manc;
+ uint32_t pba = 0, tx_space, min_tx_space, min_rx_space;
uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF;
+ boolean_t legacy_pba_adjust = FALSE;
/* Repartition Pba for greater than 9k mtu
* To take effect CTRL.RST is required.
*/
switch (adapter->hw.mac_type) {
+ case e1000_82542_rev2_0:
+ case e1000_82542_rev2_1:
+ case e1000_82543:
+ case e1000_82544:
+ case e1000_82540:
+ case e1000_82541:
+ case e1000_82541_rev_2:
+ legacy_pba_adjust = TRUE;
+ pba = E1000_PBA_48K;
+ break;
+ case e1000_82545:
+ case e1000_82545_rev_3:
+ case e1000_82546:
+ case e1000_82546_rev_3:
+ pba = E1000_PBA_48K;
+ break;
case e1000_82547:
case e1000_82547_rev_2:
+ legacy_pba_adjust = TRUE;
pba = E1000_PBA_30K;
break;
case e1000_82571:
@@ -680,27 +698,81 @@ e1000_reset(struct e1000_adapter *adapte
pba = E1000_PBA_38K;
break;
case e1000_82573:
- pba = E1000_PBA_12K;
+#define E1000_PBA_20K 0x0014
+ pba = E1000_PBA_20K;
break;
case e1000_ich8lan:
pba = E1000_PBA_8K;
- break;
- default:
- pba = E1000_PBA_48K;
+ case e1000_undefined:
+ case e1000_num_macs:
break;
}
- if ((adapter->hw.mac_type != e1000_82573) &&
- (adapter->netdev->mtu > E1000_RXBUFFER_8192))
- pba -= 8; /* allocate more FIFO for Tx */
+ if (legacy_pba_adjust == TRUE) {
+ if (adapter->netdev->mtu > E1000_RXBUFFER_8192)
+ pba -= 8; /* allocate more FIFO for Tx */
+ if (adapter->hw.mac_type == e1000_82547) {
+ adapter->tx_fifo_head = 0;
+ adapter->tx_head_addr = pba << E1000_TX_HEAD_ADDR_SHIFT;
+ adapter->tx_fifo_size =
+ (E1000_PBA_40K - pba) << E1000_PBA_BYTES_SHIFT;
+ atomic_set(&adapter->tx_fifo_stall, 0);
+ }
+ } else if (adapter->hw.max_frame_size > MAXIMUM_ETHERNET_FRAME_SIZE) {
+ /* adjust PBA for jumbo frames */
+ E1000_WRITE_REG(&adapter->hw, PBA, pba);
+
+ /* To maintain wire speed transmits, the Tx FIFO should be
+ * large enough to accomodate two full transmit packets,
+ * rounded up to the next 1KB and expressed in KB. Likewise,
+ * the Rx FIFO should be large enough to accomodate at least
+ * one full receive packet and is similarly rounded up and
+ * expressed in KB. */
+ pba = E1000_READ_REG(&adapter->hw, PBA);
+ /* upper 16 bits has Tx packet buffer allocation size in KB */
+ tx_space = pba >> 16;
+ /* lower 16 bits has Rx packet buffer allocation size in KB */
+ pba &= 0xffff;
+ /* don't include ethernet FCS because hardware appends/strips */
+ min_tx_space =
+ min_rx_space = adapter->netdev->mtu + ENET_HEADER_SIZE +
+ VLAN_TAG_SIZE;
+ min_tx_space *= 2;
+ E1000_ROUNDUP(min_tx_space, 1024);
+ min_tx_space >>= 10;
+ E1000_ROUNDUP(min_rx_space, 1024);
+ min_rx_space >>= 10;
+
+ /* If current Tx allocation is less than the min Tx FIFO size,
+ * and the min Tx FIFO size is less than the current Rx FIFO
+ * allocation, take space away from current Rx allocation */
+ if (tx_space < min_tx_space &&
+ ((min_tx_space - tx_space) < pba)) {
+ pba = pba - (min_tx_space - tx_space);
- if (adapter->hw.mac_type == e1000_82547) {
- adapter->tx_fifo_head = 0;
- adapter->tx_head_addr = pba << E1000_TX_HEAD_ADDR_SHIFT;
- adapter->tx_fifo_size =
- (E1000_PBA_40K - pba) << E1000_PBA_BYTES_SHIFT;
- atomic_set(&adapter->tx_fifo_stall, 0);
+ /* PCI/PCIx hardware has PBA alignment constraints */
+ switch (adapter->hw.mac_type) {
+ case e1000_82545 ... e1000_82546_rev_3:
+ pba &= ~(E1000_PBA_8K - 1);
+ break;
+ default:
+ break;
+ }
+
+ /* if short on rx space, rx wins and must trump tx
+ * adjustment or use Early Receive if available */
+ if (pba < min_rx_space) {
+ switch (adapter->hw.mac_type) {
+ case e1000_82573:
+ /* ERT enabled in e1000_configure_rx */
+ break;
+ default:
+ pba = min_rx_space;
+ break;
+ }
+ }
+ }
}
E1000_WRITE_REG(&adapter->hw, PBA, pba);
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 10/22] e1000: Make copybreak parameter changeable by user.
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (8 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 09/22] e1000: Fix PBA allocation calculations Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-08 23:03 ` [PATCH 11/22] e1000: Fire a link even interrupt instead of a watchdog at init Kok, Auke
` (11 subsequent siblings)
21 siblings, 0 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Allow the user to vary the size that copybreak works. Currently cb is enabled
for packets < 256 bytes, but various tests indicate that this should be
configurable for specific use cases.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index a7dba40..0ebd8e2 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -213,6 +213,13 @@ static void e1000_netpoll (struct net_de
extern void e1000_check_options(struct e1000_adapter *adapter);
+#define COPYBREAK_DEFAULT 256
+static unsigned int copybreak __read_mostly = COPYBREAK_DEFAULT;
+module_param(copybreak, uint, 0644);
+MODULE_PARM_DESC(copybreak,
+ "Maximum size of packet that is copied to a new buffer on receive");
+
+
static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
pci_channel_state_t state);
static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev);
@@ -264,7 +271,13 @@ e1000_init_module(void)
printk(KERN_INFO "%s\n", e1000_copyright);
ret = pci_register_driver(&e1000_driver);
-
+ if (copybreak != COPYBREAK_DEFAULT) {
+ if (copybreak == 0)
+ printk(KERN_INFO "e1000: copybreak disabled\n");
+ else
+ printk(KERN_INFO "e1000: copybreak enabled for "
+ "packets <= %u bytes\n", copybreak);
+ }
return ret;
}
@@ -4235,8 +4248,7 @@ e1000_clean_rx_irq(struct e1000_adapter
/* code added for copybreak, this should improve
* performance for small packets with large amounts
* of reassembly being done in the stack */
-#define E1000_CB_LENGTH 256
- if (length < E1000_CB_LENGTH) {
+ if (length < copybreak) {
struct sk_buff *new_skb =
netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
if (new_skb) {
@@ -4394,7 +4406,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
/* page alloc/put takes too long and effects small packet
* throughput, so unsplit small packets and save the alloc/put*/
- if (l1 && ((length + l1) <= adapter->rx_ps_bsize0)) {
+ if (l1 && (l1 <= copybreak) && ((length + l1) <= adapter->rx_ps_bsize0)) {
u8 *vaddr;
/* there is no documentation about how to call
* kmap_atomic, so we can't hold the mapping
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 11/22] e1000: Fire a link even interrupt instead of a watchdog at init.
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (9 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 10/22] e1000: Make copybreak parameter changeable by user Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-11 22:48 ` Shaw Vrana
2006-12-08 23:03 ` [PATCH 12/22] e1000: Fix powerdown link loss when forced to gig speed Kok, Auke
` (10 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Instead of calling a watchdog event we let our interrupt handler
cascade a link event. This allows us to spot link up immediately
after _up() without racing against a new watchdog.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 0ebd8e2..c5c764f 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -558,7 +558,8 @@ e1000_up(struct e1000_adapter *adapter)
clear_bit(__E1000_DOWN, &adapter->flags);
- mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ);
+ /* fire a link change interrupt to start the watchdog */
+ E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_LSC);
return 0;
}
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 12/22] e1000: Fix powerdown link loss when forced to gig speed
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (10 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 11/22] e1000: Fire a link even interrupt instead of a watchdog at init Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-11 14:46 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 13/22] e1000: disable TSO when debugging slab Kok, Auke
` (9 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
disable phy power mode to prevent the NIC from attempting to autoneg
to i10/100mbit when running in forced gig mode as it would lose link at
shutdown. This allows you to force gig speed and still use WoL/IPMI
after shutdow.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index c5c764f..9ddcadd 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -819,6 +819,20 @@ e1000_reset(struct e1000_adapter *adapte
if (e1000_init_hw(&adapter->hw))
DPRINTK(PROBE, ERR, "Hardware Error\n");
e1000_update_mng_vlan(adapter);
+
+ /* if (adapter->hwflags & HWFLAGS_PHY_PWR_BIT) { */
+ if (adapter->hw.mac_type >= e1000_82544 &&
+ adapter->hw.mac_type <= e1000_82547_rev_2 &&
+ adapter->hw.autoneg == 1 &&
+ adapter->hw.autoneg_advertised == ADVERTISE_1000_FULL) {
+ uint32_t ctrl = E1000_READ_REG(&adapter->hw, CTRL);
+ /* clear phy power management bit if we are in gig only mode,
+ * which if enabled will attempt negotiation to 100Mb, which
+ * can cause a loss of link at power off or driver unload */
+ ctrl &= ~E1000_CTRL_SWDPIN3;
+ E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
+ }
+
/* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
E1000_WRITE_REG(&adapter->hw, VET, ETHERNET_IEEE_VLAN_TYPE);
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 13/22] e1000: disable TSO when debugging slab
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (11 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 12/22] e1000: Fix powerdown link loss when forced to gig speed Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-11 14:47 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 14/22] e1000: always turn on receives on esb2 Kok, Auke
` (8 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
CONFIG_DEBUG_SLAB kills TSO on the 82544, so we're better off turing TSO
off in this rare case, assuming performance is not an issue for people
running slab debugging.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 9ddcadd..12f9f61 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -998,6 +998,12 @@ e1000_probe(struct pci_dev *pdev,
(adapter->hw.mac_type != e1000_82547))
netdev->features |= NETIF_F_TSO;
+#ifdef CONFIG_DEBUG_SLAB
+ /* 82544's work arounds do not play nicely with DEBUG SLAB */
+ if (adapter->hw.mac_type == e1000_82544)
+ netdev->features &= ~NETIF_F_TSO;
+#endif
+
#ifdef NETIF_F_TSO6
if (adapter->hw.mac_type > e1000_82547_rev_2)
netdev->features |= NETIF_F_TSO6;
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 14/22] e1000: always turn on receives on esb2
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (12 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 13/22] e1000: disable TSO when debugging slab Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-11 14:47 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 15/22] e1000: simplify msi specific interrupt handler Kok, Auke
` (7 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
In rare occasions, esb2 systems would end up started without the RX
unit being turned on. Add a check that runs post-init to make sure.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 12f9f61..67fc379 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2673,6 +2673,13 @@ e1000_watchdog(unsigned long data)
netif_wake_queue(netdev);
mod_timer(&adapter->phy_info_timer, jiffies + 2 * HZ);
adapter->smartspeed = 0;
+ } else {
+ /* make sure the receive unit is started */
+ if (adapter->hw.mac_type == e1000_80003es2lan) {
+ struct e1000_hw *hw = &adapter->hw;
+ uint32_t rctl = E1000_READ_REG(hw, RCTL);
+ E1000_WRITE_REG(hw, RCTL, rctl | E1000_RCTL_EN);
+ }
}
} else {
if (netif_carrier_ok(netdev)) {
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 15/22] e1000: simplify msi specific interrupt handler
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (13 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 14/22] e1000: always turn on receives on esb2 Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-11 14:48 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 16/22] e1000: Rewrite parm handling code to warn when forcing autoneg to gig only Kok, Auke
` (6 subsequent siblings)
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Simplify the msi interrupt handler to avoid issues with delayed ICR reads.
This avoids adapter specific problems at the cost of some performance.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000.h | 1 -
drivers/net/e1000/e1000_main.c | 60 +++++++++++++---------------------------
2 files changed, 19 insertions(+), 42 deletions(-)
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index f091042..8e7acb0 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -257,7 +257,6 @@ struct e1000_adapter {
spinlock_t tx_queue_lock;
#endif
atomic_t irq_sem;
- unsigned int detect_link;
unsigned int total_tx_bytes;
unsigned int total_tx_packets;
unsigned int total_rx_bytes;
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 67fc379..cb6b732 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3778,8 +3778,8 @@ e1000_update_stats(struct e1000_adapter
* @data: pointer to a network interface device structure
**/
-static
-irqreturn_t e1000_intr_msi(int irq, void *data)
+static irqreturn_t
+e1000_intr_msi(int irq, void *data)
{
struct net_device *netdev = data;
struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -3787,49 +3787,27 @@ irqreturn_t e1000_intr_msi(int irq, void
#ifndef CONFIG_E1000_NAPI
int i;
#endif
+ uint32_t icr = E1000_READ_REG(hw, ICR);
- /* this code avoids the read of ICR but has to get 1000 interrupts
- * at every link change event before it will notice the change */
- if (++adapter->detect_link >= 1000) {
- uint32_t icr = E1000_READ_REG(hw, ICR);
#ifdef CONFIG_E1000_NAPI
- /* read ICR disables interrupts using IAM, so keep up with our
- * enable/disable accounting */
- atomic_inc(&adapter->irq_sem);
+ /* read ICR disables interrupts using IAM, so keep up with our
+ * enable/disable accounting */
+ atomic_inc(&adapter->irq_sem);
#endif
- adapter->detect_link = 0;
- if ((icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) &&
- (icr & E1000_ICR_INT_ASSERTED)) {
- hw->get_link_status = 1;
- /* 80003ES2LAN workaround--
- * For packet buffer work-around on link down event;
- * disable receives here in the ISR and
- * reset adapter in watchdog
- */
- if (netif_carrier_ok(netdev) &&
- (adapter->hw.mac_type == e1000_80003es2lan)) {
- /* disable receives */
- uint32_t rctl = E1000_READ_REG(hw, RCTL);
- E1000_WRITE_REG(hw, RCTL, rctl & ~E1000_RCTL_EN);
- }
- /* guard against interrupt when we're going down */
- if (!test_bit(__E1000_DOWN, &adapter->flags))
- mod_timer(&adapter->watchdog_timer,
- jiffies + 1);
+ if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
+ hw->get_link_status = 1;
+ /* 80003ES2LAN workaround-- For packet buffer work-around on
+ * link down event; disable receives here in the ISR and reset
+ * adapter in watchdog */
+ if (netif_carrier_ok(netdev) &&
+ (adapter->hw.mac_type == e1000_80003es2lan)) {
+ /* disable receives */
+ uint32_t rctl = E1000_READ_REG(hw, RCTL);
+ E1000_WRITE_REG(hw, RCTL, rctl & ~E1000_RCTL_EN);
}
- } else {
- E1000_WRITE_REG(hw, ICR, (0xffffffff & ~(E1000_ICR_RXSEQ |
- E1000_ICR_LSC)));
- /* bummer we have to flush here, but things break otherwise as
- * some event appears to be lost or delayed and throughput
- * drops. In almost all tests this flush is un-necessary */
- E1000_WRITE_FLUSH(hw);
-#ifdef CONFIG_E1000_NAPI
- /* Interrupt Auto-Mask (IAM)...upon writing ICR, interrupts are
- * masked. No need for the IMC write, but it does mean we
- * should account for it ASAP. */
- atomic_inc(&adapter->irq_sem);
-#endif
+ /* guard against interrupt when we're going down */
+ if (!test_bit(__E1000_DOWN, &adapter->flags))
+ mod_timer(&adapter->watchdog_timer, jiffies + 1);
}
#ifdef CONFIG_E1000_NAPI
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 16/22] e1000: Rewrite parm handling code to warn when forcing autoneg to gig only.
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (14 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 15/22] e1000: simplify msi specific interrupt handler Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-08 23:03 ` [PATCH 17/22] e1000: set max frame size before enabling new link settings Kok, Auke
` (5 subsequent siblings)
21 siblings, 0 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_param.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index cf2a279..f8862e2 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -760,22 +760,13 @@ e1000_check_copper_options(struct e1000_
case SPEED_1000:
DPRINTK(PROBE, INFO, "1000 Mbps Speed specified without "
"Duplex\n");
- DPRINTK(PROBE, INFO,
- "Using Autonegotiation at 1000 Mbps "
- "Full Duplex only\n");
- adapter->hw.autoneg = adapter->fc_autoneg = 1;
- adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
- break;
+ goto full_duplex_only;
case SPEED_1000 + HALF_DUPLEX:
DPRINTK(PROBE, INFO,
"Half Duplex is not supported at 1000 Mbps\n");
- DPRINTK(PROBE, INFO,
- "Using Autonegotiation at 1000 Mbps "
- "Full Duplex only\n");
- adapter->hw.autoneg = adapter->fc_autoneg = 1;
- adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
- break;
+ /* fall through */
case SPEED_1000 + FULL_DUPLEX:
+full_duplex_only:
DPRINTK(PROBE, INFO,
"Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->hw.autoneg = adapter->fc_autoneg = 1;
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 17/22] e1000: set max frame size before enabling new link settings
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (15 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 16/22] e1000: Rewrite parm handling code to warn when forcing autoneg to gig only Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-08 23:03 ` [PATCH 18/22] e1000: For older adapters, we know that the pci bus type is pci Kok, Auke
` (4 subsequent siblings)
21 siblings, 0 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index cb6b732..34ceff1 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3584,12 +3584,11 @@ e1000_change_mtu(struct net_device *netd
adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
netdev->mtu = new_mtu;
+ adapter->hw.max_frame_size = max_frame;
if (netif_running(netdev))
e1000_reinit_locked(adapter);
- adapter->hw.max_frame_size = max_frame;
-
return 0;
}
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 18/22] e1000: For older adapters, we know that the pci bus type is pci.
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (16 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 17/22] e1000: set max frame size before enabling new link settings Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-08 23:03 ` [PATCH 19/22] e1000: Don't set tipg (fiber) timings for pci-e adapters to fix fiber output Kok, Auke
` (3 subsequent siblings)
21 siblings, 0 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_hw.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 23826c7..4ad6a11 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -6575,7 +6575,7 @@ e1000_get_bus_info(struct e1000_hw *hw)
switch (hw->mac_type) {
case e1000_82542_rev2_0:
case e1000_82542_rev2_1:
- hw->bus_type = e1000_bus_type_unknown;
+ hw->bus_type = e1000_bus_type_pci;
hw->bus_speed = e1000_bus_speed_unknown;
hw->bus_width = e1000_bus_width_unknown;
break;
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 19/22] e1000: Don't set tipg (fiber) timings for pci-e adapters to fix fiber output
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (17 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 18/22] e1000: For older adapters, we know that the pci bus type is pci Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-08 23:03 ` [PATCH 20/22] e1000: Fix poor quad port performance with NAPI Kok, Auke
` (2 subsequent siblings)
21 siblings, 0 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
the driver has (ancient) code for messing with TIPG from the 82542 days.
Unfortunately this code was running on our current adapters and setting
TIPG for fiber to be +1 over the copper value. This caused 1.45Mpps
to be sent instead of 1.487Mpps.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@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 34ceff1..1a2b052 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1669,9 +1669,9 @@ e1000_configure_tx(struct e1000_adapter
}
/* Set the default values for the Tx Inter Packet Gap timer */
-
- if (hw->media_type == e1000_media_type_fiber ||
- hw->media_type == e1000_media_type_internal_serdes)
+ if (adapter->hw.mac_type <= e1000_82547_rev_2 &&
+ (hw->media_type == e1000_media_type_fiber ||
+ hw->media_type == e1000_media_type_internal_serdes))
tipg = DEFAULT_82543_TIPG_IPGT_FIBER;
else
tipg = DEFAULT_82543_TIPG_IPGT_COPPER;
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 20/22] e1000: Fix poor quad port performance with NAPI
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (18 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 19/22] e1000: Don't set tipg (fiber) timings for pci-e adapters to fix fiber output Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-11 14:49 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 21/22] e1000: Version increment 7.3.20-k2 and minor cleanups Kok, Auke
2006-12-08 23:03 ` [PATCH 22/22] # This series applies on GIT commit 0ae851352a87db3f829511816a2da227860bf585 Kok, Auke
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
This fix attempts to solve a customer reported issue with NAPI enabled
e1000 having bad performance when transmitting simultaneously on
four ports. The issue comes down to an interaction between NAPI
hardware interrupt balancing, and the driver rescheduling poll on
the same processor.
We try to fix by allowing the driver to re-enable interrupts sooner
instead of polling one more time, when there was recently all the
work completed in cleanup.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 1a2b052..458aa38 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3826,7 +3826,7 @@ e1000_intr_msi(int irq, void *data)
for (i = 0; i < E1000_MAX_INTR; i++)
if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring) &
- !e1000_clean_tx_irq(adapter, adapter->tx_ring)))
+ e1000_clean_tx_irq(adapter, adapter->tx_ring)))
break;
if (likely(adapter->itr_setting & 3))
@@ -3979,7 +3979,7 @@ e1000_clean(struct net_device *poll_dev,
poll_dev->quota -= work_done;
/* If no Tx and not enough Rx work done, exit the polling mode */
- if ((!tx_cleaned && (work_done == 0)) ||
+ if ((tx_cleaned && (work_done < work_to_do)) ||
!netif_running(poll_dev)) {
quit_polling:
if (likely(adapter->itr_setting & 3))
@@ -4009,7 +4009,7 @@ e1000_clean_tx_irq(struct e1000_adapter
#ifdef CONFIG_E1000_NAPI
unsigned int count = 0;
#endif
- boolean_t cleaned = FALSE;
+ boolean_t cleaned = TRUE;
unsigned int total_tx_bytes=0, total_tx_packets=0;
i = tx_ring->next_to_clean;
@@ -4025,13 +4025,17 @@ e1000_clean_tx_irq(struct e1000_adapter
if (cleaned) {
struct sk_buff *skb = buffer_info->skb;
#ifdef NETIF_F_TSO
- unsigned int segs = skb_shinfo(skb)->gso_segs;
- if (segs)
- total_tx_packets += segs;
-#endif
-
+ unsigned int segs, bytecount;
+ segs = skb_shinfo(skb)->gso_segs ?: 1;
+ /* multiply data chunks by size of headers */
+ bytecount = ((segs - 1) * skb_headlen(skb)) +
+ skb->len;
+ total_tx_packets += segs;
+ total_tx_bytes += bytecount;
+#else
total_tx_packets++;
total_tx_bytes += skb->len;
+#endif
}
e1000_unmap_and_free_tx_resource(adapter, buffer_info);
tx_desc->upper.data = 0;
@@ -4044,7 +4048,10 @@ e1000_clean_tx_irq(struct e1000_adapter
#ifdef CONFIG_E1000_NAPI
#define E1000_TX_WEIGHT 64
/* weight of a sort for tx, to avoid endless transmit cleanup */
- if (count++ == E1000_TX_WEIGHT) break;
+ if (count++ == E1000_TX_WEIGHT) {
+ cleaned = FALSE;
+ break;
+ }
#endif
}
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 21/22] e1000: Version increment 7.3.20-k2 and minor cleanups
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (19 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 20/22] e1000: Fix poor quad port performance with NAPI Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
2006-12-11 14:50 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 22/22] # This series applies on GIT commit 0ae851352a87db3f829511816a2da227860bf585 Kok, Auke
21 siblings, 1 reply; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000.h | 6 +----
drivers/net/e1000/e1000_hw.c | 52 +++++++++++++++++++--------------------
drivers/net/e1000/e1000_hw.h | 1 +
drivers/net/e1000/e1000_main.c | 9 +++----
drivers/net/e1000/e1000_osdep.h | 9 +------
5 files changed, 32 insertions(+), 45 deletions(-)
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 8e7acb0..7c48680 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -61,6 +61,7 @@
#include <linux/ip.h>
#ifdef NETIF_F_TSO6
#include <linux/ipv6.h>
+#include <net/ip6_checksum.h>
#endif
#include <linux/tcp.h>
#include <linux/udp.h>
@@ -85,11 +86,7 @@ struct e1000_adapter;
#include "e1000_hw.h"
-#ifdef DBG
-#define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
-#else
#define E1000_DBG(args...)
-#endif
#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args)
@@ -361,5 +358,4 @@ enum e1000_state_t {
__E1000_RESETTING,
__E1000_DOWN
};
-
#endif /* _E1000_H_ */
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 4ad6a11..9a295e0 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -718,8 +718,6 @@ e1000_reset_hw(struct e1000_hw *hw)
*
* hw: Struct containing variables accessed by shared code
*
- * This function contains hardware limitation workarounds for PCI-E adapters
- *
*****************************************************************************/
static void
e1000_initialize_hardware_bits(struct e1000_hw *hw)
@@ -731,14 +729,15 @@ e1000_initialize_hardware_bits(struct e1
uint32_t reg_tctl;
uint32_t reg_txdctl, reg_txdctl1;
- /* link autonegotiation/sync workarounds */
reg_tarc0 = E1000_READ_REG(hw, TARC0);
+ /* link autonegotiation/sync workarounds */
reg_tarc0 &= ~((1 << 30)|(1 << 29)|(1 << 28)|(1 << 27));
- /* Enable not-done TX descriptor counting */
reg_txdctl = E1000_READ_REG(hw, TXDCTL);
+ /* Enable not-done TX descriptor counting */
reg_txdctl |= E1000_TXDCTL_COUNT_DESC;
E1000_WRITE_REG(hw, TXDCTL, reg_txdctl);
+
reg_txdctl1 = E1000_READ_REG(hw, TXDCTL1);
reg_txdctl1 |= E1000_TXDCTL_COUNT_DESC;
E1000_WRITE_REG(hw, TXDCTL1, reg_txdctl1);
@@ -746,18 +745,18 @@ e1000_initialize_hardware_bits(struct e1
switch (hw->mac_type) {
case e1000_82571:
case e1000_82572:
- /* Clear PHY TX compatible mode bits */
reg_tarc1 = E1000_READ_REG(hw, TARC1);
+ reg_tctl = E1000_READ_REG(hw, TCTL);
+
+ /* Clear PHY TX compatible mode bits */
reg_tarc1 &= ~((1 << 30)|(1 << 29));
/* link autonegotiation/sync workarounds */
reg_tarc0 |= ((1 << 26)|(1 << 25)|(1 << 24)|(1 << 23));
-
/* TX ring control fixes */
reg_tarc1 |= ((1 << 26)|(1 << 25)|(1 << 24));
/* Multiple read bit is reversed polarity */
- reg_tctl = E1000_READ_REG(hw, TCTL);
if (reg_tctl & E1000_TCTL_MULR)
reg_tarc1 &= ~(1 << 28);
else
@@ -767,18 +766,18 @@ e1000_initialize_hardware_bits(struct e1
break;
case e1000_82573:
reg_ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
+ reg_ctrl = E1000_READ_REG(hw, CTRL);
+
reg_ctrl_ext &= ~(1 << 23);
reg_ctrl_ext |= (1 << 22);
-
/* TX byte count fix */
- reg_ctrl = E1000_READ_REG(hw, CTRL);
reg_ctrl &= ~(1 << 29);
E1000_WRITE_REG(hw, CTRL_EXT, reg_ctrl_ext);
E1000_WRITE_REG(hw, CTRL, reg_ctrl);
break;
case e1000_80003es2lan:
- /* improve small packet performace for fiber/serdes */
+ /* improve small packet performance for fiber/serdes */
if ((hw->media_type == e1000_media_type_fiber) ||
(hw->media_type == e1000_media_type_internal_serdes)) {
reg_tarc0 &= ~(1 << 20);
@@ -800,7 +799,6 @@ e1000_initialize_hardware_bits(struct e1
((hw->device_id != E1000_DEV_ID_ICH8_IGP_M_AMT) &&
(hw->device_id != E1000_DEV_ID_ICH8_IGP_M)))
reg_tarc0 |= ((1 << 29)|(1 << 28));
-
reg_ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
reg_ctrl_ext |= (1 << 22);
E1000_WRITE_REG(hw, CTRL_EXT, reg_ctrl_ext);
@@ -808,15 +806,16 @@ e1000_initialize_hardware_bits(struct e1
/* workaround TX hang with TSO=on */
reg_tarc0 |= ((1 << 27)|(1 << 26)|(1 << 24)|(1 << 23));
- /* Multiple read bit is reversed polarity */
- reg_tctl = E1000_READ_REG(hw, TCTL);
reg_tarc1 = E1000_READ_REG(hw, TARC1);
+ reg_tctl = E1000_READ_REG(hw, TCTL);
+
+ /* Multiple read bit is reversed polarity */
if (reg_tctl & E1000_TCTL_MULR)
reg_tarc1 &= ~(1 << 28);
else
reg_tarc1 |= (1 << 28);
- /* workaround TX hang with TSO=on */
+ /* workaround TX hang and TSO=on */
reg_tarc1 |= ((1 << 30)|(1 << 26)|(1 << 24));
E1000_WRITE_REG(hw, TARC1, reg_tarc1);
@@ -4580,7 +4579,6 @@ e1000_init_eeprom_params(struct e1000_hw
hw->flash_bank_size *= ICH_FLASH_SECTOR_SIZE;
hw->flash_bank_size /= 2 * sizeof(uint16_t);
-
break;
}
default:
@@ -6342,12 +6340,12 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw
temp = E1000_READ_REG(hw, FCRUC);
if (hw->mac_type != e1000_ich8lan) {
- temp = E1000_READ_REG(hw, PRC64);
- temp = E1000_READ_REG(hw, PRC127);
- temp = E1000_READ_REG(hw, PRC255);
- temp = E1000_READ_REG(hw, PRC511);
- temp = E1000_READ_REG(hw, PRC1023);
- temp = E1000_READ_REG(hw, PRC1522);
+ temp = E1000_READ_REG(hw, PRC64);
+ temp = E1000_READ_REG(hw, PRC127);
+ temp = E1000_READ_REG(hw, PRC255);
+ temp = E1000_READ_REG(hw, PRC511);
+ temp = E1000_READ_REG(hw, PRC1023);
+ temp = E1000_READ_REG(hw, PRC1522);
}
temp = E1000_READ_REG(hw, GPRC);
@@ -6371,12 +6369,12 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw
temp = E1000_READ_REG(hw, TPT);
if (hw->mac_type != e1000_ich8lan) {
- temp = E1000_READ_REG(hw, PTC64);
- temp = E1000_READ_REG(hw, PTC127);
- temp = E1000_READ_REG(hw, PTC255);
- temp = E1000_READ_REG(hw, PTC511);
- temp = E1000_READ_REG(hw, PTC1023);
- temp = E1000_READ_REG(hw, PTC1522);
+ temp = E1000_READ_REG(hw, PTC64);
+ temp = E1000_READ_REG(hw, PTC127);
+ temp = E1000_READ_REG(hw, PTC255);
+ temp = E1000_READ_REG(hw, PTC511);
+ temp = E1000_READ_REG(hw, PTC1023);
+ temp = E1000_READ_REG(hw, PTC1522);
}
temp = E1000_READ_REG(hw, MPTC);
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index fd15f62..520e52d 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1042,6 +1042,7 @@ struct e1000_ffvt_entry {
#define E1000_ICRXDMTC 0x04120 /* Interrupt Cause Rx Descriptor Minimum Threshold Count */
#define E1000_ICRXOC 0x04124 /* Interrupt Cause Receiver Overrun Count */
#define E1000_RXCSUM 0x05000 /* RX Checksum Control - RW */
+#define E1000_RLPML 0x05004 /* RX Long Packet Max Length */
#define E1000_RFCTL 0x05008 /* Receive Filter Control*/
#define E1000_MTA 0x05200 /* Multicast Table Array - RW Array */
#define E1000_RA 0x05400 /* Receive Address - RW Array */
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 458aa38..092476a 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -27,7 +27,6 @@
*******************************************************************************/
#include "e1000.h"
-#include <net/ip6_checksum.h>
char e1000_driver_name[] = "e1000";
static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
@@ -36,7 +35,7 @@ static char e1000_driver_string[] = "Int
#else
#define DRIVERNAPI "-NAPI"
#endif
-#define DRV_VERSION "7.3.15-k2"DRIVERNAPI
+#define DRV_VERSION "7.3.20-k2"DRIVERNAPI
char e1000_driver_version[] = DRV_VERSION;
static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
@@ -1353,7 +1352,6 @@ e1000_sw_init(struct e1000_adapter *adap
spin_lock_init(&adapter->stats_lock);
set_bit(__E1000_DOWN, &adapter->flags);
-
return 0;
}
@@ -1713,7 +1711,8 @@ e1000_configure_tx(struct e1000_adapter
tarc = E1000_READ_REG(hw, TARC0);
/* set the speed mode bit, we'll clear it if we're not at
* gigabit link later */
- tarc |= (1 << 21);
+#define SPEED_MODE_BIT (1 << 21)
+ tarc |= SPEED_MODE_BIT;
E1000_WRITE_REG(hw, TARC0, tarc);
} else if (hw->mac_type == e1000_80003es2lan) {
tarc = E1000_READ_REG(hw, TARC0);
@@ -2631,7 +2630,7 @@ e1000_watchdog(unsigned long data)
txb2b == 0) {
uint32_t tarc0;
tarc0 = E1000_READ_REG(&adapter->hw, TARC0);
- tarc0 &= ~(1 << 21);
+ tarc0 &= ~SPEED_MODE_BIT;
E1000_WRITE_REG(&adapter->hw, TARC0, tarc0);
}
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
index 18afc0c..da8c641 100644
--- a/drivers/net/e1000/e1000_osdep.h
+++ b/drivers/net/e1000/e1000_osdep.h
@@ -48,17 +48,10 @@ typedef enum {
TRUE = 1
} boolean_t;
-#define MSGOUT(S, A, B) printk(KERN_DEBUG S "\n", A, B)
-
-#ifdef DBG
-#define DEBUGOUT(S) printk(KERN_DEBUG S "\n")
-#define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A)
-#else
#define DEBUGOUT(S)
#define DEBUGOUT1(S, A...)
-#endif
-#define DEBUGFUNC(F) DEBUGOUT(F)
+#define DEBUGFUNC(F) DEBUGOUT(F "\n")
#define DEBUGOUT2 DEBUGOUT1
#define DEBUGOUT3 DEBUGOUT2
#define DEBUGOUT7 DEBUGOUT3
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 22/22] # This series applies on GIT commit 0ae851352a87db3f829511816a2da227860bf585
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
` (20 preceding siblings ...)
2006-12-08 23:03 ` [PATCH 21/22] e1000: Version increment 7.3.20-k2 and minor cleanups Kok, Auke
@ 2006-12-08 23:03 ` Kok, Auke
21 siblings, 0 replies; 37+ messages in thread
From: Kok, Auke @ 2006-12-08 23:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke, Ronciak, John
00_ixgb_sentinel.patch
01_ixgb_maybe_stop_tx.patch
02_ixgb_reorder_write.patch
03_e1000_add_fc_detect_printout.patch
04_e1000_itr_fixups.patch
05_e1000_cosmetic_csum_changes.patch
06_e1000_fix_tx_carrier_errors.patch
07_e1000_init_release_manageability.patch
08_e1000_pba_calc.patch
09_e1000_copybreak_size_parm.patch
10_e1000_fire_link_event.patch
11_e1000_phy_link_power_mode.patch
12_e1000_debug_slab_82544.patch
13_e1000_start_rx_unit.patch
14_e1000_msi_intr_fixes.patch
15_e1000_gig_full_forcing.patch
16_e1000_set_framesiz_before_reset.patch
17_e1000_set_type_to_pci.patch
18_e1000_tipg_type.patch
19_e1000_e1000_clean_tx_irq.patch
20_e1000_cleanups_version.patch
---
0 files changed, 0 insertions(+), 0 deletions(-)
---
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/22] e1000: Fix early TSO completion
2006-12-08 23:02 ` [PATCH 01/22] e1000: Fix early TSO completion Kok, Auke
@ 2006-12-11 14:36 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:36 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> This fix was already merged in commit 96f9c2e277768099479fbed7c3b69c294b1fadef
> but reverted in commit 989316ddfeafd0e8fb51a4d811383769ad62637a. After
> stresstesting we found that the fix does not add new regressions and
> works around a TX hang spotted by several users.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
ACK content except for one detail: don't add new NETIF_F_TSO ifdefs.
Modern 2.6 kernel code should simply assume that TSO is present.
Jeff
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 03/22] ixgb: Write RA register high word first, increment version
2006-12-08 23:02 ` [PATCH 03/22] ixgb: Write RA register high word first, increment version Kok, Auke
@ 2006-12-11 14:37 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:37 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> We need to disable the AV bit before flushing the low register.
>
> Signed-off-by: <aaron.k.salter@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
>
> drivers/net/ixgb/ixgb_hw.c | 3 ++-
> drivers/net/ixgb/ixgb_main.c | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
> index 02089b6..ecbf458 100644
> --- a/drivers/net/ixgb/ixgb_hw.c
> +++ b/drivers/net/ixgb/ixgb_hw.c
> @@ -399,8 +399,9 @@ ixgb_init_rx_addrs(struct ixgb_hw *hw)
> /* Zero out the other 15 receive addresses. */
> DEBUGOUT("Clearing RAR[1-15]\n");
> for(i = 1; i < IXGB_RAR_ENTRIES; i++) {
> - IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
> + /* Write high reg first to disable the AV bit first */
> IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0);
> + IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
Are you sure the order is guaranteed even after this code change, when
considering all manner of CPU and bus posted writes?
ACK if yes
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 02/22] ixgb: Maybe stop TX if not enough free descriptors
2006-12-08 23:02 ` [PATCH 02/22] ixgb: Maybe stop TX if not enough free descriptors Kok, Auke
@ 2006-12-11 14:37 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:37 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> A similar patch to commit 65c7973fa5b46b024f38be208aa477e8daf9a603
> but now for ixgb.
>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
ACK
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 08/22] e1000: Fix all manageability workarounds
2006-12-08 23:03 ` [PATCH 08/22] e1000: Fix all manageability workarounds Kok, Auke
@ 2006-12-11 14:41 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:41 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> + /* enable receiving management packets to the host */
> + /* this will probably generate destination unreachable messages
> + * from the host OS, but the packets will be handled on SMBUS */
> + if (adapter->hw.mac_type >= e1000_82571) {
> + manc |= E1000_MANC_EN_MNG2HOST;
> +#define E1000_MNG2HOST_PORT_623 (1 << 5)
> +#define E1000_MNG2HOST_PORT_664 (1 << 6)
> + manc2h |= E1000_MNG2HOST_PORT_623;
> + manc2h |= E1000_MNG2HOST_PORT_664;
> + E1000_WRITE_REG(&adapter->hw, MANC2H, manc2h);
> + }
> +
> + E1000_WRITE_REG(&adapter->hw, MANC, manc);
NAK, test a management packet feature, not a mac type
> + }
> +}
> +
> +static void
> +e1000_release_manageability(struct e1000_adapter *adapter)
> +{
> + if (adapter->en_mng_pt) {
> + uint32_t manc = E1000_READ_REG(&adapter->hw, MANC);
> +
> + /* re-enable hardware interception of ARP */
> + manc |= E1000_MANC_ARP_EN;
> +
> + if (adapter->hw.mac_type >= e1000_82571)
> + manc &= ~E1000_MANC_EN_MNG2HOST;
ditto. can't you see how fragile the above code test is, when compared
with testing a feature bit?
> + /* don't explicitly have to mess with MANC2H since
> + * MANC has an enable disable that gates MANC2H */
> +
> + /* XXX stop the hardware watchdog ? */
> +
> + E1000_WRITE_REG(&adapter->hw, MANC, manc);
> + }
> +}
> +
> int
> e1000_up(struct e1000_adapter *adapter)
> {
> @@ -475,6 +522,7 @@ e1000_up(struct e1000_adapter *adapter)
> e1000_set_multi(netdev);
>
> e1000_restore_vlan(adapter);
> + e1000_init_manageability(adapter);
>
> e1000_configure_tx(adapter);
> e1000_setup_rctl(adapter);
> @@ -705,14 +753,7 @@ e1000_reset(struct e1000_adapter *adapte
> phy_data);
> }
>
> - if ((adapter->en_mng_pt) &&
> - (adapter->hw.mac_type >= e1000_82540) &&
> - (adapter->hw.mac_type < e1000_82571) &&
> - (adapter->hw.media_type == e1000_media_type_copper)) {
> - manc = E1000_READ_REG(&adapter->hw, MANC);
> - manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
> - E1000_WRITE_REG(&adapter->hw, MANC, manc);
> - }
> + e1000_release_manageability(adapter);
> }
>
> /**
> @@ -1078,22 +1119,13 @@ e1000_remove(struct pci_dev *pdev)
> {
> struct net_device *netdev = pci_get_drvdata(pdev);
> struct e1000_adapter *adapter = netdev_priv(netdev);
> - uint32_t manc;
> #ifdef CONFIG_E1000_NAPI
> int i;
> #endif
>
> flush_scheduled_work();
>
> - if (adapter->hw.mac_type >= e1000_82540 &&
> - adapter->hw.mac_type < e1000_82571 &&
> - adapter->hw.media_type == e1000_media_type_copper) {
> - manc = E1000_READ_REG(&adapter->hw, MANC);
> - if (manc & E1000_MANC_SMBUS_EN) {
> - manc |= E1000_MANC_ARP_EN;
> - E1000_WRITE_REG(&adapter->hw, MANC, manc);
> - }
> - }
> + e1000_release_manageability(adapter);
>
> /* Release control of h/w to f/w. If f/w is AMT enabled, this
> * would have already happened in close and is redundant. */
> @@ -3615,6 +3647,14 @@ e1000_update_stats(struct e1000_adapter
> adapter->phy_stats.receive_errors += phy_tmp;
> }
>
> + /* Management Stats */
> + if (adapter->hw.mac_type > e1000_82544) {
> + adapter->stats.mgptc += E1000_READ_REG(hw, MGTPTC);
> + adapter->stats.mgprc += E1000_READ_REG(hw, MGTPRC);
> + adapter->stats.mgpdc += E1000_READ_REG(hw, MGTPDC);
> + }
test a feature bit
> spin_unlock_irqrestore(&adapter->stats_lock, flags);
> }
> #ifdef CONFIG_PCI_MSI
> @@ -5027,7 +5067,7 @@ e1000_suspend(struct pci_dev *pdev, pm_m
> {
> struct net_device *netdev = pci_get_drvdata(pdev);
> struct e1000_adapter *adapter = netdev_priv(netdev);
> - uint32_t ctrl, ctrl_ext, rctl, manc, status;
> + uint32_t ctrl, ctrl_ext, rctl, status;
> uint32_t wufc = adapter->wol;
> #ifdef CONFIG_PM
> int retval = 0;
> @@ -5096,16 +5136,12 @@ e1000_suspend(struct pci_dev *pdev, pm_m
> pci_enable_wake(pdev, PCI_D3cold, 0);
> }
>
> - if (adapter->hw.mac_type >= e1000_82540 &&
> - adapter->hw.mac_type < e1000_82571 &&
> - adapter->hw.media_type == e1000_media_type_copper) {
> - manc = E1000_READ_REG(&adapter->hw, MANC);
> - if (manc & E1000_MANC_SMBUS_EN) {
> - manc |= E1000_MANC_ARP_EN;
> - E1000_WRITE_REG(&adapter->hw, MANC, manc);
> - pci_enable_wake(pdev, PCI_D3hot, 1);
> - pci_enable_wake(pdev, PCI_D3cold, 1);
> - }
> + e1000_release_manageability(adapter);
> +
> + /* make sure adapter isn't asleep if manageability is enabled */
> + if (adapter->en_mng_pt) {
> + pci_enable_wake(pdev, PCI_D3hot, 1);
> + pci_enable_wake(pdev, PCI_D3cold, 1);
> }
>
> if (adapter->hw.phy_type == e1000_phy_igp_3)
> @@ -5131,7 +5167,7 @@ e1000_resume(struct pci_dev *pdev)
> {
> struct net_device *netdev = pci_get_drvdata(pdev);
> struct e1000_adapter *adapter = netdev_priv(netdev);
> - uint32_t manc, err;
> + uint32_t err;
>
> pci_set_power_state(pdev, PCI_D0);
> e1000_pci_restore_state(adapter);
> @@ -5151,19 +5187,13 @@ e1000_resume(struct pci_dev *pdev)
> e1000_reset(adapter);
> E1000_WRITE_REG(&adapter->hw, WUS, ~0);
>
> + e1000_init_manageability(adapter);
> +
> if (netif_running(netdev))
> e1000_up(adapter);
>
> netif_device_attach(netdev);
>
> - if (adapter->hw.mac_type >= e1000_82540 &&
> - adapter->hw.mac_type < e1000_82571 &&
> - adapter->hw.media_type == e1000_media_type_copper) {
> - manc = E1000_READ_REG(&adapter->hw, MANC);
> - manc &= ~(E1000_MANC_ARP_EN);
> - E1000_WRITE_REG(&adapter->hw, MANC, manc);
> - }
> -
> /* If the controller is 82573 and f/w is AMT, do not set
> * DRV_LOAD until the interface is up. For all other cases,
> * let the f/w know that the h/w is now under the control
> @@ -5264,7 +5294,8 @@ static void e1000_io_resume(struct pci_d
> {
> struct net_device *netdev = pci_get_drvdata(pdev);
> struct e1000_adapter *adapter = netdev->priv;
> - uint32_t manc, swsm;
> +
> + e1000_init_manageability(adapter);
>
> if (netif_running(netdev)) {
> if (e1000_up(adapter)) {
> @@ -5275,26 +5306,14 @@ static void e1000_io_resume(struct pci_d
>
> netif_device_attach(netdev);
>
> - if (adapter->hw.mac_type >= e1000_82540 &&
> - adapter->hw.mac_type < e1000_82571 &&
> - adapter->hw.media_type == e1000_media_type_copper) {
> - manc = E1000_READ_REG(&adapter->hw, MANC);
> - manc &= ~(E1000_MANC_ARP_EN);
> - E1000_WRITE_REG(&adapter->hw, MANC, manc);
> - }
> -
> - switch (adapter->hw.mac_type) {
> - case e1000_82573:
> - swsm = E1000_READ_REG(&adapter->hw, SWSM);
> - E1000_WRITE_REG(&adapter->hw, SWSM,
> - swsm | E1000_SWSM_DRV_LOAD);
> - break;
> - default:
> - break;
> - }
> + /* If the controller is 82573 and f/w is AMT, do not set
> + * DRV_LOAD until the interface is up. For all other cases,
> + * let the f/w know that the h/w is now under the control
> + * of the driver. */
> + if (adapter->hw.mac_type != e1000_82573 ||
> + !e1000_check_mng_mode(&adapter->hw))
> + e1000_get_hw_control(adapter);
ditto
> - if (netif_running(netdev))
> - mod_timer(&adapter->watchdog_timer, jiffies);
> }
>
> /* e1000_main.c */
>
>
>
> ---
> Auke Kok <auke-jan.h.kok@intel.com>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 06/22] e1000: minor tso ipv6 cleanups
2006-12-08 23:02 ` [PATCH 06/22] e1000: minor tso ipv6 cleanups Kok, Auke
@ 2006-12-11 14:42 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:42 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> Zero descriptor ip_config field and use skb_shinfo to detect IPV6 packet.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
ACK patches 4-6
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 07/22] e1000: omit stats for broken counter in 82543
2006-12-08 23:02 ` [PATCH 07/22] e1000: omit stats for broken counter in 82543 Kok, Auke
@ 2006-12-11 14:42 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:42 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> 82543 does not count tx_carrier_errors properly in FD mode.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
>
> drivers/net/e1000/e1000_main.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> index dc76e01..7639b4d 100644
> --- a/drivers/net/e1000/e1000_main.c
> +++ b/drivers/net/e1000/e1000_main.c
> @@ -3592,7 +3592,12 @@ e1000_update_stats(struct e1000_adapter
> adapter->net_stats.tx_errors = adapter->stats.txerrc;
> adapter->net_stats.tx_aborted_errors = adapter->stats.ecol;
> adapter->net_stats.tx_window_errors = adapter->stats.latecol;
> - adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
> + if (adapter->hw.mac_type == e1000_82543 &&
> + adapter->link_duplex == FULL_DUPLEX) {
> + adapter->net_stats.tx_carrier_errors = 0;
> + adapter->stats.tncrs = 0;
> + } else
> + adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
test a feature bit (really a quirk bit, in this case)
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 12/22] e1000: Fix powerdown link loss when forced to gig speed
2006-12-08 23:03 ` [PATCH 12/22] e1000: Fix powerdown link loss when forced to gig speed Kok, Auke
@ 2006-12-11 14:46 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:46 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> disable phy power mode to prevent the NIC from attempting to autoneg
> to i10/100mbit when running in forced gig mode as it would lose link at
> shutdown. This allows you to force gig speed and still use WoL/IPMI
> after shutdow.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
ACK patches 9-12. in case you're wondering why I didn't gripe about
feature bits more: Reset code [e1000_reset] will naturally have quite a
few "if chip rev == blah" tests, and creating feature bits for each of
those cases can be tedious. However, flags should be used (a la tg3)
rather than all these 'switch(rev)' statements and 'if (rev > x && rev <
y)' statements.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 13/22] e1000: disable TSO when debugging slab
2006-12-08 23:03 ` [PATCH 13/22] e1000: disable TSO when debugging slab Kok, Auke
@ 2006-12-11 14:47 ` Jeff Garzik
2006-12-15 2:42 ` Herbert Xu
0 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:47 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> CONFIG_DEBUG_SLAB kills TSO on the 82544, so we're better off turing TSO
> off in this rare case, assuming performance is not an issue for people
> running slab debugging.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
>
> drivers/net/e1000/e1000_main.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> index 9ddcadd..12f9f61 100644
> --- a/drivers/net/e1000/e1000_main.c
> +++ b/drivers/net/e1000/e1000_main.c
> @@ -998,6 +998,12 @@ e1000_probe(struct pci_dev *pdev,
> (adapter->hw.mac_type != e1000_82547))
> netdev->features |= NETIF_F_TSO;
>
> +#ifdef CONFIG_DEBUG_SLAB
> + /* 82544's work arounds do not play nicely with DEBUG SLAB */
> + if (adapter->hw.mac_type == e1000_82544)
> + netdev->features &= ~NETIF_F_TSO;
> +#endif
ACK, provided that you greatly enhance the comment to explain -why-, not
just the desired results.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 14/22] e1000: always turn on receives on esb2
2006-12-08 23:03 ` [PATCH 14/22] e1000: always turn on receives on esb2 Kok, Auke
@ 2006-12-11 14:47 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:47 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> In rare occasions, esb2 systems would end up started without the RX
> unit being turned on. Add a check that runs post-init to make sure.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
>
> drivers/net/e1000/e1000_main.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> index 12f9f61..67fc379 100644
> --- a/drivers/net/e1000/e1000_main.c
> +++ b/drivers/net/e1000/e1000_main.c
> @@ -2673,6 +2673,13 @@ e1000_watchdog(unsigned long data)
> netif_wake_queue(netdev);
> mod_timer(&adapter->phy_info_timer, jiffies + 2 * HZ);
> adapter->smartspeed = 0;
> + } else {
> + /* make sure the receive unit is started */
> + if (adapter->hw.mac_type == e1000_80003es2lan) {
> + struct e1000_hw *hw = &adapter->hw;
> + uint32_t rctl = E1000_READ_REG(hw, RCTL);
> + E1000_WRITE_REG(hw, RCTL, rctl | E1000_RCTL_EN);
> + }
seems like feature flag territory to me
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 15/22] e1000: simplify msi specific interrupt handler
2006-12-08 23:03 ` [PATCH 15/22] e1000: simplify msi specific interrupt handler Kok, Auke
@ 2006-12-11 14:48 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:48 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> Simplify the msi interrupt handler to avoid issues with delayed ICR reads.
> This avoids adapter specific problems at the cost of some performance.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
>
> drivers/net/e1000/e1000.h | 1 -
> drivers/net/e1000/e1000_main.c | 60 +++++++++++++---------------------------
> 2 files changed, 19 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
> index f091042..8e7acb0 100644
> --- a/drivers/net/e1000/e1000.h
> +++ b/drivers/net/e1000/e1000.h
> @@ -257,7 +257,6 @@ struct e1000_adapter {
> spinlock_t tx_queue_lock;
> #endif
> atomic_t irq_sem;
> - unsigned int detect_link;
> unsigned int total_tx_bytes;
> unsigned int total_tx_packets;
> unsigned int total_rx_bytes;
> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> index 67fc379..cb6b732 100644
> --- a/drivers/net/e1000/e1000_main.c
> +++ b/drivers/net/e1000/e1000_main.c
> @@ -3778,8 +3778,8 @@ e1000_update_stats(struct e1000_adapter
> * @data: pointer to a network interface device structure
> **/
>
> -static
> -irqreturn_t e1000_intr_msi(int irq, void *data)
> +static irqreturn_t
> +e1000_intr_msi(int irq, void *data)
> {
> struct net_device *netdev = data;
> struct e1000_adapter *adapter = netdev_priv(netdev);
> @@ -3787,49 +3787,27 @@ irqreturn_t e1000_intr_msi(int irq, void
> #ifndef CONFIG_E1000_NAPI
> int i;
> #endif
> + uint32_t icr = E1000_READ_REG(hw, ICR);
>
> - /* this code avoids the read of ICR but has to get 1000 interrupts
> - * at every link change event before it will notice the change */
> - if (++adapter->detect_link >= 1000) {
> - uint32_t icr = E1000_READ_REG(hw, ICR);
> #ifdef CONFIG_E1000_NAPI
> - /* read ICR disables interrupts using IAM, so keep up with our
> - * enable/disable accounting */
> - atomic_inc(&adapter->irq_sem);
> + /* read ICR disables interrupts using IAM, so keep up with our
> + * enable/disable accounting */
> + atomic_inc(&adapter->irq_sem);
> #endif
> - adapter->detect_link = 0;
> - if ((icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) &&
> - (icr & E1000_ICR_INT_ASSERTED)) {
> - hw->get_link_status = 1;
> - /* 80003ES2LAN workaround--
> - * For packet buffer work-around on link down event;
> - * disable receives here in the ISR and
> - * reset adapter in watchdog
> - */
> - if (netif_carrier_ok(netdev) &&
> - (adapter->hw.mac_type == e1000_80003es2lan)) {
> - /* disable receives */
> - uint32_t rctl = E1000_READ_REG(hw, RCTL);
> - E1000_WRITE_REG(hw, RCTL, rctl & ~E1000_RCTL_EN);
> - }
> - /* guard against interrupt when we're going down */
> - if (!test_bit(__E1000_DOWN, &adapter->flags))
> - mod_timer(&adapter->watchdog_timer,
> - jiffies + 1);
> + if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
> + hw->get_link_status = 1;
> + /* 80003ES2LAN workaround-- For packet buffer work-around on
> + * link down event; disable receives here in the ISR and reset
> + * adapter in watchdog */
> + if (netif_carrier_ok(netdev) &&
> + (adapter->hw.mac_type == e1000_80003es2lan)) {
> + /* disable receives */
> + uint32_t rctl = E1000_READ_REG(hw, RCTL);
> + E1000_WRITE_REG(hw, RCTL, rctl & ~E1000_RCTL_EN);
feature flag
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 20/22] e1000: Fix poor quad port performance with NAPI
2006-12-08 23:03 ` [PATCH 20/22] e1000: Fix poor quad port performance with NAPI Kok, Auke
@ 2006-12-11 14:49 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:49 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> This fix attempts to solve a customer reported issue with NAPI enabled
> e1000 having bad performance when transmitting simultaneously on
> four ports. The issue comes down to an interaction between NAPI
> hardware interrupt balancing, and the driver rescheduling poll on
> the same processor.
>
> We try to fix by allowing the driver to re-enable interrupts sooner
> instead of polling one more time, when there was recently all the
> work completed in cleanup.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
ACK patches 16-20
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 21/22] e1000: Version increment 7.3.20-k2 and minor cleanups
2006-12-08 23:03 ` [PATCH 21/22] e1000: Version increment 7.3.20-k2 and minor cleanups Kok, Auke
@ 2006-12-11 14:50 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2006-12-11 14:50 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
Kok, Auke wrote:
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
ACK
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 11/22] e1000: Fire a link even interrupt instead of a watchdog at init.
2006-12-08 23:03 ` [PATCH 11/22] e1000: Fire a link even interrupt instead of a watchdog at init Kok, Auke
@ 2006-12-11 22:48 ` Shaw Vrana
0 siblings, 0 replies; 37+ messages in thread
From: Shaw Vrana @ 2006-12-11 22:48 UTC (permalink / raw)
To: Kok, Auke
Cc: Garzik, Jeff, netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
On Fri, Dec 08, 2006 at 03:03:09PM -0800, Kok, Auke wrote:
>
> Instead of calling a watchdog event we let our interrupt handler
> cascade a link event. This allows us to spot link up immediately
> after _up() without racing against a new watchdog.
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
>
> drivers/net/e1000/e1000_main.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> index 0ebd8e2..c5c764f 100644
> --- a/drivers/net/e1000/e1000_main.c
> +++ b/drivers/net/e1000/e1000_main.c
> @@ -558,7 +558,8 @@ e1000_up(struct e1000_adapter *adapter)
>
> clear_bit(__E1000_DOWN, &adapter->flags);
>
> - mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ);
> + /* fire a link change interrupt to start the watchdog */
> + E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_LSC);
> return 0;
> }
Hi Auke,
Could you explain the race, how it would be triggered, and what it might
look like if it were to occur?
Thanks,
Shaw
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 13/22] e1000: disable TSO when debugging slab
2006-12-11 14:47 ` Jeff Garzik
@ 2006-12-15 2:42 ` Herbert Xu
0 siblings, 0 replies; 37+ messages in thread
From: Herbert Xu @ 2006-12-15 2:42 UTC (permalink / raw)
To: Jeff Garzik; +Cc: auke-jan.h.kok, netdev, jesse.brandeburg, auke, john.ronciak
Jeff Garzik <jgarzik@pobox.com> wrote:
>>
>> +#ifdef CONFIG_DEBUG_SLAB
>> + /* 82544's work arounds do not play nicely with DEBUG SLAB */
>> + if (adapter->hw.mac_type == e1000_82544)
>> + netdev->features &= ~NETIF_F_TSO;
>> +#endif
>
> ACK, provided that you greatly enhance the comment to explain -why-, not
> just the desired results.
Actually, CONFIG_DEBUG_SLAB is not the only thing that can break the
82544 work-around, Xen for example will also generate packets that
breaks it. Jesse has a more recent fix that resolves both problems.
I've updated his patch to make it smaller.
Note that the only reason we don't see this normally is because the
TCP stack starts writing from the end, i.e., it writes the TCP header
first then slaps on the IP header, etc. So the end of the TCP header
(skb->tail - 1 here) is always aligned correctly.
Had we made the start of the IP header (e.g., IPv6) 8-byte aligned
instead, this would happen for normal TCP traffic as well.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 73f3a85..2c6ba42 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3168,6 +3168,16 @@ #ifdef NETIF_F_TSO
if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) {
switch (adapter->hw.mac_type) {
unsigned int pull_size;
+ case e1000_82544:
+ /* Make sure we have room to chop off 4 bytes,
+ * and that the end alignment will work out to
+ * this hardware's requirements
+ * NOTE: this is a TSO only workaround
+ * if end byte alignment not correct move us
+ * into the next dword */
+ if ((unsigned long)(skb->tail - 1) & 4)
+ break;
+ /* fall through */
case e1000_82571:
case e1000_82572:
case e1000_82573:
^ permalink raw reply related [flat|nested] 37+ messages in thread
end of thread, other threads:[~2006-12-15 2:42 UTC | newest]
Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-08 23:02 [PATCH 00/22] ixgb, e1000 fixes Kok, Auke
2006-12-08 23:02 ` [PATCH 01/22] e1000: Fix early TSO completion Kok, Auke
2006-12-11 14:36 ` Jeff Garzik
2006-12-08 23:02 ` [PATCH 02/22] ixgb: Maybe stop TX if not enough free descriptors Kok, Auke
2006-12-11 14:37 ` Jeff Garzik
2006-12-08 23:02 ` [PATCH 03/22] ixgb: Write RA register high word first, increment version Kok, Auke
2006-12-11 14:37 ` Jeff Garzik
2006-12-08 23:02 ` [PATCH 04/22] e1000: display FC link properties Kok, Auke
2006-12-08 23:02 ` [PATCH 05/22] e1000: dynamic itr code fixes Kok, Auke
2006-12-08 23:02 ` [PATCH 06/22] e1000: minor tso ipv6 cleanups Kok, Auke
2006-12-11 14:42 ` Jeff Garzik
2006-12-08 23:02 ` [PATCH 07/22] e1000: omit stats for broken counter in 82543 Kok, Auke
2006-12-11 14:42 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 08/22] e1000: Fix all manageability workarounds Kok, Auke
2006-12-11 14:41 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 09/22] e1000: Fix PBA allocation calculations Kok, Auke
2006-12-08 23:03 ` [PATCH 10/22] e1000: Make copybreak parameter changeable by user Kok, Auke
2006-12-08 23:03 ` [PATCH 11/22] e1000: Fire a link even interrupt instead of a watchdog at init Kok, Auke
2006-12-11 22:48 ` Shaw Vrana
2006-12-08 23:03 ` [PATCH 12/22] e1000: Fix powerdown link loss when forced to gig speed Kok, Auke
2006-12-11 14:46 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 13/22] e1000: disable TSO when debugging slab Kok, Auke
2006-12-11 14:47 ` Jeff Garzik
2006-12-15 2:42 ` Herbert Xu
2006-12-08 23:03 ` [PATCH 14/22] e1000: always turn on receives on esb2 Kok, Auke
2006-12-11 14:47 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 15/22] e1000: simplify msi specific interrupt handler Kok, Auke
2006-12-11 14:48 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 16/22] e1000: Rewrite parm handling code to warn when forcing autoneg to gig only Kok, Auke
2006-12-08 23:03 ` [PATCH 17/22] e1000: set max frame size before enabling new link settings Kok, Auke
2006-12-08 23:03 ` [PATCH 18/22] e1000: For older adapters, we know that the pci bus type is pci Kok, Auke
2006-12-08 23:03 ` [PATCH 19/22] e1000: Don't set tipg (fiber) timings for pci-e adapters to fix fiber output Kok, Auke
2006-12-08 23:03 ` [PATCH 20/22] e1000: Fix poor quad port performance with NAPI Kok, Auke
2006-12-11 14:49 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 21/22] e1000: Version increment 7.3.20-k2 and minor cleanups Kok, Auke
2006-12-11 14:50 ` Jeff Garzik
2006-12-08 23:03 ` [PATCH 22/22] # This series applies on GIT commit 0ae851352a87db3f829511816a2da227860bf585 Kok, Auke
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).