Re: Checksum problem on sparc64

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

 



Hi,

Syn wrote:
> The value returned by csum_block_sub() may have the 16 MSB bits set.
> th->check = tcp_v4_check(th, len, inet->saddr, inet->daddr,
>                         csum_partial((char *)th,
>                                      th->doff << 2,
>                                      skb->csum));

There indeed seems to be an issue in csum_partial: quoting beginning and
end of csum_partial in checksum.S:

        .align          32
        .globl          csum_partial
csum_partial:           /* %o0=buff, %o1=len, %o2=sum */
	/* skb->csum is in %o2 */

 	 ... a lot of computing that doesn't involve %o2 ...

1:      add             %o2, %o4, %o2

csum_partial_finish:
        retl
         mov            %o2, %o0

The last add doesn't take care of the potential carry into the 33th
bit. I guess something like

1:      add             %o2, %o4, %o2
	srlx		%o2, 32, %o4
	srl		%o2, 0, %o2
	add		%o2, %o4, %o2

csum_partial_finish:
        retl
         mov            %o2, %o0

should be correct.

Samuel
-
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