On Fri, Aug 09, 2013 at 01:45:19PM -0700, Jesse Gross wrote:
> On Fri, Aug 9, 2013 at 1:17 PM, Ben Pfaff <b...@nicira.com> wrote:
> > On Wed, Aug 07, 2013 at 03:55:49PM -0700, Jesse Gross wrote:
> >> On Tue, Jul 30, 2013 at 5:31 PM, Joe Stringer <j...@wand.net.nz> wrote:
> >> > This patch adds support for rewriting SCTP src,dst ports similar to the
> >> > functionality already available for TCP/UDP.
> >> >
> >> > Rewriting SCTP ports is expensive due to double-recalculation of the
> >> > SCTP checksums; this is performed to ensure that packets traversing OVS
> >> > with invalid checksums will continue to the destination with any
> >> > checksum corruption intact.
> >> >
> >> > Reviewed-by: Simon Horman <ho...@verge.net.au>
> >> > Signed-off-by: Joe Stringer <j...@wand.net.nz>
> >>
> >> Ben, I think you're planning on handling the rest of this patchset but
> >> this one looks good to me.
> >>
> >> Acked-by: Jesse Gross <je...@nicira.com>
> >
> > Jesse, this patch gives me sparse warnings building against Linux
> > 3.2.0:
> >
> > /home/blp/ovs/_build/../datapath/linux/compat/include/net/sctp/checksum.h:24:31:
> >  warning: incorrect type in argument 1 (different base types)
> > /home/blp/ovs/_build/../datapath/linux/compat/include/net/sctp/checksum.h:24:31:
> >     expected restricted __be32 [usertype] crc32
> > /home/blp/ovs/_build/../datapath/linux/compat/include/net/sctp/checksum.h:24:31:
> >     got unsigned int [unsigned] [assigned] [usertype] crc32
> > include/net/sctp/checksum.h:82:16: warning: cast from restricted __be32
> > /home/blp/ovs/_build/../datapath/linux/compat/include/net/sctp/checksum.h:24:31:
> >  warning: incorrect type in argument 1 (different base types)
> > /home/blp/ovs/_build/../datapath/linux/compat/include/net/sctp/checksum.h:24:31:
> >     expected restricted __be32 [usertype] crc32
> > /home/blp/ovs/_build/../datapath/linux/compat/include/net/sctp/checksum.h:24:31:
> >     got unsigned int [unsigned] [assigned] [usertype] crc32
> > include/net/sctp/checksum.h:82:16: warning: cast from restricted __be32
> 
> Joe mentioned that this is due to a bug in the kernel headers that has
> been fixed upstream:
> 
> "This patch introduces sparse warnings in some cases when calling
> sctp_end_cksum(), due to a bug that was fixed in v3.10:
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=eee1d5a14780b9391ec51f3feaf4cffb521ddbb1";

Then do you mind if I fold in this incremental as I apply it?  I don't
like having new sparse warnings appear when I can avoid them.

diff --git a/datapath/linux/compat/include/net/sctp/checksum.h 
b/datapath/linux/compat/include/net/sctp/checksum.h
index f1c2819..11fb0b6 100644
--- a/datapath/linux/compat/include/net/sctp/checksum.h
+++ b/datapath/linux/compat/include/net/sctp/checksum.h
@@ -21,7 +21,10 @@ static inline __le32 sctp_compute_cksum(const struct sk_buff 
*skb,
                crc32 = sctp_update_cksum((__u8 *) iter->data,
                                          skb_headlen(iter), crc32);
 
-       return sctp_end_cksum(crc32);
+       /* Open-code sctp_end_cksum() to avoid a sparse warning due to a bug in
+        * sparse annotations in Linux fixed in 3.10 in commit eee1d5a14 (sctp:
+        * Correct type and usage of sctp_end_cksum()). */
+       return cpu_to_le32(~crc32);
 }
 #endif
 
Thanks,

Ben.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to