linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug fix]mips 64bits checksum error -- csum_tcpudp_nofold
@ 2017-01-25  4:35 Mark Zhang
  2017-01-25 18:13 ` Alexander Duyck
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Zhang @ 2017-01-25  4:35 UTC (permalink / raw)
  To: ralf, davem, aduyck; +Cc: linux-mips, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

If the input parameters as saddr = 0xc0a8fd60,daddr = 0xc0a8fda1,len =
80, proto = 17, sum =0x7eae049d.
The correct result should be 1, but original function return 0.

Attached the correction patch.

[-- Attachment #2: 0001-Fixed-the-mips-64bits-checksum-error-csum_tcpudp_nof.patch --]
[-- Type: application/octet-stream, Size: 849 bytes --]

From 52e265f7fe0acf9a6e9c4346e1fe6fa994aa00b6 Mon Sep 17 00:00:00 2001
From: qzhang <qin.2.zhang@nsn.com>
Date: Wed, 25 Jan 2017 12:25:25 +0800
Subject: [PATCH] Fixed the mips 64bits checksum error -- csum_tcpudp_nofold

---
 arch/mips/include/asm/checksum.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h
index 7749daf..0e351c5 100644
--- a/arch/mips/include/asm/checksum.h
+++ b/arch/mips/include/asm/checksum.h
@@ -184,6 +184,10 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
 	"	daddu	%0, %2		\n"
 	"	daddu	%0, %3		\n"
 	"	daddu	%0, %4		\n"
+	"	dsrl32  $1, %0, 0	\n"
+	"	dsll32	%0, %0, 0	\n"
+	"	dsrl32	%0, %0, 0	\n"
+	"	daddu   %0, $1		\n"
 	"	dsll32	$1, %0, 0	\n"
 	"	daddu	%0, $1		\n"
 	"	dsra32	%0, %0, 0	\n"
-- 
1.7.1


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

end of thread, other threads:[~2017-01-26 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25  4:35 [Bug fix]mips 64bits checksum error -- csum_tcpudp_nofold Mark Zhang
2017-01-25 18:13 ` Alexander Duyck
2017-01-26  2:33   ` Mark Zhang
2017-01-26 15:57     ` Alexander Duyck
2017-01-26 16:11       ` Ralf Baechle
2017-01-26  8:09   ` Ralf Baechle

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