diff options
author | Ben Pfaff <blp@ovn.org> | 2016-12-17 10:51:49 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-12-19 21:02:11 -0800 |
commit | 3a60b7cd5f38badfdd15fe4ba57b5c74c9ee9fce (patch) | |
tree | 6e64c3768cedfe54846d276e7e9e37d6db250514 /ovn | |
parent | f1a8bd06d58f2c5312622fbaeacbc6ce7576e347 (diff) | |
download | openvswitch-3a60b7cd5f38badfdd15fe4ba57b5c74c9ee9fce.tar.gz |
ovn-controller: Rename all_lports to local_lports.
This sset has always just contained the names of logical ports that are
local to the current hypervisor, but the name 'all_lports' implied that it
contained the name of every logical port.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
Diffstat (limited to 'ovn')
-rw-r--r-- | ovn/controller/binding.c | 22 | ||||
-rw-r--r-- | ovn/controller/ovn-controller.c | 14 |
2 files changed, 21 insertions, 15 deletions
diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c index 591ce74f4..feca4331c 100644 --- a/ovn/controller/binding.c +++ b/ovn/controller/binding.c @@ -67,7 +67,7 @@ binding_register_ovs_idl(struct ovsdb_idl *ovs_idl) static void get_local_iface_ids(const struct ovsrec_bridge *br_int, struct shash *lport_to_iface, - struct sset *all_lports, + struct sset *local_lports, struct sset *egress_ifaces) { int i; @@ -89,7 +89,7 @@ get_local_iface_ids(const struct ovsrec_bridge *br_int, if (iface_id) { shash_add(lport_to_iface, iface_id, iface_rec); - sset_add(all_lports, iface_id); + sset_add(local_lports, iface_id); } /* Check if this is a tunnel interface. */ @@ -327,7 +327,7 @@ consider_local_datapath(struct controller_ctx *ctx, struct hmap *qos_map, struct hmap *local_datapaths, struct shash *lport_to_iface, - struct sset *all_lports) + struct sset *local_lports) { const struct ovsrec_interface *iface_rec = shash_find_data(lport_to_iface, binding_rec->logical_port); @@ -335,10 +335,10 @@ consider_local_datapath(struct controller_ctx *ctx, bool our_chassis = false; if (iface_rec || (binding_rec->parent_port && binding_rec->parent_port[0] && - sset_contains(all_lports, binding_rec->parent_port))) { + sset_contains(local_lports, binding_rec->parent_port))) { if (binding_rec->parent_port && binding_rec->parent_port[0]) { /* Add child logical port to the set of all local ports. */ - sset_add(all_lports, binding_rec->logical_port); + sset_add(local_lports, binding_rec->logical_port); } add_local_datapath(ldatapaths, lports, binding_rec->datapath, false, local_datapaths); @@ -351,7 +351,7 @@ consider_local_datapath(struct controller_ctx *ctx, "l2gateway-chassis"); our_chassis = chassis_id && !strcmp(chassis_id, chassis_rec->name); if (our_chassis) { - sset_add(all_lports, binding_rec->logical_port); + sset_add(local_lports, binding_rec->logical_port); add_local_datapath(ldatapaths, lports, binding_rec->datapath, false, local_datapaths); } @@ -364,9 +364,9 @@ consider_local_datapath(struct controller_ctx *ctx, true, local_datapaths); } } else if (!strcmp(binding_rec->type, "localnet")) { - /* Add all localnet ports to all_lports so that we allocate ct zones + /* Add all localnet ports to local_lports so that we allocate ct zones * for them. */ - sset_add(all_lports, binding_rec->logical_port); + sset_add(local_lports, binding_rec->logical_port); our_chassis = false; } @@ -396,7 +396,7 @@ binding_run(struct controller_ctx *ctx, const struct ovsrec_bridge *br_int, const struct sbrec_chassis *chassis_rec, const struct ldatapath_index *ldatapaths, const struct lport_index *lports, struct hmap *local_datapaths, - struct sset *all_lports) + struct sset *local_lports) { if (!chassis_rec) { return; @@ -409,7 +409,7 @@ binding_run(struct controller_ctx *ctx, const struct ovsrec_bridge *br_int, hmap_init(&qos_map); if (br_int) { - get_local_iface_ids(br_int, &lport_to_iface, all_lports, + get_local_iface_ids(br_int, &lport_to_iface, local_lports, &egress_ifaces); } @@ -421,7 +421,7 @@ binding_run(struct controller_ctx *ctx, const struct ovsrec_bridge *br_int, chassis_rec, binding_rec, sset_is_empty(&egress_ifaces) ? NULL : &qos_map, local_datapaths, &lport_to_iface, - all_lports); + local_lports); } diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index 926604295..1c9191c5b 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -487,7 +487,13 @@ main(int argc, char *argv[]) /* Contains "struct local_datapath" nodes. */ struct hmap local_datapaths = HMAP_INITIALIZER(&local_datapaths); - struct sset all_lports = SSET_INITIALIZER(&all_lports); + + /* Contains the name of each logical port resident on the local + * hypervisor. These logical ports include the VIFs (and their child + * logical ports, if any) that belong to VMs running on the hypervisor, + * l2gateway ports for which options:l2gateway-chassis designates the + * local hypervisor, and localnet ports. */ + struct sset local_lports = SSET_INITIALIZER(&local_lports); const struct ovsrec_bridge *br_int = get_br_int(&ctx); const char *chassis_id = get_chassis_id(ctx.ovs_idl); @@ -504,7 +510,7 @@ main(int argc, char *argv[]) chassis = chassis_run(&ctx, chassis_id, br_int); encaps_run(&ctx, br_int, chassis_id); binding_run(&ctx, br_int, chassis, &ldatapaths, &lports, - &local_datapaths, &all_lports); + &local_datapaths, &local_lports); } if (br_int && chassis) { @@ -514,7 +520,7 @@ main(int argc, char *argv[]) &pending_ct_zones); pinctrl_run(&ctx, &lports, br_int, chassis, &local_datapaths); - update_ct_zones(&all_lports, &local_datapaths, &ct_zones, + update_ct_zones(&local_lports, &local_datapaths, &ct_zones, ct_zone_bitmap, &pending_ct_zones); if (ctx.ovs_idl_txn) { commit_ct_zones(br_int, &pending_ct_zones); @@ -543,7 +549,7 @@ main(int argc, char *argv[]) lport_index_destroy(&lports); ldatapath_index_destroy(&ldatapaths); - sset_destroy(&all_lports); + sset_destroy(&local_lports); struct local_datapath *cur_node, *next_node; HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node, &local_datapaths) { |