summaryrefslogtreecommitdiff
path: root/drivers/net/fec.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-04-15 01:32:21 +0000
committerDavid S. Miller <davem@davemloft.net>2009-04-16 02:34:51 -0700
commit8549889c3369f7653bd98861c3d2cf97d810dc37 (patch)
tree8cac34b6665c9c709a2b854464e25e625c2167af /drivers/net/fec.c
parent4f1ceb4b46d523382f5a46622af9d3315a9b3e7f (diff)
fec: align receive packets
Otherwise we get a lot of alignment errors Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fec.c')
-rw-r--r--drivers/net/fec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 5ca2d6bcc23a..ba3eb54b63f5 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -598,13 +598,14 @@ fec_enet_rx(struct net_device *dev)
* include that when passing upstream as it messes up
* bridging applications.
*/
- skb = dev_alloc_skb(pkt_len - 4);
+ skb = dev_alloc_skb(pkt_len - 4 + NET_IP_ALIGN);
- if (skb == NULL) {
+ if (unlikely(!skb)) {
printk("%s: Memory squeeze, dropping packet.\n",
dev->name);
dev->stats.rx_dropped++;
} else {
+ skb_reserve(skb, NET_IP_ALIGN);
skb_put(skb, pkt_len - 4); /* Make room */
skb_copy_to_linear_data(skb, data, pkt_len - 4);
skb->protocol = eth_type_trans(skb, dev);