-static int
-netdev_vport_create(const struct netdev_class *netdev_class, const char *name,
- const struct shash *args,
- struct netdev_dev **netdev_devp)
-{
- const struct vport_class *vport_class = vport_class_cast(netdev_class);
- uint64_t config[VPORT_CONFIG_SIZE / 8];
- struct shash fetched_args;
- int error;
-
- memset(config, 0, sizeof config);
- shash_init(&fetched_args);
-
- if (!shash_is_empty(args)) {
- /* Parse the provided configuration. */
- error = vport_class->parse_config(name, netdev_class->type,
- args, config);
- } else {
- /* Fetch an existing configuration from the kernel.
- *
- * This case could be ambiguous with initializing a new vport with an
- * empty configuration, but none of the existing vport classes accept
- * an empty configuration. */
- struct odp_port odp_port;
-
- memset(&odp_port, 0, sizeof odp_port);
- strncpy(odp_port.devname, name, sizeof odp_port.devname);
- error = netdev_vport_do_ioctl(ODP_VPORT_QUERY, &odp_port);
- if (!error) {
- /* XXX verify correct type */
- memcpy(config, odp_port.config, sizeof config);
- error = vport_class->unparse_config(name, netdev_class->type,
- odp_port.config,
- &fetched_args);
- if (error) {
- VLOG_ERR_RL(&rl, "%s: failed to parse kernel config (%s)",
- name, strerror(error));
- }
- } else {
- VLOG_ERR_RL(&rl, "%s: vport query failed (%s)",
- name, strerror(error));
- }
- }
+static bool
+netdev_vport_needs_dst_port(const struct netdev *dev)
+{
+ const struct netdev_class *class = netdev_get_class(dev);
+ const char *type = netdev_get_type(dev);
+
+ return (class->get_config == get_tunnel_config &&
+ (!strcmp("vxlan", type) || !strcmp("lisp", type)));
+}