netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ixgb: driver update to 1.0.104-k4
@ 2006-05-25 20:25 Kok, Auke
  2006-05-25 20:26 ` [PATCH 1/3] ixgb: add performance enhancements to the buffer_info struct Kok, Auke
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kok, Auke @ 2006-05-25 20:25 UTC (permalink / raw)
  To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke


Hi,

This is another resend of patches sent earlier by Jeff Kirsher and
completes the resend for 1.0.104-kX.


Summary:

[1] add performance enhancements to the buffer_info struct
[2] implement copybreak
[3] increment version to 1.0.104-k4


These changes are available through git.

git pull git://lost.foo-projects.org/~ahkok/git/netdev-2.6 ixgb-1.0.104-k4

these patches are against
 netdev-2.6#upstream c49022b28187de43af673d9c3a31743dd9228c7a


Cheers,

Auke


---
 drivers/net/ixgb/ixgb.h      |    1 
 drivers/net/ixgb/ixgb_main.c |   96 ++++++++++++++++++++++++++++--------------
 2 files changed, 66 insertions(+), 31 deletions(-)


--
Auke Kok <auke-jan.h.kok@intel.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ixgb: add performance enhancements to the buffer_info struct
  2006-05-25 20:25 [PATCH 0/3] ixgb: driver update to 1.0.104-k4 Kok, Auke
@ 2006-05-25 20:26 ` Kok, Auke
  2006-05-25 20:26 ` [PATCH 2/3] ixgb: use rx copybreak/skb recycle Kok, Auke
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kok, Auke @ 2006-05-25 20:26 UTC (permalink / raw)
  To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke


o modify the rx refill logic and tail bump
o add counter for failures

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb.h      |    1 +
 drivers/net/ixgb/ixgb_main.c |   74 +++++++++++++++++++++++++-----------------
 2 files changed, 45 insertions(+), 30 deletions(-)

diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index b9c37fd..bdbaf5a 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -200,6 +200,7 @@ struct ixgb_adapter {
 	struct ixgb_hw hw;
 	u16 msg_enable;
 	struct ixgb_hw_stats stats;
+	uint32_t alloc_rx_buff_failed;
 #ifdef CONFIG_PCI_MSI
 	boolean_t have_msi;
 #endif
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 0905a82..27034b3 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -929,17 +929,20 @@ ixgb_unmap_and_free_tx_resource(struct i
 					struct ixgb_buffer *buffer_info)
 {
 	struct pci_dev *pdev = adapter->pdev;
-	if(buffer_info->dma) {
-		pci_unmap_page(pdev,
-			   buffer_info->dma,
-			   buffer_info->length,
-			   PCI_DMA_TODEVICE);
-		buffer_info->dma = 0;
-	}
-	if(buffer_info->skb) {
+
+	if (buffer_info->dma)
+		pci_unmap_page(pdev, buffer_info->dma, buffer_info->length,
+		               PCI_DMA_TODEVICE);
+
+	if (buffer_info->skb)
 		dev_kfree_skb_any(buffer_info->skb);
-		buffer_info->skb = NULL;
-	}
+
+	buffer_info->skb = NULL;
+	buffer_info->dma = 0;
+	buffer_info->time_stamp = 0;
+	/* these fields must always be initialized in tx
+	 * buffer_info->length = 0;
+	 * buffer_info->next_to_watch = 0; */
 }
 
 /**
@@ -1314,6 +1317,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter
 				size,
 				PCI_DMA_TODEVICE);
 		buffer_info->time_stamp = jiffies;
+		buffer_info->next_to_watch = 0;
 
 		len -= size;
 		offset += size;
@@ -1345,6 +1349,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter
 					size,
 					PCI_DMA_TODEVICE);
 			buffer_info->time_stamp = jiffies;
+			buffer_info->next_to_watch = 0;
 
 			len -= size;
 			offset += size;
@@ -1940,6 +1945,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *a
 #endif
 		status = rx_desc->status;
 		skb = buffer_info->skb;
+		buffer_info->skb = NULL;
 
 		prefetch(skb->data);
 
@@ -2013,7 +2019,6 @@ ixgb_clean_rx_irq(struct ixgb_adapter *a
 rxdesc_done:
 		/* clean up descriptor, might be written over by hw */
 		rx_desc->status = 0;
-		buffer_info->skb = NULL;
 
 		/* use prefetched values */
 		rx_desc = next_rxd;
@@ -2053,12 +2058,18 @@ ixgb_alloc_rx_buffers(struct ixgb_adapte
 
 	/* leave three descriptors unused */
 	while(--cleancount > 2) {
-		rx_desc = IXGB_RX_DESC(*rx_ring, i);
-
-		skb = dev_alloc_skb(adapter->rx_buffer_len + NET_IP_ALIGN);
+		/* recycle! its good for you */
+		if (!(skb = buffer_info->skb))
+			skb = dev_alloc_skb(adapter->rx_buffer_len
+			                    + NET_IP_ALIGN);
+		else {
+			skb_trim(skb, 0);
+			goto map_skb;
+		}
 
-		if(unlikely(!skb)) {
+		if (unlikely(!skb)) {
 			/* Better luck next round */
+			adapter->alloc_rx_buff_failed++;
 			break;
 		}
 
@@ -2072,33 +2083,36 @@ ixgb_alloc_rx_buffers(struct ixgb_adapte
 
 		buffer_info->skb = skb;
 		buffer_info->length = adapter->rx_buffer_len;
-		buffer_info->dma =
-			pci_map_single(pdev,
-				   skb->data,
-				   adapter->rx_buffer_len,
-				   PCI_DMA_FROMDEVICE);
+map_skb:
+		buffer_info->dma = pci_map_single(pdev,
+		                                  skb->data,
+		                                  adapter->rx_buffer_len,
+		                                  PCI_DMA_FROMDEVICE);
 
+		rx_desc = IXGB_RX_DESC(*rx_ring, i);
 		rx_desc->buff_addr = cpu_to_le64(buffer_info->dma);
 		/* guarantee DD bit not set now before h/w gets descriptor
 		 * this is the rest of the workaround for h/w double 
 		 * writeback. */
 		rx_desc->status = 0;
 
-		if((i & ~(num_group_tail_writes- 1)) == i) {
-			/* Force memory writes to complete before letting h/w
-			 * know there are new descriptors to fetch.  (Only
-			 * applicable for weak-ordered memory model archs,
-			 * such as IA-64). */
-			wmb();
-
-			IXGB_WRITE_REG(&adapter->hw, RDT, i);
-		}
 
 		if(++i == rx_ring->count) i = 0;
 		buffer_info = &rx_ring->buffer_info[i];
 	}
 
-	rx_ring->next_to_use = i;
+	if (likely(rx_ring->next_to_use != i)) {
+		rx_ring->next_to_use = i;
+		if (unlikely(i-- == 0))
+			i = (rx_ring->count - 1);
+
+		/* Force memory writes to complete before letting h/w
+		 * know there are new descriptors to fetch.  (Only
+		 * applicable for weak-ordered memory model archs, such
+		 * as IA-64). */
+		wmb();
+		IXGB_WRITE_REG(&adapter->hw, RDT, i);
+	}
 }
 
 /**



--
Auke Kok <auke-jan.h.kok@intel.com>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ixgb: use rx copybreak/skb recycle
  2006-05-25 20:25 [PATCH 0/3] ixgb: driver update to 1.0.104-k4 Kok, Auke
  2006-05-25 20:26 ` [PATCH 1/3] ixgb: add performance enhancements to the buffer_info struct Kok, Auke
