summaryrefslogtreecommitdiff
path: root/ovn
diff options
context:
space:
mode:
authorHan Zhou <zhouhan@gmail.com>2018-08-06 19:44:00 -0700
committerBen Pfaff <blp@ovn.org>2018-08-07 15:16:40 -0700
commit1fba38f1680bb85593c3142bf588c354a78f6bf0 (patch)
tree2deaacff84009b93407479c94c65785069215159 /ovn
parente2e11c890e1e6c5e9d6685c5f81dca3c41b1b03a (diff)
downloadopenvswitch-1fba38f1680bb85593c3142bf588c354a78f6bf0.tar.gz
ovn-northd: Simplify struct ovn_port_group.
Remove the redundant members that's already in nb_pg. Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Mark Michelson <mmichels@redhat.com>
Diffstat (limited to 'ovn')
-rw-r--r--ovn/northd/ovn-northd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 067d52d82..d2a777f11 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -3027,8 +3027,6 @@ struct ovn_port_group {
struct uuid key; /* nb_pg->header_.uuid. */
const struct nbrec_port_group *nb_pg;
struct hmap nb_lswitches; /* NB lswitches related to the port group */
- size_t n_acls; /* Number of ACLs applied to the port group */
- struct nbrec_acl **acls; /* ACLs applied to the port group */
};
static void
@@ -3068,8 +3066,8 @@ has_stateful_acl(struct ovn_datapath *od, struct hmap *port_groups)
struct ovn_port_group *pg;
HMAP_FOR_EACH (pg, key_node, port_groups) {
if (ovn_port_group_ls_find(pg, &od->nbs->header_.uuid)) {
- for (size_t i = 0; i < pg->n_acls; i++) {
- struct nbrec_acl *acl = pg->acls[i];
+ for (size_t i = 0; i < pg->nb_pg->n_acls; i++) {
+ struct nbrec_acl *acl = pg->nb_pg->acls[i];
if (!strcmp(acl->action, "allow-related")) {
return true;
}
@@ -3558,8 +3556,6 @@ ovn_port_group_create(struct hmap *pgs,
struct ovn_port_group *pg = xzalloc(sizeof *pg);
pg->key = nb_pg->header_.uuid;
pg->nb_pg = nb_pg;
- pg->n_acls = nb_pg->n_acls;
- pg->acls = nb_pg->acls;
hmap_init(&pg->nb_lswitches);
hmap_insert(pgs, &pg->key_node, uuid_hash(&pg->key));
return pg;
@@ -3723,8 +3719,8 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows,
struct ovn_port_group *pg;
HMAP_FOR_EACH (pg, key_node, port_groups) {
if (ovn_port_group_ls_find(pg, &od->nbs->header_.uuid)) {
- for (size_t i = 0; i < pg->n_acls; i++) {
- consider_acl(lflows, od, pg->acls[i], has_stateful);
+ for (size_t i = 0; i < pg->nb_pg->n_acls; i++) {
+ consider_acl(lflows, od, pg->nb_pg->acls[i], has_stateful);
}
}
}