[ovs-discuss] Anybody knows how we can dynamically change vxlan dst_port by openflow load, move or set_field action?

Gerhard Stenzel gstenzel at linux.vnet.ibm.com
Mon Nov 28 09:38:41 UTC 2016


On 11/26/2016 11:08 PM, Ben Pfaff wrote:
> On Thu, Nov 24, 2016 at 02:39:43AM +0000, Yang, Yi Y wrote:
>> I noticed vxlan module always uses tp_dst from tunnel metadata in preference to vxlan->cfg.dst_port, this isn't the result we want in some use cases, for example, if we create two vxlan port which have different dst_port, when we forward the packet from the first vxlan port to the second one, we need the packet should be sent out with the second vxlan port's dst_port as tp_dst, but current vxlan module will use that one from the first vxlan port, the source code in vxlan module and our experiment have confirmed this.
>>
>> The line in file datapath/linux/compat/vxlan.c is here:
>>
>> dst_port = info->key.tp_dst ? : vxlan->cfg.dst_port;
>>
>> Anybody knows how we can change this? The below change seems more reasonable to me, or do we have some ways to dynamically change it by openflow actions?
>>
>> dst_port = vxlan->cfg.dst_port ? : info->key.tp_dst;
> 
> I think that this might be related to the bug that Gerhard reported,
> starting here:
>    https://mail.openvswitch.org/pipermail/ovs-discuss/2016-November/042984.html
> Gerhard, does Yang's fix make any difference for you?  (I don't know
> whether you're using the compat code, but the upstream code may have the
> same bug.)

As stated in the other thread, I am using the kernel provided OVS modules. The closest to above, which I could find in the kernel source, is the following:

./net/openvswitch/vport-vxlan.c:

static int vxlan_get_options(const struct vport *vport, struct sk_buff *skb)
{
        struct vxlan_dev *vxlan = netdev_priv(vport->dev);
        __be16 dst_port = vxlan->cfg.dst_port;

        if (nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, ntohs(dst_port)))
                return -EMSGSIZE;
... 




More information about the discuss mailing list