With this commit, the VTEP emulator detects the datapath_type of the
bridge used as a "physical" switch, and creates subsequent bridges
with the same type. This allows ovs-vtep to work with the userspace
datapath.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
exiting = False
ps_name = ""
exiting = False
ps_name = ""
Tunnel_Ip = ""
Lswitches = {}
Bindings = {}
Tunnel_Ip = ""
Lswitches = {}
Bindings = {}
self.tunnel_key = 0
vlog.warn("invalid tunnel key for %s, using 0" % self.name)
self.tunnel_key = 0
vlog.warn("invalid tunnel key for %s, using 0" % self.name)
- ovs_vsctl("--may-exist add-br %s" % self.short_name)
+ if ps_type:
+ ovs_vsctl("--may-exist add-br %s -- set Bridge %s datapath_type=%s"
+ % (self.short_name, self.short_name, ps_type))
+ else:
+ ovs_vsctl("--may-exist add-br %s" % self.short_name)
+
ovs_vsctl("br-set-external-id %s vtep_logical_switch true"
% self.short_name)
ovs_vsctl("br-set-external-id %s logical_switch_name %s"
ovs_vsctl("br-set-external-id %s vtep_logical_switch true"
% self.short_name)
ovs_vsctl("br-set-external-id %s logical_switch_name %s"
if (ps_name not in br_list):
ovs.util.ovs_fatal(0, "couldn't find OVS bridge %s" % ps_name, vlog)
if (ps_name not in br_list):
ovs.util.ovs_fatal(0, "couldn't find OVS bridge %s" % ps_name, vlog)
+ global ps_type
+ ps_type = ovs_vsctl("get Bridge %s datapath_type" % ps_name).strip('"')
+
call_prog("vtep-ctl", ["set", "physical_switch", ps_name,
'description="OVS VTEP Emulator"'])
call_prog("vtep-ctl", ["set", "physical_switch", ps_name,
'description="OVS VTEP Emulator"'])
ovs_vsctl("del-br %s" % br)
ovs_vsctl("del-br %s" % br)
- ovs_vsctl("add-br %s" % bfd_bridge)
+ if ps_type:
+ ovs_vsctl("add-br %s -- set Bridge %s datapath_type=%s"
+ % (bfd_bridge, bfd_bridge, ps_type))
+ else:
+ ovs_vsctl("add-br %s" % bfd_bridge)