@ 2006-05-25 20:26 ` Kok, Auke
  2006-05-25 20:26 ` [PATCH 3/3] ixgb: increment version to 1.0.104-k4 Kok, Auke
  2006-05-26  7:03 ` [PATCH 0/3] ixgb: driver update " Jeff Garzik
  3 siblings, 0 replies; 5+ messages in thread
From: Kok, Auke @ 2006-05-25 20:26 UTC (permalink / raw)
  To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke


o use rx copybreak/skb recycle

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_main.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 27034b3..0e23994 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1990,6 +1990,26 @@ ixgb_clean_rx_irq(struct ixgb_adapter *a
 			goto rxdesc_done;
 		}
 
+		/* code added for copybreak, this should improve
+		 * performance for small packets with large amounts
+		 * of reassembly being done in the stack */
+#define IXGB_CB_LENGTH 256
+		if (length < IXGB_CB_LENGTH) {
+			struct sk_buff *new_skb =
+			    dev_alloc_skb(length + NET_IP_ALIGN);
+			if (new_skb) {
+				skb_reserve(new_skb, NET_IP_ALIGN);
+				new_skb->dev = netdev;
+				memcpy(new_skb->data - NET_IP_ALIGN,
+				       skb->data - NET_IP_ALIGN,
+				       length + NET_IP_ALIGN);
+				/* save the skb in buffer_info as good */
+				buffer_info->skb = skb;
+				skb = new_skb;
+			}
+		}
+		/* end copybreak code */
+
 		/* Good Receive */
 		skb_put(skb, length);
 



--
Auke Kok <auke-jan.h.kok@intel.com>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ixgb: increment version to 1.0.104-k4
  2006-05-25 20:25 [PATCH 0/3] ixgb: driver update to 1.0.104-k4 Kok, Auke
  2006-05-25 20:26 ` [PATCH 1/3] ixgb: add performance enhancements to the buffer_info struct Kok, Auke
  2006-05-25 20:26 ` [PATCH 2/3] ixgb: use rx copybreak/skb recycle Kok, Auke
@ 2006-05-25 20:26 ` Kok, Auke
  2006-05-26  7:03 ` [PATCH 0/3] ixgb: driver update " Jeff Garzik
  3 siblings, 0 replies; 5+ messages in thread
From: Kok, Auke @ 2006-05-25 20:26 UTC (permalink / raw)
  To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke


Increment the driver version to 1.0.104-k4

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 0e23994..0a0c876 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -52,7 +52,7 @@ static char ixgb_driver_string[] = "Inte
 #else
 #define DRIVERNAPI "-NAPI"
 #endif
-#define DRV_VERSION		"1.0.104-k2"DRIVERNAPI
+#define DRV_VERSION		"1.0.104-k4"DRIVERNAPI
 char ixgb_driver_version[] = DRV_VERSION;
 static char ixgb_copyright[] = "Copyright (c) 1999-2005 Intel Corporation.";
 



--
Auke Kok <auke-jan.h.kok@intel.com>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] ixgb: driver update to 1.0.104-k4
  2006-05-25 20:25 [PATCH 0/3] ixgb: driver update to 1.0.104-k4 Kok, Auke
                   ` (2 preceding siblings ...)
  2006-05-25 20:26 ` [PATCH 3/3] ixgb: increment version to 1.0.104-k4 Kok, Auke
@ 2006-05-26  7:03 ` Jeff Garzik
  3 siblings, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2006-05-26  7:03 UTC (permalink / raw)
  To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke

Kok, Auke wrote:
> Hi,
> 
> This is another resend of patches sent earlier by Jeff Kirsher and
> completes the resend for 1.0.104-kX.
> 
> 
> Summary:
> 
> [1] add performance enhancements to the buffer_info struct
> [2] implement copybreak
> [3] increment version to 1.0.104-k4
> 
> 
> These changes are available through git.
> 
> git pull git://lost.foo-projects.org/~ahkok/git/netdev-2.6 ixgb-1.0.104-k4

pulled



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-05-26  7:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-25 20:25 [PATCH 0/3] ixgb: driver update to 1.0.104-k4 Kok, Auke
2006-05-25 20:26 ` [PATCH 1/3] ixgb: add performance enhancements to the buffer_info struct Kok, Auke
2006-05-25 20:26 ` [PATCH 2/3] ixgb: use rx copybreak/skb recycle Kok, Auke
2006-05-25 20:26 ` [PATCH 3/3] ixgb: increment version to 1.0.104-k4 Kok, Auke
2006-05-26  7:03 ` [PATCH 0/3] ixgb: driver update " Jeff Garzik

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).