[ovs-dev] [PATCH] tunneling: Simplify path MTU discovery logic.
Jesse Gross
jesse at nicira.com
Thu Feb 3 23:03:56 UTC 2011
On Tue, Feb 1, 2011 at 11:41 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Thu, Jan 27, 2011 at 06:38:27PM -0800, Jesse Gross wrote:
>> Previously, if path MTU discovery was disabled we would use the
>> tunnel MTU instead of the underlying route's path MTU but otherwise
>> still do PMTUD. This doesn't make much sense because turning off
>> PMTUD really means to not check the size of the encapsulated packets
>> at all. This removes the disconnect and simplifies the logic.
>>
>> Signed-off-by: Jesse Gross <jesse at nicira.com>
>
> This code is very subtle. I think it is OK now.
>
> My compiler complains:
> datapath/linux-2.6/tunnel.c: In function 'tnl_send':
> datapath/linux-2.6/tunnel.c:1156: warning: 'frag_off' may be used uninitialized in this function
Hmm, my compiler is either smarter or lazier than yours.
>
> The compiler is wrong, but it could be made happy by changing frag_off
> to be the return value and using a special value like -1 to indicate an
> error. That might be more readable anyway.
I started to do it this way but it's a little messy because frag_off
is in network byte order.
>
> frag_off has only two possible values in check_mtu() now, as far as I
> can tell: 0 or htons(IP_DF). A boolean 'df' variable might be more
> readable (or might not).
This would work but it would require some extra logic in a few places,
so I'm not sure it helps all that much.
>
> Acked-by: Ben Pfaff <blp at nicira.com>
Thanks. I decided to just initialize frag_off to shut up the compiler
and pushed this.
More information about the dev
mailing list