classify: add simple mechanism for automatic flow creation (VPP-338) 39/3139/10
authorJuraj Sloboda <jsloboda@cisco.com>
Thu, 25 Aug 2016 13:40:29 +0000 (06:40 -0700)
committerDamjan Marion <dmarion.lists@gmail.com>
Wed, 21 Dec 2016 10:18:42 +0000 (10:18 +0000)
VPP-338 Support wildcards in IPFIX flow configuration

Change-Id: Ie5ab4f89d70153c3b15fc6bd8d97fa383ee842d9
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
vnet/vnet/classify/flow_classify_node.c

index 5c9e082..d3261d3 100644 (file)
@@ -228,35 +228,17 @@ flow_classify_inline (vlib_main_t * vm,
               hash0 = vnet_buffer(b0)->l2_classify.hash;
               t0 = pool_elt_at_index (vcm->tables, table_index0);
               e0 = vnet_classify_find_entry (t0, (u8 *) h0, hash0, now);
-
               if (e0)
                 {
                   hits++;
                 }
               else
                 {
-                  while (1)
-                    {
-                      if (PREDICT_TRUE(t0->next_table_index != ~0))
-                        {
-                          t0 = pool_elt_at_index (vcm->tables,
-                                                  t0->next_table_index);
-                        }
-                      else
-                        {
-                          misses++;
-                          break;
-                        }
-
-                      hash0 = vnet_classify_hash_packet (t0, (u8 *) h0);
-                      e0 = vnet_classify_find_entry (t0, (u8 *) h0, hash0, now);
-                      if (e0)
-                        {
-                          hits++;
-                          chain_hits++;
-                          break;
-                        }
-                    }
+                  misses++;
+                  vnet_classify_add_del_session (vcm, table_index0,
+                                                 h0, ~0, 0, 0, 0, 0, 1);
+                  /* increment counter */
+                  vnet_classify_find_entry (t0, (u8 *) h0, hash0, now);
                 }
             }
           if (PREDICT_FALSE((node->flags & VLIB_NODE_FLAG_TRACE)