linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: mvneta: Fix big endian issue in mvneta_txq_desc_csum()
@ 2014-07-08 22:30 Thomas Fitzsimmons
  2014-07-08 23:19 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Fitzsimmons @ 2014-07-08 22:30 UTC (permalink / raw)
  To: linux-arm-kernel

This commit fixes the command value generated for CSUM calculation
when running in big endian mode.  The Ethernet protocol ID for IP was
being unconditionally byte-swapped in the layer 3 protocol check (with
swab16), which caused the mvneta driver to not function correctly in
big endian mode.  This patch byte-swaps the ID conditionally with
htons.

Cc: <stable@vger.kernel.org> # v3.13+
Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org>
---
The mvneta driver existed prior to v3.13, but it has only supported big
endian from v3.13 onward.  If it's accepted, this patch needs to be
backported for stable only as far back as v3.13.

 drivers/net/ethernet/marvell/mvneta.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 45beca1..667cf65 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -1207,7 +1207,7 @@ static u32 mvneta_txq_desc_csum(int l3_offs, int l3_proto,
 	command =  l3_offs    << MVNETA_TX_L3_OFF_SHIFT;
 	command |= ip_hdr_len << MVNETA_TX_IP_HLEN_SHIFT;
 
-	if (l3_proto == swab16(ETH_P_IP))
+	if (l3_proto == htons(ETH_P_IP))
 		command |= MVNETA_TXD_IP_CSUM;
 	else
 		command |= MVNETA_TX_L3_IP6;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] net: mvneta: Fix big endian issue in mvneta_txq_desc_csum()
  2014-07-08 22:30 [PATCH] net: mvneta: Fix big endian issue in mvneta_txq_desc_csum() Thomas Fitzsimmons
@ 2014-07-08 23:19 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-07-08 23:19 UTC (permalink / raw)
  To: linux-arm-kernel


Your postings was rejected because you did not enclose my full
name in double quotes.

When a name which has special characters such as ".", as my full
name does, it must be surrounded by double quotes when it appears
in email headers.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-08 23:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08 22:30 [PATCH] net: mvneta: Fix big endian issue in mvneta_txq_desc_csum() Thomas Fitzsimmons
2014-07-08 23:19 ` David Miller

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).