]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath-windows: Encapsulate packet when src port is tunnel port
authorSairam Venugopal <vsairam@vmware.com>
Thu, 1 Sep 2016 21:54:42 +0000 (14:54 -0700)
committerGurucharan Shetty <guru@ovn.org>
Fri, 2 Sep 2016 17:56:25 +0000 (10:56 -0700)
If a packet arrives on a tunnel port and is again transmitted on a tunnel
port, the packet needs to be encapsulated.

Eg:
Sample flow which arrives on a tunnel port and gets encapsulated again.

eth(src=00:15:5d:ae:b7:b1,dst=ff:ff:ff:ff:ff:ff),in_port(5),eth_type(0x0806),
arp(sip=192.168.1.12,tip=192.168.1.78,op=1,sha=00:15:5d:ae:b7:b1,tha=00:00:00:00:00:00),
tunnel(tun_id=0x5b88,dst=192.165.226.191,src=192.166.255.253,tos=0,ttl=63,
geneve({class=0x104,type=0x80,len=4,0x11680100}),flags(key))

actions:set(tunnel(tun_id=0x5b88,dst=192.165.226.190,ttl=64,
    geneve({class=0x104,type=0x80,len=4,0x1680100}),flags(df|csum|key))),5,4

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
datapath-windows/ovsext/Actions.c

index 722a2a8784f5550d3c6545e410d2de5735aa2c97..f46309ad78ca8ae16c69df406045606aa8f48352 100644 (file)
@@ -311,7 +311,7 @@ OvsDetectTunnelPkt(OvsForwardingContext *ovsFwdCtx,
          * - a VIF port
          * - a bridge-internal port (packets generated from userspace)
          * - no port.
-         *
+         * - tunnel port
          * If the packet will not be encapsulated, consume the tunnel context
          * by clearing it.
          */
@@ -322,7 +322,8 @@ OvsDetectTunnelPkt(OvsForwardingContext *ovsFwdCtx,
 
             if (!vport ||
                 (vport->ovsType != OVS_VPORT_TYPE_NETDEV &&
-                 !OvsIsBridgeInternalVport(vport))) {
+                 !OvsIsBridgeInternalVport(vport) &&
+                 !OvsIsTunnelVportType(vport->ovsType))) {
                 ovsFwdCtx->tunKey.dst = 0;
             }
         }