Re: Checksum problem on sparc64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Date: Sun, 4 Jun 2006 16:34:38 +0200

[ BTW: linux-sparc doesn't exist, the list name is sparclinux.
       Samuel, what in your mail client caused it to change
       from sparclinux@vger to linux-sparc@vger in your replies? ]

> Samuel Thibault, le Sun 04 Jun 2006 16:32:15 +0200, a écrit :
> > The last add doesn't take care of the potential carry into the 33th
> > bit.
> 
> (which _do_ happen when the csum has its 16 MSB set, as Richard pointed
> out).

Thanks for all of the excellent detective work guys.

This patch below should fix things up.

Let me know if it works for you.

diff --git a/arch/sparc64/lib/checksum.S b/arch/sparc64/lib/checksum.S
index ba9cd3c..1d230f6 100644
--- a/arch/sparc64/lib/checksum.S
+++ b/arch/sparc64/lib/checksum.S
@@ -165,8 +165,9 @@ csum_partial_end_cruft:
 	sll		%g1, 8, %g1
 	or		%o5, %g1, %o4
 
-1:	add		%o2, %o4, %o2
+1:	addcc		%o2, %o4, %o2
+	addc		%g0, %o2, %o2
 
 csum_partial_finish:
 	retl
-	 mov		%o2, %o0
+	 srl		%o2, 0, %o0
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux