[ovs-dev] [PATCH] datapath: Make our checksumming more closely match skb_checksum_help().
jesse at nicira.com
Tue Jul 13 14:17:47 PDT 2010
On Tue, Jul 13, 2010 at 11:50 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Mon, Jul 12, 2010 at 05:31:26PM -0700, Jesse Gross wrote:
> > Our code that handles checksumming does essentially the same thing
> > as skb_checksum_help() except it folds the process into copying to
> > userspace. This makes the two functions more closely resemble
> > each other in structure, including adding a couple of BUG() checks.
> > This should have no functional change but makes comparision easier
> > when debugging.
> Looks good, one nit:
> > @@ -2215,6 +2210,8 @@ success:
> > copy_bytes = csum_start;
> > csump = (__sum16 __user *)(buf + csum_start
> + csum_offset);
> > +
> > + BUG_ON((char *)csump + sizeof(__sum16) >
> buf + nbytes);
> > put_user(csum_fold(csum), csump);
> The BUG_ON could be tightened from > to >=, right?
I don't think so. Both sides are base pointer + length, so if they are
equal the operation is fine (this check is directly equivalent to one in
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dev