On Wed, Nov 30, 2016 at 4:41 PM, Yang, Yi Y <yi.y.y...@intel.com> wrote:
> I think this issue is not that simple. It depends on how you use it.
> For normal use cases, a tunnel port will terminate the tunnel traffic, so a 
> packet sent to a tunnel port will never be from another tunnel port, so no 
> tunnel metadata is available for the first packet, but for the packets which 
> are from the counterpart tunnel port (which is another host), I think this 
> tunnel port will keep the tunnel metadata for the traffic so that it can use 
> src_port as dst_port for the packets sent back to the counterpart tunnel 
> port. So the original source code makes sense, it works well.
> But for your use case (including the case I reported), you're send the packet 
> from GENEVE port to VXLAN or from VXLAN to GENEVE, the tunnel metadata for 
> GENEVE shouldn't be used by VXLAN, vice versa, but how can we pull this off? 
> Actually this is a special use case, ovs doesn't realize we can use it in 
> this way :-)
I think there are two issues.
1. vxlan should not use dst-port from tunnel metadata.
2. vswitchd should set correct dst-port for tunnel metadata.

We can not change vxlan at this point since it is userspace API. But
it is easy to fix userspace to set consistent dst-port for given
tunnel port.
Can you try attached patch? If it works I will submit formal patch.

From 47f0583fb2d15fae929352e1308426d893912641 Mon Sep 17 00:00:00 2001
From: Pravin B Shelar <pshe...@ovn.org>
Date: Thu, 1 Dec 2016 22:34:25 -0800
Subject: [PATCH] tunnel: set udp dst-port

keep tunnel info consistent with egress tunnel port.

Signed-off-by: Pravin B Shelar <pshe...@ovn.org>
 ofproto/tunnel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c
index 97de59e..ce727f4 100644
--- a/ofproto/tunnel.c
+++ b/ofproto/tunnel.c
@@ -427,6 +427,7 @@ tnl_port_send(const struct ofport_dpif *ofport, struct flow *flow,
             flow->tunnel.ipv6_dst = in6addr_any;
+    flow->tunnel.tp_dst = cfg->dst_port;
     if (!cfg->out_key_flow) {
         flow->tunnel.tun_id = cfg->out_key;

discuss mailing list

Reply via email to