From 7e9e6e1f1c1b9f41547899aeff5a05a5a7421103 Mon Sep 17 00:00:00 2001 From: Juraj Sloboda Date: Thu, 25 Aug 2016 06:40:29 -0700 Subject: classify: add simple mechanism for automatic flow creation (VPP-338) VPP-338 Support wildcards in IPFIX flow configuration Change-Id: Ie5ab4f89d70153c3b15fc6bd8d97fa383ee842d9 Signed-off-by: Juraj Sloboda --- vnet/vnet/classify/flow_classify_node.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/vnet/vnet/classify/flow_classify_node.c b/vnet/vnet/classify/flow_classify_node.c index 5c9e0820a26..d3261d33bca 100644 --- a/vnet/vnet/classify/flow_classify_node.c +++ b/vnet/vnet/classify/flow_classify_node.c @@ -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) -- cgit 1.2.3-korg