Skip to contentSkip to conversation

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

PATCH Applied Fabio Estevam 2 participants 2 messages Oct 21, 2016 – Oct 23, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

From: Fabio Estevam <[email protected]>

Commit 3ac72b7b63d5 ("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 3ac72b7b63d5 ("net: fec: align IP header in hardware")
Reported-and-tested-by Henri Roosen <[email protected]>
---
 drivers/net/ethernet/freescale/fec_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/freescale/fec_main.c +3 -3
index 4ce8179..3c888be 100644
@@ -1430,14 +1430,14 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
 		skb_put(skb, pkt_len - 4);
 		data = skb->data;
 
+		if (!is_copybreak && need_swap)
+			swap_buffer(data, pkt_len);
+
 #if !defined(CONFIG_M5272)
 		if (fep->quirks & FEC_QUIRK_HAS_RACC)
 			data = skb_pull_inline(skb, 2);
 #endif
 
-		if (!is_copybreak && need_swap)
-			swap_buffer(data, pkt_len);
-
 		/* Extract the enhanced buffer descriptor */
 		ebdp = NULL;
 		if (fep->bufdesc_ex)
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

From: Fabio Estevam <[email protected]>
Date: Fri, 21 Oct 2016 09:34:29 -0200

Quoted 9 lines

From: Fabio Estevam <[email protected]>

Commit 3ac72b7b63d5 ("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.

Quoted 6 lines

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

Fixes 3ac72b7b63d5 ("net: fec: align IP header in hardware")
Reported-and-tested-by Henri Roosen <[email protected]>

Applied, thank you.