From: Fabio Estevam <festevam@gmail.com>
To: davem@davemloft.net
Cc: fugang.duan@nxp.com, henri.roosen@ginzinger.com, eric@nelint.com,
kernel@pengutronix.de, rmk@armlinux.org.uk,
netdev@vger.kernel.org, Fabio Estevam <fabio.estevam@nxp.com>
Subject: [PATCH net] net: fec: Call swap_buffer() prior to IP header alignment
Date: Fri, 21 Oct 2016 09:34:29 -0200 [thread overview]
Message-ID: <1477049669-25101-1-git-send-email-festevam@gmail.com> (raw)
From: Fabio Estevam <fabio.estevam@nxp.com>
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 <henri.roosen@ginzinger.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
drivers/net/ethernet/freescale/fec_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 4ce8179..3c888be 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -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)
--
2.7.4
next reply other threads:[~2016-10-21 11:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-21 11:34 Fabio Estevam [this message]
2016-10-23 21:42 ` [PATCH net] net: fec: Call swap_buffer() prior to IP header alignment David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1477049669-25101-1-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=davem@davemloft.net \
--cc=eric@nelint.com \
--cc=fabio.estevam@nxp.com \
--cc=fugang.duan@nxp.com \
--cc=henri.roosen@ginzinger.com \
--cc=kernel@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=rmk@armlinux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).