* [PATCH] bna: use netdev_alloc_skb_ip_align()
@ 2011-07-08 15:29 Eric Dumazet
2011-07-08 16:09 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2011-07-08 15:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Rasesh Mody, Debashis Dutt
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: Eric Dumazet <eric.dumazet@gmail.com>
CC: Rasesh Mody <rmody@brocade.com>
CC: Debashis Dutt <ddutt@brocade.com>
---
drivers/net/bna/bnad.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index 44e219c..795b93b 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -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,
wi_range);
}
- skb = alloc_skb(rcb->rxq->buffer_size + NET_IP_ALIGN,
- GFP_ATOMIC);
+ skb = netdev_alloc_skb_ip_align(bnad->netdev,
+ rcb->rxq->buffer_size);
if (unlikely(!skb)) {
BNAD_UPDATE_CTR(bnad, rxbuf_alloc_failed);
goto finishing;
}
- skb->dev = bnad->netdev;
- skb_reserve(skb, NET_IP_ALIGN);
unmap_array[unmap_prod].skb = skb;
dma_addr = dma_map_single(&bnad->pcidev->dev, skb->data,
rcb->rxq->buffer_size,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bna: use netdev_alloc_skb_ip_align()
2011-07-08 15:29 [PATCH] bna: use netdev_alloc_skb_ip_align() Eric Dumazet
@ 2011-07-08 16:09 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-07-08 16:09 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, rmody, ddutt
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 08 Jul 2011 17:29:30 +0200
> 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: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-08 16:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-08 15:29 [PATCH] bna: use netdev_alloc_skb_ip_align() Eric Dumazet
2011-07-08 16:09 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).