aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fec.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-04-14 21:32:21 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-16 05:34:51 -0400
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)
598 * include that when passing upstream as it messes up 598 * include that when passing upstream as it messes up
599 * bridging applications. 599 * bridging applications.
600 */ 600 */
601 skb = dev_alloc_skb(pkt_len - 4); 601 skb = dev_alloc_skb(pkt_len - 4 + NET_IP_ALIGN);
602 602
603 if (skb == NULL) { 603 if (unlikely(!skb)) {
604 printk("%s: Memory squeeze, dropping packet.\n", 604 printk("%s: Memory squeeze, dropping packet.\n",
605 dev->name); 605 dev->name);
606 dev->stats.rx_dropped++; 606 dev->stats.rx_dropped++;
607 } else { 607 } else {
608 skb_reserve(skb, NET_IP_ALIGN);
608 skb_put(skb, pkt_len - 4); /* Make room */ 609 skb_put(skb, pkt_len - 4); /* Make room */
609 skb_copy_to_linear_data(skb, data, pkt_len - 4); 610 skb_copy_to_linear_data(skb, data, pkt_len - 4);
610 skb->protocol = eth_type_trans(skb, dev); 611 skb->protocol = eth_type_trans(skb, dev);