Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256262
b: refs/heads/master
c: c2fed99
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Kirsher authored and David S. Miller committed Jul 13, 2011
1 parent 761b7b7 commit d1a8a09
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a3d72d5d01b82a86f3b16ca1918d2040b1acba8c
refs/heads/master: c2fed9965c60e1f989f57889357c557f7b907ab7
2 changes: 1 addition & 1 deletion trunk/drivers/net/e1000e/e1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ struct e1000_adapter {
int *work_done, int work_to_do)
____cacheline_aligned_in_smp;
void (*alloc_rx_buf) (struct e1000_adapter *adapter,
int cleaned_count);
int cleaned_count, gfp_t gfp);
struct e1000_ring *rx_ring;

u32 rx_int_delay;
Expand Down
37 changes: 21 additions & 16 deletions trunk/drivers/net/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
* @adapter: address of board private structure
**/
static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
int cleaned_count)
int cleaned_count, gfp_t gfp)
{
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
Expand All @@ -544,7 +544,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
goto map_skb;
}

skb = netdev_alloc_skb_ip_align(netdev, bufsz);
skb = __netdev_alloc_skb_ip_align(netdev, bufsz, gfp);
if (!skb) {
/* Better luck next round */
adapter->alloc_rx_buff_failed++;
Expand Down Expand Up @@ -589,7 +589,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
* @adapter: address of board private structure
**/
static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
int cleaned_count)
int cleaned_count, gfp_t gfp)
{
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
Expand All @@ -615,7 +615,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
continue;
}
if (!ps_page->page) {
ps_page->page = alloc_page(GFP_ATOMIC);
ps_page->page = alloc_page(gfp);
if (!ps_page->page) {
adapter->alloc_rx_buff_failed++;
goto no_buffers;
Expand All @@ -641,8 +641,9 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
cpu_to_le64(ps_page->dma);
}

skb = netdev_alloc_skb_ip_align(netdev,
adapter->rx_ps_bsize0);
skb = __netdev_alloc_skb_ip_align(netdev,
adapter->rx_ps_bsize0,
gfp);

if (!skb) {
adapter->alloc_rx_buff_failed++;
Expand Down Expand Up @@ -692,7 +693,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
**/

static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
int cleaned_count)
int cleaned_count, gfp_t gfp)
{
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
Expand All @@ -713,7 +714,7 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
goto check_page;
}

skb = netdev_alloc_skb_ip_align(netdev, bufsz);
skb = __netdev_alloc_skb_ip_align(netdev, bufsz, gfp);
if (unlikely(!skb)) {
/* Better luck next round */
adapter->alloc_rx_buff_failed++;
Expand All @@ -724,7 +725,7 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
check_page:
/* allocate a new page if necessary */
if (!buffer_info->page) {
buffer_info->page = alloc_page(GFP_ATOMIC);
buffer_info->page = alloc_page(gfp);
if (unlikely(!buffer_info->page)) {
adapter->alloc_rx_buff_failed++;
break;
Expand Down Expand Up @@ -888,7 +889,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,

/* return some buffers to hardware, one at a time is too slow */
if (cleaned_count >= E1000_RX_BUFFER_WRITE) {
adapter->alloc_rx_buf(adapter, cleaned_count);
adapter->alloc_rx_buf(adapter, cleaned_count,
GFP_ATOMIC);
cleaned_count = 0;
}

Expand All @@ -900,7 +902,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,

cleaned_count = e1000_desc_unused(rx_ring);
if (cleaned_count)
adapter->alloc_rx_buf(adapter, cleaned_count);
adapter->alloc_rx_buf(adapter, cleaned_count, GFP_ATOMIC);

adapter->total_rx_bytes += total_rx_bytes;
adapter->total_rx_packets += total_rx_packets;
Expand Down Expand Up @@ -1230,7 +1232,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,

/* return some buffers to hardware, one at a time is too slow */
if (cleaned_count >= E1000_RX_BUFFER_WRITE) {
adapter->alloc_rx_buf(adapter, cleaned_count);
adapter->alloc_rx_buf(adapter, cleaned_count,
GFP_ATOMIC);
cleaned_count = 0;
}

Expand All @@ -1244,7 +1247,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,

cleaned_count = e1000_desc_unused(rx_ring);
if (cleaned_count)
adapter->alloc_rx_buf(adapter, cleaned_count);
adapter->alloc_rx_buf(adapter, cleaned_count, GFP_ATOMIC);

adapter->total_rx_bytes += total_rx_bytes;
adapter->total_rx_packets += total_rx_packets;
Expand Down Expand Up @@ -1411,7 +1414,8 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,

/* return some buffers to hardware, one at a time is too slow */
if (unlikely(cleaned_count >= E1000_RX_BUFFER_WRITE)) {
adapter->alloc_rx_buf(adapter, cleaned_count);
adapter->alloc_rx_buf(adapter, cleaned_count,
GFP_ATOMIC);
cleaned_count = 0;
}

Expand All @@ -1423,7 +1427,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,

cleaned_count = e1000_desc_unused(rx_ring);
if (cleaned_count)
adapter->alloc_rx_buf(adapter, cleaned_count);
adapter->alloc_rx_buf(adapter, cleaned_count, GFP_ATOMIC);

adapter->total_rx_bytes += total_rx_bytes;
adapter->total_rx_packets += total_rx_packets;
Expand Down Expand Up @@ -3105,7 +3109,8 @@ static void e1000_configure(struct e1000_adapter *adapter)
e1000_configure_tx(adapter);
e1000_setup_rctl(adapter);
e1000_configure_rx(adapter);
adapter->alloc_rx_buf(adapter, e1000_desc_unused(adapter->rx_ring));
adapter->alloc_rx_buf(adapter, e1000_desc_unused(adapter->rx_ring),
GFP_KERNEL);
}

/**
Expand Down

0 comments on commit d1a8a09

Please sign in to comment.