Subject: Re: [PATCH net] pktgen: fix UDP checksum computation

From: Sabrina Dubroca <[email-masked]>
Date: Fri, 6 Feb 2015 14:46:46 +0100

2015-02-05, 16:28:02 -0800, Eric Dumazet wrote:
> On Thu, 2015-02-05 at 15:57 -0800, Tom Herbert wrote:
> 
> > Would it be possible to use udp_set_csum to handle all of this?

I will look.

> This reminds me we have following sparse errors with checksum code,
> could you take a look Tom ?
> 
> make C=2 CF=-D__CHECK_ENDIAN__  ...
> 
> include/linux/skbuff.h:3022:24: warning: incorrect type in return expression (different base types)
> include/linux/skbuff.h:3022:24:    expected restricted __sum16
> include/linux/skbuff.h:3022:24:    got int
> 
> net/ipv6/ip6_checksum.c:83:16: warning: incorrect type in return expression (different base types)
> net/ipv6/ip6_checksum.c:83:16:    expected int
> net/ipv6/ip6_checksum.c:83:16:    got restricted __sum16 [assigned] [usertype] __ret
> 
>   CHECK   net/ipv4/tcp_offload.c
> net/ipv4/tcp_offload.c:139:60: warning: incorrect type in argument 2 (different base types)
> net/ipv4/tcp_offload.c:139:60:    expected restricted __wsum [usertype] res
> net/ipv4/tcp_offload.c:139:60:    got fouled restricted __sum16
> include/linux/skbuff.h:3317:14: warning: incorrect type in assignment (different base types)
> include/linux/skbuff.h:3317:14:    expected unsigned short [unsigned] [usertype] csum
> include/linux/skbuff.h:3317:14:    got restricted __sum16
> include/linux/skbuff.h:3322:16: warning: incorrect type in return expression (different base types)
> include/linux/skbuff.h:3322:16:    expected restricted __sum16
> include/linux/skbuff.h:3322:16:    got unsigned short [unsigned] [usertype] csum
> net/ipv4/tcp_offload.c:173:52: warning: incorrect type in argument 2 (different base types)
> net/ipv4/tcp_offload.c:173:52:    expected restricted __wsum [usertype] res
> net/ipv4/tcp_offload.c:173:52:    got fouled restricted __sum16
> include/linux/skbuff.h:3317:14: warning: incorrect type in assignment (different base types)
> include/linux/skbuff.h:3317:14:    expected unsigned short [unsigned] [usertype] csum
> include/linux/skbuff.h:3317:14:    got restricted __sum16
> include/linux/skbuff.h:3322:16: warning: incorrect type in return expression (different base types)
> include/linux/skbuff.h:3322:16:    expected restricted __sum16
> include/linux/skbuff.h:3322:16:    got unsigned short [unsigned] [usertype] csum

I have patches ready for that and other sparse warnings, I just need
to check and send them.

Thanks

-- 
Sabrina