return error;
}
\f
+static const char *
+port_open_type(const char *datapath_type, const char *port_type)
+{
+ return dpif_port_open_type(datapath_type, port_type);
+}
+
/* Type functions. */
static int
{
struct ofport_dpif *port = ofport_dpif_cast(port_);
struct ofproto_dpif *ofproto = ofproto_dpif_cast(port->up.ofproto);
- struct dpif_port dpif_port;
+ const char *devname = netdev_get_name(port->up.netdev);
- if (!dpif_port_query_by_number(ofproto->backer->dpif,
- port->odp_port, &dpif_port)) {
+ if (dpif_port_exists(ofproto->backer->dpif, devname)) {
/* The underlying device is still there, so delete it. This
* happens when the ofproto is being destroyed, since the caller
* assumes that removal of attached ports will happen as part of
* destruction. */
dpif_port_del(ofproto->backer->dpif, port->odp_port);
- dpif_port_destroy(&dpif_port);
}
- sset_find_and_delete(&ofproto->ports, netdev_get_name(port->up.netdev));
+ sset_find_and_delete(&ofproto->ports, devname);
hmap_remove(&ofproto->backer->odp_to_ofport_map, &port->odp_port_node);
ofproto->need_revalidate = REV_RECONFIGURE;
bundle_remove(port_);
struct flow flow;
int error;
- flow_extract(packet, 0, NULL, 0, &flow);
+ flow_extract(packet, 0, NULL, OFPP_LOCAL, &flow);
odp_port = vsp_realdev_to_vlandev(ofproto, ofport->odp_port,
flow.vlan_tci);
if (odp_port != ofport->odp_port) {
enumerate_types,
enumerate_names,
del,
+ port_open_type,
type_run,
type_run_fast,
type_wait,