[ovs-dev] [PATCH v2] gre: Restructure tunneling.

Pravin Shelar pshelar at nicira.com
Thu May 23 04:10:35 UTC 2013


On Wed, May 22, 2013 at 8:16 PM, Jesse Gross <jesse at nicira.com> wrote:
> On Wed, May 22, 2013 at 1:20 PM, Pravin Shelar <pshelar at nicira.com> wrote:
>> On Tue, May 21, 2013 at 4:39 PM, Jesse Gross <jesse at nicira.com> wrote:
>>> On Mon, May 20, 2013 at 2:33 PM, Pravin B Shelar <pshelar at nicira.com> wrote:
>>>> Following patch restructures ovs tunneling and gre vport
>>>> implementation to make ovs tunneling more in sync with
>>>> upstream kernel tunneling.  Doing this tunneling code is
>>>> simplified as most of protocol processing on send and
>>>> recv is pushed to kernel tunneling.  For external ovs
>>>> module the code is moved to kernel compatibility code.
>>>>
>>>> Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
>>>
>>> A couple more comments (just on the non-compat portions):
>>>
>>>> diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c
>>>> index add17d9..f551976 100644
>>>> --- a/datapath/vport-gre.c
>>>> +++ b/datapath/vport-gre.c
>>>> -static __be32 be64_get_high32(__be64 x)
>>>> +static __be16 ovs_tnl_flags_to_gre_flags(u16 tun_flags)
>>> [...]
>>>> +       __be16 flags = 0;
>>>> +       if (tun_flags & OVS_TNL_F_CSUM)
>>>> +               flags |= TUNNEL_CSUM;
>>>> +       if (tun_flags & OVS_TNL_F_KEY)
>>>> +               flags |= TUNNEL_KEY;
>>>> +       return flags;
>>>>  }
>>>
>>> Is there any way that we can unify the tunnel flags values to avoid
>>> needing to do this conversion? I know the existing flags are based on
>>> the GRE values, so maybe we should push the conversion down there.
>>>
>> OVS can directly use TUNNEL_* flags, we just need to define
>> OVS_TNL_F_DONT_FRAGMENT equivalent there.
>
> I'm not sure that it makes sense to have OVS use the TUNNEL_ flags
> directly since they are just GRE protocol values. I was wondering if
> we could make the protocol handlers use the OVS values. For example,
> with VXLAN it seems undesirable to define yet another set of flags and
> odd to use the GRE ones.

TUNNEL_* flags are ip_tunnel flags, there are separate flags for gre
protocol e.g. GRE_CSUM.
gre converts GRE_* flags to TUNNEL_* flags, ref: gre_flags_to_tnl_flags().



More information about the dev mailing list