[ovs-dev] [PATCH 01/14] tunneling: Clear OVS_CB after call to update_header().

Jesse Gross jesse at nicira.com
Thu Dec 2 21:04:41 UTC 2010


On Thu, Dec 2, 2010 at 12:57 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Thu, Dec 02, 2010 at 12:36:50PM -0800, Jesse Gross wrote:
>> If a packet is traversing the IP stack we need to clear some pieces
>> of the skb CB beforehand.  We currently do this before the call to
>> update_header() but header generation may need some members of the
>> CB, such as the key.  Therefore, zero out the CB only after the
>> header is complete.
>>
>> Signed-off-by: Jesse Gross <jesse at nicira.com>
>
> If I'm reading the code right then this way is easier to understand,
> too, because it clears the CB just before it enters the IP stack instead
> of somewhat earlier.

Right, it is easier to understand this way.  The reason why it was
previously done earlier is that if we are doing fragmentation (only
applicable for CAPWAP) then we only have to clear the fields once
rather than for each fragment.  However, both fragmentation and going
through the IP stack are slow paths, so it doesn't really matter.

>
> It might be slightly cleaner to use a single call to memset to zero the
> whole IPCB.  There are only two members, and each is currently zeroed
> separately.  It's not changed by this patch though.

That's a good idea, I'll insert an additional commit that does that.




More information about the dev mailing list