datapath: Encapsulate parameters for new vports in new struct vport_parms.
[openvswitch] / datapath / datapath.c
index 522d4ec100c71c9329c5cd889ae74537bbeb3f82..529d496913ec3c418f611530d729f5e24a7aeed3 100644 (file)
@@ -54,7 +54,6 @@
 
 #include "compat.h"
 
-
 int (*dp_ioctl_hook)(struct net_device *dev, struct ifreq *rq, int cmd);
 EXPORT_SYMBOL(dp_ioctl_hook);
 
@@ -357,13 +356,14 @@ static int new_dp_port(struct datapath *dp, struct odp_port *odp_port, int port_
 
        vport = vport_locate(odp_port->devname);
        if (!vport) {
-               vport_lock();
+               struct vport_parms parms;
 
-               if (odp_port->flags & ODP_PORT_INTERNAL)
-                       vport = vport_add(odp_port->devname, "internal", NULL);
-               else
-                       vport = vport_add(odp_port->devname, "netdev", NULL);
+               parms.name = odp_port->devname;
+               parms.type = odp_port->flags & ODP_PORT_INTERNAL ? "internal" : "netdev";
+               parms.config = NULL;
 
+               vport_lock();
+               vport = vport_add(&parms);
                vport_unlock();
 
                if (IS_ERR(vport))