Patchwork b44: use netdev_alloc_skb_ip_align()

login
register
mail settings
Submitter Hauke Mehrtens
Date Feb. 18, 2013, 8:49 p.m.
Message ID <1361220596-26478-1-git-send-email-hauke@hauke-m.de>
Download mbox | patch
Permalink /patch/221493/
State Accepted
Delegated to: David Miller
Headers show

Comments

Hauke Mehrtens - Feb. 18, 2013, 8:49 p.m.
Without this patch b44 always allocates the 2 bytes needed for aligned
access on every platform, now it uses netdev_alloc_skb_ip_align().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/net/ethernet/broadcom/b44.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
David Miller - Feb. 19, 2013, 5:54 a.m.
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Mon, 18 Feb 2013 21:49:56 +0100

> Without this patch b44 always allocates the 2 bytes needed for aligned
> access on every platform, now it uses netdev_alloc_skb_ip_align().
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index c030274..a7efec2 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -809,11 +809,10 @@  static int b44_rx(struct b44 *bp, int budget)
 			struct sk_buff *copy_skb;
 
 			b44_recycle_rx(bp, cons, bp->rx_prod);
-			copy_skb = netdev_alloc_skb(bp->dev, len + 2);
+			copy_skb = netdev_alloc_skb_ip_align(bp->dev, len);
 			if (copy_skb == NULL)
 				goto drop_it_no_recycle;
 
-			skb_reserve(copy_skb, 2);
 			skb_put(copy_skb, len);
 			/* DMA sync done above, copy just the actual packet */
 			skb_copy_from_linear_data_offset(skb, RX_PKT_OFFSET,