Skip to contentSkip to conversation

8139too: use netdev_alloc_skb

PATCH In review Kevin Lo 2 participants 2 messages Aug 27, 2008 – Sep 3, 2008

Subsystems (2)
lore
Share & tools
lore

Kevin Lo

author
#0 lore raw

PATCH 1/1 8139too: use netdev_alloc_skb

Hi,

This patch uses netdev_alloc_skb. This sets skb->dev and allows arch specific allocation. Also cleanup the alignment code.

Tested on x86_64.

drivers/net/8139too.c renamed from drivers/net/8139too.c.orig +2 -2
@@ -2009,9 +2009,9 @@ no_early_rx:
 		/* Malloc up new buffer, compatible with net-2e. */
 		/* Omit the four octet CRC from the length. */
 
-		skb = dev_alloc_skb (pkt_size + 2);
+		skb = netdev_alloc_skb(dev, pkt_size + NET_IP_ALIGN);
 		if (likely(skb)) {
-			skb_reserve (skb, 2);	/* 16 byte align the IP fields. */
+			skb_reserve (skb, NET_IP_ALIGN);	/* 16 byte align the IP fields. */
 #if RX_BUF_IDX == 3
 			wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
 #else
#1 lore raw
Quoted 7 lines · Kevin Lo

Hi,

This patch uses netdev_alloc_skb. This sets skb->dev and allows arch specific allocation. Also cleanup the alignment code.

Tested on x86_64.

applied this, and the other two