[ovs-discuss] packet_type=legacy_l3 gre tunnel does not work
Gregory Rose
gvrose8192 at gmail.com
Fri Oct 19 17:37:02 UTC 2018
On 10/18/2018 10:28 PM, Yousong Zhou wrote:
> On Fri, 19 Oct 2018 at 01:13, Gregory Rose <gvrose8192 at gmail.com> wrote:
>> On 10/17/2018 6:01 AM, Yousong Zhou wrote:
>>
>> I tried to use ip-over-gre with openvswitch 2.8.4, but no "ip proto
>> 47" traffic can be seen with tcpdump. Later I added a WARN_ON_ONCE(1)
>> line just before the "goto drop" statement in ovs_vport_send() and it
>> was triggered right away thus pinpointed the problem.
>>
>> It looks to me openvswitch linux kernel datapath always create
>> ARPHRD_IPGRE device and never set dev->type to ARPHRD_NONE. Please
>> correct me if this is not the case. The ovs-vswitchd.conf.db doc says
>> setting packet_type=legacy_l3 should work. I am trying to figure
>> what's the missing piece.
>>
>>
>> Openvswitch 2.8.4 depends on the built-in gre kernel module and it is true that
>> module will always set the device type to ARPHRD_IPGRE upon initial creation
>> but if the tunnel is set to a metadata type tunnel then the device type should
>> be reset to ARPHRD_NONE.
>>
>>
>> From ../net/ipv4/ip_gre.c:L1037
>> if (data[IFLA_GRE_COLLECT_METADATA]) {
>> struct ip_tunnel *t = netdev_priv(dev);
>>
>> t->collect_md = true;
>> if (dev->type == ARPHRD_IPGRE)
>> dev->type = ARPHRD_NONE;
>> }
>>
>> https://elixir.bootlin.com/linux/v4.6/source/net/ipv4/ip_gre.c#L1037
>>
>> Perhaps that code is not being hit?
> No, nl_attr *data[] was zeroed out in gretap_fb_dev_create().
And you are sure there is no subsequent call to ipgre_netlink_parms()?
> t->collect_md = true was also set there. There was a patch [1] to
> workaround this but it seems that the function is compat code and
> kernel would rather not adding feature to it.
>
> By the way, does someone know what is the meaning of _fb_ in
> gretap_fb_dev_create()?
>
> [1] [net-next,v12,9/9] openvswitch: use ipgre tunnel rather than
> gretap tunnel, https://patchwork.ozlabs.org/patch/682916/
>
> yousong
The _fb_ stands for either "fall back" or "fully backed" device (I've
heard both). It's necessary for namespace support IIRC.
- Greg
More information about the discuss
mailing list