[ovs-dev] [PATCH v2 1/6] classifier: Remove redundant index.

Jarno Rajahalme jarno at ovn.org
Sat Apr 23 02:43:10 UTC 2016


The test for figuring out if the last index had the same fields as the
actual rules map as broken, resulting into keeping an unnecessary
index around.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ryan Moats <rmoats at us.ibm.com>
Acked-by: Ben Pfaff <blp at ovn.org>
---
 lib/classifier.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/classifier.c b/lib/classifier.c
index 19e26b4..52723ca 100644
--- a/lib/classifier.c
+++ b/lib/classifier.c
@@ -1499,11 +1499,11 @@ insert_subtable(struct classifier *cls, const struct minimask *mask)
     /* Map for the final stage. */
     *CONST_CAST(struct flowmap *, &subtable->index_maps[index])
         = miniflow_get_map_in_range(&mask->masks, prev, FLOW_U64S);
-    /* Check if the final stage adds any bits,
-     * and remove the last index if it doesn't. */
+    /* Check if the final stage adds any bits. */
     if (index > 0) {
-        if (flowmap_equal(subtable->index_maps[index],
-                          subtable->index_maps[index - 1])) {
+        if (flowmap_is_empty(subtable->index_maps[index])) {
+            /* Remove the last index, as it has the same fields as the rules
+             * map. */
             --index;
             cmap_destroy(&subtable->indices[index]);
         }
-- 
2.1.4




More information about the dev mailing list