diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-13 01:34:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-13 14:48:18 -0400 |
commit | 89d71a66c40d629e3b1285def543ab1425558cd5 (patch) | |
tree | 45159e85418170fe36e4e023d9617693625d1740 /drivers/net/atlx | |
parent | bff1c09640b3006bca711e18ef08a5fb955ad9b5 (diff) |
net: Use netdev_alloc_skb_ip_align()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/atlx')
-rw-r--r-- | drivers/net/atlx/atl1.c | 11 | ||||
-rw-r--r-- | drivers/net/atlx/atl2.c | 3 |
2 files changed, 3 insertions, 11 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 00569dc1313..963df502260 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -1864,21 +1864,14 @@ static u16 atl1_alloc_rx_buffers(struct atl1_adapter *adapter) | |||
1864 | 1864 | ||
1865 | rfd_desc = ATL1_RFD_DESC(rfd_ring, rfd_next_to_use); | 1865 | rfd_desc = ATL1_RFD_DESC(rfd_ring, rfd_next_to_use); |
1866 | 1866 | ||
1867 | skb = netdev_alloc_skb(adapter->netdev, | 1867 | skb = netdev_alloc_skb_ip_align(adapter->netdev, |
1868 | adapter->rx_buffer_len + NET_IP_ALIGN); | 1868 | adapter->rx_buffer_len); |
1869 | if (unlikely(!skb)) { | 1869 | if (unlikely(!skb)) { |
1870 | /* Better luck next round */ | 1870 | /* Better luck next round */ |
1871 | adapter->netdev->stats.rx_dropped++; | 1871 | adapter->netdev->stats.rx_dropped++; |
1872 | break; | 1872 | break; |
1873 | } | 1873 | } |
1874 | 1874 | ||
1875 | /* | ||
1876 | * Make buffer alignment 2 beyond a 16 byte boundary | ||
1877 | * this will result in a 16 byte aligned IP header after | ||
1878 | * the 14 byte MAC header is removed | ||
1879 | */ | ||
1880 | skb_reserve(skb, NET_IP_ALIGN); | ||
1881 | |||
1882 | buffer_info->alloced = 1; | 1875 | buffer_info->alloced = 1; |
1883 | buffer_info->skb = skb; | 1876 | buffer_info->skb = skb; |
1884 | buffer_info->length = (u16) adapter->rx_buffer_len; | 1877 | buffer_info->length = (u16) adapter->rx_buffer_len; |
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c index ab688862093..0d268075bad 100644 --- a/drivers/net/atlx/atl2.c +++ b/drivers/net/atlx/atl2.c | |||
@@ -409,7 +409,7 @@ static void atl2_intr_rx(struct atl2_adapter *adapter) | |||
409 | if (rxd->status.ok && rxd->status.pkt_size >= 60) { | 409 | if (rxd->status.ok && rxd->status.pkt_size >= 60) { |
410 | int rx_size = (int)(rxd->status.pkt_size - 4); | 410 | int rx_size = (int)(rxd->status.pkt_size - 4); |
411 | /* alloc new buffer */ | 411 | /* alloc new buffer */ |
412 | skb = netdev_alloc_skb(netdev, rx_size + NET_IP_ALIGN); | 412 | skb = netdev_alloc_skb_ip_align(netdev, rx_size); |
413 | if (NULL == skb) { | 413 | if (NULL == skb) { |
414 | printk(KERN_WARNING | 414 | printk(KERN_WARNING |
415 | "%s: Mem squeeze, deferring packet.\n", | 415 | "%s: Mem squeeze, deferring packet.\n", |
@@ -421,7 +421,6 @@ static void atl2_intr_rx(struct atl2_adapter *adapter) | |||
421 | netdev->stats.rx_dropped++; | 421 | netdev->stats.rx_dropped++; |
422 | break; | 422 | break; |
423 | } | 423 | } |
424 | skb_reserve(skb, NET_IP_ALIGN); | ||
425 | skb->dev = netdev; | 424 | skb->dev = netdev; |
426 | memcpy(skb->data, rxd->packet, rx_size); | 425 | memcpy(skb->data, rxd->packet, rx_size); |
427 | skb_put(skb, rx_size); | 426 | skb_put(skb, rx_size); |