#include "tnl-ports.h"
#include "tunnel.h"
#include "util.h"
+#include "uuid.h"
COVERAGE_DEFINE(xlate_actions);
COVERAGE_DEFINE(xlate_actions_oversize);
struct hmap_node ofp_node; /* Node in parent xbridge 'xports' map. */
ofp_port_t ofp_port; /* Key in parent xbridge 'xports' map. */
+ struct hmap_node uuid_node; /* Node in global 'xports_uuid' map. */
+ struct uuid uuid; /* Key in global 'xports_uuid' map. */
+
odp_port_t odp_port; /* Datapath port number or ODPP_NONE. */
struct ovs_list bundle_node; /* In parent xbundle (if it exists). */
struct hmap xbridges;
struct hmap xbundles;
struct hmap xports;
+ struct hmap xports_uuid;
};
static OVSRCU_TYPE(struct xlate_cfg *) xcfgp = OVSRCU_INITIALIZER(NULL);
static struct xlate_cfg *new_xcfg = NULL;
hash_pointer(xport->ofport, 0));
hmap_insert(&xport->xbridge->xports, &xport->ofp_node,
hash_ofp_port(xport->ofp_port));
+ hmap_insert(&xcfg->xports_uuid, &xport->uuid_node,
+ uuid_hash(&xport->uuid));
}
static void
new_xport->ofport = xport->ofport;
new_xport->ofp_port = xport->ofp_port;
new_xport->xbridge = xbridge;
+ new_xport->uuid = xport->uuid;
xlate_xport_init(new_xcfg, new_xport);
xlate_xport_set(new_xport, xport->odp_port, xport->netdev, xport->cfm,
hmap_init(&new_xcfg->xbridges);
hmap_init(&new_xcfg->xbundles);
hmap_init(&new_xcfg->xports);
+ hmap_init(&new_xcfg->xports_uuid);
xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp);
if (!xcfg) {
hmap_destroy(&xcfg->xbridges);
hmap_destroy(&xcfg->xbundles);
hmap_destroy(&xcfg->xports);
+ hmap_destroy(&xcfg->xports_uuid);
free(xcfg);
}
xport->ofport = ofport;
xport->xbridge = xbridge_lookup(new_xcfg, ofproto);
xport->ofp_port = ofp_port;
+ uuid_generate(&xport->uuid);
xlate_xport_init(new_xcfg, xport);
}
hmap_destroy(&xport->skb_priorities);
hmap_remove(&xcfg->xports, &xport->hmap_node);
+ hmap_remove(&xcfg->xports_uuid, &xport->uuid_node);
hmap_remove(&xport->xbridge->xports, &xport->ofp_node);
netdev_close(xport->netdev);