aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorPierre Pfister <ppfister@cisco.com>2016-05-13 07:47:06 +0100
committerDave Barach <openvpp@barachs.net>2016-05-16 12:12:01 +0000
commit6b70c213ee0b53ab9cbd4a9a3768b2d64f63109d (patch)
treea61afee7e5b9781e8f0aad454bb299abda63a2a8 /vnet
parent530bd8e1e68973c0b0f67e60c5520d32bb2628ad (diff)
VPP-68: L2 Rewrite: Support for chained classify tables
The classifying capabilities are pretty limited if only a single table can be used. This patch adds support for chained classify tables to L2 Rewrite feature. Change-Id: Ib678fe2028f17b441adb75d85bf3e31185e42c59 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/l2/l2_rw.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/vnet/vnet/l2/l2_rw.c b/vnet/vnet/l2/l2_rw.c
index 8c62b888fe7..93580c24457 100644
--- a/vnet/vnet/l2/l2_rw.c
+++ b/vnet/vnet/l2/l2_rw.c
@@ -197,6 +197,18 @@ l2_rw_node_fn(vlib_main_t * vm,
e0 = vnet_classify_find_entry(t0, (u8 *) h0, hash0, now);
e1 = vnet_classify_find_entry(t1, (u8 *) h1, hash1, now);
+ while (!e0 && (t0->next_table_index != ~0)) {
+ t0 = pool_elt_at_index(vcm->tables, t0->next_table_index);
+ hash0 = vnet_classify_hash_packet(t0, (u8 *)h0);
+ e0 = vnet_classify_find_entry(t0, (u8 *) h0, hash0, now);
+ }
+
+ while (!e1 && (t1->next_table_index != ~0)) {
+ t1 = pool_elt_at_index(vcm->tables, t1->next_table_index);
+ hash1 = vnet_classify_hash_packet(t1, (u8 *)h1);
+ e1 = vnet_classify_find_entry(t1, (u8 *) h1, hash1, now);
+ }
+
rwe_index0 = e0?e0->opaque_index:config0->miss_index;
rwe_index1 = e1?e1->opaque_index:config1->miss_index;
@@ -268,6 +280,12 @@ l2_rw_node_fn(vlib_main_t * vm,
hash0 = vnet_classify_hash_packet(t0, (u8 *)h0);
e0 = vnet_classify_find_entry(t0, (u8 *) h0, hash0, now);
+ while (!e0 && (t0->next_table_index != ~0)) {
+ t0 = pool_elt_at_index(vcm->tables, t0->next_table_index);
+ hash0 = vnet_classify_hash_packet(t0, (u8 *)h0);
+ e0 = vnet_classify_find_entry(t0, (u8 *) h0, hash0, now);
+ }
+
rwe_index0 = e0?e0->opaque_index:config0->miss_index;
if (rwe_index0 != ~0) {