[ovs-discuss] OVS - how to use geneve with variable length options ?

Jesse Gross jesse at kernel.org
Fri Sep 2 20:55:08 UTC 2016


On Fri, Sep 2, 2016 at 3:38 AM, Manish Chopra <manish.chopra at qlogic.com> wrote:
> Thanks Jesse, I tried below and it actually used GENEVE header with options [Total geneve header size = 16 bytes].
>
> ovs-vsctl add-br br2
> ifconfig br3 192.168.55.44
> ovs-vsctl add-port br2 gnv0 -- set interface gnv0 type=geneve options:remote_ip=192.168.44.45
> ovs-ofctl add-tlv-map br2 "{class=0xffff,type=0x80,len=4}->tun_metadata0"
> ovs-ofctl add-flow br2 "in_port=LOCAL,actions=set_field:1234->tun_metadata0,1"
>
> I believe it used 4 bytes of Variable options data [with value 1234] in option header.
>
> If I were to add more variable options data, How can I achieve that ??

There is a 'len' field in the add-tlv-map command you used. You can
change this to create options of different lengths. The length
represents the option payload data, not including the option header (4
bytes) or the base header (8 bytes). In this case you specified a
payload length of 4 bytes, so that plus 4 bytes for the option header
plus 8 bytes from the base header yields the 16 bytes you saw on the
wire.

In order to remap it you'll need to first delete the existing mapping and flows:
ovs-ofctl del-tlv-map br2 "{class=0xffff,type=0x80,len=4}->tun_metadata0"
ovs-ofctl del-flows br2 "in_port=LOCAL"

You can also add multiple options by creating additional mappings:
ovs-ofctl add-tlv-map br2 "{class=0xffff,type=0x80,len=4}->tun_metadata0"
ovs-ofctl add-tlv-map br2 "{class=0xffff,type=0,len=8}->tun_metadata1"
ovs-ofctl add-flow br2
"in_port=LOCAL,actions=set_field:1234->tun_metadata0,set_field:5678->tun_metadata1,1"



More information about the discuss mailing list