Commit 0a0e2344 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

bna: use netdev_alloc_skb_ip_align()

Some workloads need some headroom (NET_SKB_PAD) to avoid expensive
reallocations.

Using netdev_alloc_skb_ip_align() instead of bare skb_alloc() brings the
NET_IP_ALIGN and the NET_SKB_PAD headroom.
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
CC: Rasesh Mody <rmody@brocade.com>
CC: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 135d23d6
...@@ -386,14 +386,12 @@ bnad_alloc_n_post_rxbufs(struct bnad *bnad, struct bna_rcb *rcb) ...@@ -386,14 +386,12 @@ bnad_alloc_n_post_rxbufs(struct bnad *bnad, struct bna_rcb *rcb)
BNA_RXQ_QPGE_PTR_GET(unmap_prod, rcb->sw_qpt, rxent, BNA_RXQ_QPGE_PTR_GET(unmap_prod, rcb->sw_qpt, rxent,
wi_range); wi_range);
} }
skb = alloc_skb(rcb->rxq->buffer_size + NET_IP_ALIGN, skb = netdev_alloc_skb_ip_align(bnad->netdev,
GFP_ATOMIC); rcb->rxq->buffer_size);
if (unlikely(!skb)) { if (unlikely(!skb)) {
BNAD_UPDATE_CTR(bnad, rxbuf_alloc_failed); BNAD_UPDATE_CTR(bnad, rxbuf_alloc_failed);
goto finishing; goto finishing;
} }
skb->dev = bnad->netdev;
skb_reserve(skb, NET_IP_ALIGN);
unmap_array[unmap_prod].skb = skb; unmap_array[unmap_prod].skb = skb;
dma_addr = dma_map_single(&bnad->pcidev->dev, skb->data, dma_addr = dma_map_single(&bnad->pcidev->dev, skb->data,
rcb->rxq->buffer_size, rcb->rxq->buffer_size,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment