+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
+
+ switch (vport->type) {
+ case OVS_VPORT_TYPE_NETDEV: {
+ const char *type = netdev_get_type_from_name(vport->name);
+
+ return type ? type : "system";
+ }
+
+ case OVS_VPORT_TYPE_INTERNAL:
+ return "internal";
+
+ case OVS_VPORT_TYPE_GRE:
+ return "gre";
+
+ case OVS_VPORT_TYPE_GRE64:
+ return "gre64";
+
+ case OVS_VPORT_TYPE_VXLAN:
+ return "vxlan";
+
+ case OVS_VPORT_TYPE_LISP:
+ return "lisp";
+
+ case OVS_VPORT_TYPE_UNSPEC:
+ case __OVS_VPORT_TYPE_MAX:
+ break;
+ }
+
+ VLOG_WARN_RL(&rl, "dp%d: port `%s' has unsupported type %u",
+ vport->dp_ifindex, vport->name, (unsigned int) vport->type);
+ return "unknown";
+}
+
+static enum ovs_vport_type
+netdev_to_ovs_vport_type(const struct netdev *netdev)
+{
+ const char *type = netdev_get_type(netdev);
+
+ if (!strcmp(type, "tap") || !strcmp(type, "system")) {
+ return OVS_VPORT_TYPE_NETDEV;
+ } else if (!strcmp(type, "internal")) {
+ return OVS_VPORT_TYPE_INTERNAL;
+ } else if (strstr(type, "gre64")) {
+ return OVS_VPORT_TYPE_GRE64;
+ } else if (strstr(type, "gre")) {
+ return OVS_VPORT_TYPE_GRE;
+ } else if (!strcmp(type, "vxlan")) {
+ return OVS_VPORT_TYPE_VXLAN;
+ } else if (!strcmp(type, "lisp")) {
+ return OVS_VPORT_TYPE_LISP;
+ } else {
+ return OVS_VPORT_TYPE_UNSPEC;
+ }
+}
+
+static int
+dpif_linux_port_add__(struct dpif_linux *dpif, struct netdev *netdev,
+ odp_port_t *port_nop)
+ OVS_REQ_WRLOCK(dpif->upcall_lock)
+{
+ const struct netdev_tunnel_config *tnl_cfg;
+ char namebuf[NETDEV_VPORT_NAME_BUFSIZE];
+ const char *name = netdev_vport_get_dpif_port(netdev,
+ namebuf, sizeof namebuf);