netdev
[Top] [All Lists]

[PATCH 3/12 2.5] e1000 - Use vmalloc for data structures not shared with

To: jgarzik@xxxxxxxxx
Subject: [PATCH 3/12 2.5] e1000 - Use vmalloc for data structures not shared with hardware
From: ganesh.venkatesan@xxxxxxxxx
Date: Thu, 29 Jul 2004 08:31:54 -0700 (PDT)
Cc: netdev@xxxxxxxxxxx, <ganesh.venkatesan@xxxxxxxxx>
Reply-to: ganesh.venkatesan@xxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
diff -up linux-2.5/drivers/net/e1000/e1000.h 
linux-2.5/drivers/net/e1000.new/e1000.h
--- linux-2.5/drivers/net/e1000/e1000.h 2004-07-28 21:50:08.578475464 -0700
+++ linux-2.5/drivers/net/e1000.new/e1000.h     2004-07-28 21:50:09.401350368 
-0700
@@ -49,6 +49,7 @@
 #include <linux/delay.h>
 #include <linux/timer.h>
 #include <linux/slab.h>
+#include <linux/vmalloc.h>
 #include <linux/interrupt.h>
 #include <linux/string.h>
 #include <linux/pagemap.h>
diff -up linux-2.5/drivers/net/e1000/e1000_main.c 
linux-2.5/drivers/net/e1000.new/e1000_main.c
--- linux-2.5/drivers/net/e1000/e1000_main.c    2004-07-28 21:50:08.672461176 
-0700
+++ linux-2.5/drivers/net/e1000.new/e1000_main.c        2004-07-28 
21:50:09.523331824 -0700
@@ -786,7 +786,7 @@ e1000_setup_tx_resources(struct e1000_ad
        int size;
 
        size = sizeof(struct e1000_buffer) * txdr->count;
-       txdr->buffer_info = kmalloc(size, GFP_KERNEL);
+       txdr->buffer_info = vmalloc(size);
        if(!txdr->buffer_info) {
                return -ENOMEM;
        }
@@ -799,7 +820,7 @@ e1000_setup_tx_resources(struct e1000_ad
 
        txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
        if(!txdr->desc) {
-               kfree(txdr->buffer_info);
+               vfree(txdr->buffer_info);
                return -ENOMEM;
        }
        memset(txdr->desc, 0, txdr->size);
@@ -903,7 +926,7 @@ e1000_setup_rx_resources(struct e1000_ad
        int size;
 
        size = sizeof(struct e1000_buffer) * rxdr->count;
-       rxdr->buffer_info = kmalloc(size, GFP_KERNEL);
+       rxdr->buffer_info = vmalloc(size);
        if(!rxdr->buffer_info) {
                return -ENOMEM;
        }
@@ -917,7 +942,7 @@ e1000_setup_rx_resources(struct e1000_ad
        rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
 
        if(!rxdr->desc) {
-               kfree(rxdr->buffer_info);
+               vfree(rxdr->buffer_info);
                return -ENOMEM;
        }
        memset(rxdr->desc, 0, rxdr->size);
@@ -1041,7 +1041,7 @@ e1000_free_tx_resources(struct e1000_ada
 
        e1000_clean_tx_ring(adapter);
 
-       kfree(adapter->tx_ring.buffer_info);
+       vfree(adapter->tx_ring.buffer_info);
        adapter->tx_ring.buffer_info = NULL;
 
        pci_free_consistent(pdev, adapter->tx_ring.size,
@@ -1110,7 +1110,7 @@ e1000_free_rx_resources(struct e1000_ada
 
        e1000_clean_rx_ring(adapter);
 
-       kfree(rx_ring->buffer_info);
+       vfree(rx_ring->buffer_info);
        rx_ring->buffer_info = NULL;
 
        pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma);



<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 3/12 2.5] e1000 - Use vmalloc for data structures not shared with hardware, ganesh . venkatesan <=