diff options
author | Jarno Rajahalme <jrajahalme@nicira.com> | 2015-06-09 17:00:00 -0700 |
---|---|---|
committer | Jarno Rajahalme <jrajahalme@nicira.com> | 2015-06-10 16:17:47 -0700 |
commit | 2b7b1427c177d28ec63632646ce896eec7f162b6 (patch) | |
tree | 97d4fecd8ca81249fbd5ccf9cb8a03a28571460e /lib/ovs-router.c | |
parent | db5076eee46e5ad4d67dc02b902c9b4aaeb190a4 (diff) | |
download | openvswitch-2b7b1427c177d28ec63632646ce896eec7f162b6.tar.gz |
classifier: Support table versioning
This patch allows classifier rules to become visible and invisible in
specific versions. A 'version' is defined as a positive monotonically
increasing integer, which never wraps around.
The new 'visibility' attribute replaces the prior 'to_be_removed' and
'visible' attributes.
When versioning is not used, the 'version' parameter should be passed
as 'CLS_MIN_VERSION' when creating rules, and 'CLS_MAX_VERSION' when
looking up flows.
This feature enables the support for atomic OpenFlow bundles without
significant performance penalty on 64-bit systems. There is a
performance decrease in 32-bit systems due to 64-bit atomics used.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ovs-router.c')
-rw-r--r-- | lib/ovs-router.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ovs-router.c b/lib/ovs-router.c index bf205d6b4..532487e8f 100644 --- a/lib/ovs-router.c +++ b/lib/ovs-router.c @@ -68,7 +68,7 @@ ovs_router_lookup(ovs_be32 ip_dst, char output_bridge[], ovs_be32 *gw) const struct cls_rule *cr; struct flow flow = {.nw_dst = ip_dst}; - cr = classifier_lookup(&cls, &flow, NULL); + cr = classifier_lookup(&cls, CLS_MAX_VERSION, &flow, NULL); if (cr) { struct ovs_router_entry *p = ovs_router_entry_cast(cr); @@ -115,7 +115,8 @@ ovs_router_insert__(uint8_t priority, ovs_be32 ip_dst, uint8_t plen, p->nw_addr = match.flow.nw_dst; p->plen = plen; p->priority = priority; - cls_rule_init(&p->cr, &match, priority); /* Longest prefix matches first. */ + /* Longest prefix matches first. */ + cls_rule_init(&p->cr, &match, priority, CLS_MIN_VERSION); ovs_mutex_lock(&mutex); cr = classifier_replace(&cls, &p->cr, NULL, 0); @@ -144,7 +145,7 @@ rt_entry_delete(uint8_t priority, ovs_be32 ip_dst, uint8_t plen) rt_init_match(&match, ip_dst, plen); - cls_rule_init(&rule, &match, priority); + cls_rule_init(&rule, &match, priority, CLS_MIN_VERSION); /* Find the exact rule. */ cr = classifier_find_rule_exactly(&cls, &rule); |