diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2013-01-15 02:28:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-16 14:40:48 -0500 |
commit | 0d735f13d8842d94ea8236baf12db3bea7daaf98 (patch) | |
tree | 3713a581f160487805ee72b8e84772e17cb23793 /drivers/net/vmxnet3 | |
parent | 8c174e6f77b37fcbd84d7c3b6d65414fbb444219 (diff) |
vmxnet3: use netdev_alloc_skb_ip_align
Use netdev_alloc_skb_align, rather than open code using dev_alloc_skb.
Change allocation at startup to use GFP_KERNEL.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vmxnet3')
-rw-r--r-- | drivers/net/vmxnet3/vmxnet3_drv.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index dc8913c6238c..3402a0cf1945 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -580,15 +580,14 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx, | |||
580 | 580 | ||
581 | if (rbi->buf_type == VMXNET3_RX_BUF_SKB) { | 581 | if (rbi->buf_type == VMXNET3_RX_BUF_SKB) { |
582 | if (rbi->skb == NULL) { | 582 | if (rbi->skb == NULL) { |
583 | rbi->skb = dev_alloc_skb(rbi->len + | 583 | rbi->skb = __netdev_alloc_skb_ip_align(adapter->netdev, |
584 | NET_IP_ALIGN); | 584 | rbi->len, |
585 | GFP_KERNEL); | ||
585 | if (unlikely(rbi->skb == NULL)) { | 586 | if (unlikely(rbi->skb == NULL)) { |
586 | rq->stats.rx_buf_alloc_failure++; | 587 | rq->stats.rx_buf_alloc_failure++; |
587 | break; | 588 | break; |
588 | } | 589 | } |
589 | rbi->skb->dev = adapter->netdev; | ||
590 | 590 | ||
591 | skb_reserve(rbi->skb, NET_IP_ALIGN); | ||
592 | rbi->dma_addr = pci_map_single(adapter->pdev, | 591 | rbi->dma_addr = pci_map_single(adapter->pdev, |
593 | rbi->skb->data, rbi->len, | 592 | rbi->skb->data, rbi->len, |
594 | PCI_DMA_FROMDEVICE); | 593 | PCI_DMA_FROMDEVICE); |
@@ -1221,7 +1220,8 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1221 | 1220 | ||
1222 | skip_page_frags = false; | 1221 | skip_page_frags = false; |
1223 | ctx->skb = rbi->skb; | 1222 | ctx->skb = rbi->skb; |
1224 | new_skb = dev_alloc_skb(rbi->len + NET_IP_ALIGN); | 1223 | new_skb = netdev_alloc_skb_ip_align(adapter->netdev, |
1224 | rbi->len); | ||
1225 | if (new_skb == NULL) { | 1225 | if (new_skb == NULL) { |
1226 | /* Skb allocation failed, do not handover this | 1226 | /* Skb allocation failed, do not handover this |
1227 | * skb to stack. Reuse it. Drop the existing pkt | 1227 | * skb to stack. Reuse it. Drop the existing pkt |
@@ -1239,8 +1239,6 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, | |||
1239 | skb_put(ctx->skb, rcd->len); | 1239 | skb_put(ctx->skb, rcd->len); |
1240 | 1240 | ||
1241 | /* Immediate refill */ | 1241 | /* Immediate refill */ |
1242 | new_skb->dev = adapter->netdev; | ||
1243 | skb_reserve(new_skb, NET_IP_ALIGN); | ||
1244 | rbi->skb = new_skb; | 1242 | rbi->skb = new_skb; |
1245 | rbi->dma_addr = pci_map_single(adapter->pdev, | 1243 | rbi->dma_addr = pci_map_single(adapter->pdev, |
1246 | rbi->skb->data, rbi->len, | 1244 | rbi->skb->data, rbi->len, |