[PATCH 17/32] net: packet split receive api

Previous thread: [PATCH 27/32] mm: methods for teaching filesystems about PG_swapcache pages by Peter Zijlstra on Thursday, October 2, 2008 - 6:05 am. (1 message)

Next thread: [PATCH 30/32] nfs: disable data cache revalidation for swapfiles by Peter Zijlstra on Thursday, October 2, 2008 - 6:05 am. (1 message)
From: Peter Zijlstra
Date: Thursday, October 2, 2008 - 6:05 am

Add some packet-split receive hooks.

For one this allows to do NUMA node affine page allocs. Later on these hooks
will be extended to do emergency reserve allocations for fragments.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 drivers/net/bnx2.c             |    8 +++-----
 drivers/net/e1000/e1000_main.c |    8 ++------
 drivers/net/e1000e/netdev.c    |    7 ++-----
 drivers/net/igb/igb_main.c     |    9 ++-------
 drivers/net/ixgbe/ixgbe_main.c |   10 +++-------
 drivers/net/sky2.c             |   16 ++++++----------
 include/linux/skbuff.h         |   23 +++++++++++++++++++++++
 net/core/skbuff.c              |   20 ++++++++++++++++++++
 8 files changed, 61 insertions(+), 40 deletions(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===================================================================
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -4347,12 +4347,8 @@ static bool e1000_clean_rx_irq_ps(struct
 			pci_unmap_page(pdev, ps_page_dma->ps_page_dma[j],
 					PAGE_SIZE, PCI_DMA_FROMDEVICE);
 			ps_page_dma->ps_page_dma[j] = 0;
-			skb_fill_page_desc(skb, j, ps_page->ps_page[j], 0,
-			                   length);
+			skb_add_rx_frag(skb, j, ps_page->ps_page[j], 0, length);
 			ps_page->ps_page[j] = NULL;
-			skb->len += length;
-			skb->data_len += length;
-			skb->truesize += length;
 		}
 
 		/* strip the ethernet crc, problem is we're using pages now so
@@ -4551,7 +4547,7 @@ static void e1000_alloc_rx_buffers_ps(st
 			if (j < adapter->rx_ps_pages) {
 				if (likely(!ps_page->ps_page[j])) {
 					ps_page->ps_page[j] =
-						alloc_page(GFP_ATOMIC);
+						netdev_alloc_page(netdev);
 					if (unlikely(!ps_page->ps_page[j])) {
 						adapter->alloc_rx_buff_failed++;
 						goto no_buffers;
Index: linux-2.6/include/linux/skbuff.h
===================================================================
--- linux-2.6.orig/include/linux/skbuff.h
+++ linux-2.6/include/linux/skbuff.h
@@ -829,6 ...
From: David Miller
Date: Tuesday, October 7, 2008 - 2:23 pm

From: Peter Zijlstra <a.p.zijlstra@chello.nl>

The individual driver changes get a bunch of rejects in the net-next-2.6
tree, and you also missed some drivers such as NIU that also should use
these new interfaces.

So what I did for now was add just the non-driver parts that add the
interfaces themselves.

Thanks!

--

Previous thread: [PATCH 27/32] mm: methods for teaching filesystems about PG_swapcache pages by Peter Zijlstra on Thursday, October 2, 2008 - 6:05 am. (1 message)

Next thread: [PATCH 30/32] nfs: disable data cache revalidation for swapfiles by Peter Zijlstra on Thursday, October 2, 2008 - 6:05 am. (1 message)