提交 235bde1e 编写于 作者: F Fabio Estevam 提交者: David S. Miller

net: fec: Call swap_buffer() prior to IP header alignment

Commit 3ac72b7b ("net: fec: align IP header in hardware") breaks
networking on mx28.

There is an erratum on mx28 (ENGR121613 - ENET big endian mode
not compatible with ARM little endian) that requires an additional
byte-swap operation to workaround this problem.

So call swap_buffer() prior to performing the IP header alignment
to restore network functionality on mx28.

Fixes: 3ac72b7b ("net: fec: align IP header in hardware")
Reported-and-tested-by: NHenri Roosen <henri.roosen@ginzinger.com>
Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b678aa57
...@@ -1430,14 +1430,14 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) ...@@ -1430,14 +1430,14 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
skb_put(skb, pkt_len - 4); skb_put(skb, pkt_len - 4);
data = skb->data; data = skb->data;
if (!is_copybreak && need_swap)
swap_buffer(data, pkt_len);
#if !defined(CONFIG_M5272) #if !defined(CONFIG_M5272)
if (fep->quirks & FEC_QUIRK_HAS_RACC) if (fep->quirks & FEC_QUIRK_HAS_RACC)
data = skb_pull_inline(skb, 2); data = skb_pull_inline(skb, 2);
#endif #endif
if (!is_copybreak && need_swap)
swap_buffer(data, pkt_len);
/* Extract the enhanced buffer descriptor */ /* Extract the enhanced buffer descriptor */
ebdp = NULL; ebdp = NULL;
if (fep->bufdesc_ex) if (fep->bufdesc_ex)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册