diff mbox

[v2] chelsio: use netdev_alloc_skb_ip_align

Message ID 20130320120241.19314ab6@nehalam.linuxnetplumber.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Stephen Hemminger March 20, 2013, 7:02 p.m. UTC
Use netdev_alloc_sk_ip_align in the case where packet is copied.
This handles case where NET_IP_ALIGN == 0 as well as adding required header
padding.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>



--
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

Comments

David Miller March 20, 2013, 7:25 p.m. UTC | #1
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 20 Mar 2013 12:02:41 -0700

> Use netdev_alloc_sk_ip_align in the case where packet is copied.
> This handles case where NET_IP_ALIGN == 0 as well as adding required header
> padding.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Applied, thanks Stephen.
--
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
diff mbox

Patch

--- a/drivers/net/ethernet/chelsio/cxgb/sge.c	2013-03-20 11:13:47.950986878 -0700
+++ b/drivers/net/ethernet/chelsio/cxgb/sge.c	2013-03-20 12:00:01.551115729 -0700
@@ -1046,11 +1046,10 @@  static inline struct sk_buff *get_packet
 	const struct freelQ_ce *ce = &fl->centries[fl->cidx];
 
 	if (len < copybreak) {
-		skb = alloc_skb(len + 2, GFP_ATOMIC);
+		skb = netdev_alloc_skb_ip_align(NULL, len);
 		if (!skb)
 			goto use_orig_buf;
 
-		skb_reserve(skb, 2);	/* align IP header */
 		skb_put(skb, len);
 		pci_dma_sync_single_for_cpu(pdev,
 					    dma_unmap_addr(ce, dma_addr),