aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hamachi.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-10-13 01:34:20 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-13 14:48:18 -0400
commit89d71a66c40d629e3b1285def543ab1425558cd5 (patch)
tree45159e85418170fe36e4e023d9617693625d1740 /drivers/net/hamachi.c
parentbff1c09640b3006bca711e18ef08a5fb955ad9b5 (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/hamachi.c')
-rw-r--r--drivers/net/hamachi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index 1d5064a09ac..18bd9fe20d7 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -406,10 +406,9 @@ that case.
406/* A few values that may be tweaked. */ 406/* A few values that may be tweaked. */
407/* Size of each temporary Rx buffer, calculated as: 407/* Size of each temporary Rx buffer, calculated as:
408 * 1518 bytes (ethernet packet) + 2 bytes (to get 8 byte alignment for 408 * 1518 bytes (ethernet packet) + 2 bytes (to get 8 byte alignment for
409 * the card) + 8 bytes of status info + 8 bytes for the Rx Checksum + 409 * the card) + 8 bytes of status info + 8 bytes for the Rx Checksum
410 * 2 more because we use skb_reserve.
411 */ 410 */
412#define PKT_BUF_SZ 1538 411#define PKT_BUF_SZ 1536
413 412
414/* For now, this is going to be set to the maximum size of an ethernet 413/* For now, this is going to be set to the maximum size of an ethernet
415 * packet. Eventually, we may want to make it a variable that is 414 * packet. Eventually, we may want to make it a variable that is
@@ -1151,12 +1150,13 @@ static void hamachi_tx_timeout(struct net_device *dev)
1151 } 1150 }
1152 /* Fill in the Rx buffers. Handle allocation failure gracefully. */ 1151 /* Fill in the Rx buffers. Handle allocation failure gracefully. */
1153 for (i = 0; i < RX_RING_SIZE; i++) { 1152 for (i = 0; i < RX_RING_SIZE; i++) {
1154 struct sk_buff *skb = netdev_alloc_skb(dev, hmp->rx_buf_sz); 1153 struct sk_buff *skb;
1154
1155 skb = netdev_alloc_skb_ip_align(dev, hmp->rx_buf_sz);
1155 hmp->rx_skbuff[i] = skb; 1156 hmp->rx_skbuff[i] = skb;
1156 if (skb == NULL) 1157 if (skb == NULL)
1157 break; 1158 break;
1158 1159
1159 skb_reserve(skb, 2); /* 16 byte align the IP header. */
1160 hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev, 1160 hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
1161 skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE)); 1161 skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE));
1162 hmp->rx_ring[i].status_n_length = cpu_to_le32(DescOwn | 1162 hmp->rx_ring[i].status_n_length = cpu_to_le32(DescOwn |
@@ -1195,7 +1195,7 @@ static void hamachi_init_ring(struct net_device *dev)
1195 * card. -KDU 1195 * card. -KDU
1196 */ 1196 */
1197 hmp->rx_buf_sz = (dev->mtu <= 1492 ? PKT_BUF_SZ : 1197 hmp->rx_buf_sz = (dev->mtu <= 1492 ? PKT_BUF_SZ :
1198 (((dev->mtu+26+7) & ~7) + 2 + 16)); 1198 (((dev->mtu+26+7) & ~7) + 16));
1199 1199
1200 /* Initialize all Rx descriptors. */ 1200 /* Initialize all Rx descriptors. */
1201 for (i = 0; i < RX_RING_SIZE; i++) { 1201 for (i = 0; i < RX_RING_SIZE; i++) {