提交 8549889c 编写于 作者: S Sascha Hauer 提交者: David S. Miller

fec: align receive packets

Otherwise we get a lot of alignment errors
Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4f1ceb4b
...@@ -598,13 +598,14 @@ fec_enet_rx(struct net_device *dev) ...@@ -598,13 +598,14 @@ fec_enet_rx(struct net_device *dev)
* include that when passing upstream as it messes up * include that when passing upstream as it messes up
* bridging applications. * 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", printk("%s: Memory squeeze, dropping packet.\n",
dev->name); dev->name);
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
} else { } else {
skb_reserve(skb, NET_IP_ALIGN);
skb_put(skb, pkt_len - 4); /* Make room */ skb_put(skb, pkt_len - 4); /* Make room */
skb_copy_to_linear_data(skb, data, pkt_len - 4); skb_copy_to_linear_data(skb, data, pkt_len - 4);
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册