X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vnet%2Fvnet%2Fl2%2Fl2_rw.c;h=b66a7d345c80c495db64fcbe39886f569b66a967;hb=refs%2Fchanges%2F75%2F1075%2F6;hp=c325ececd55c7c747d443e90c56994e9bca14681;hpb=d6f5b96e6f4e1d5022b18f0ff575dce1d19e931c;p=vpp.git diff --git a/vnet/vnet/l2/l2_rw.c b/vnet/vnet/l2/l2_rw.c index c325ececd55..b66a7d345c8 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) { @@ -331,8 +349,8 @@ int l2_rw_mod_entry(u32 *index, vec_alloc_aligned(e->value, e->rewrite_n_vectors, sizeof(u32x4)); memset(e->value, 0, e->rewrite_n_vectors * sizeof(u32x4)); - memcpy(((u8 *)e->value) + skip, value, len); - memcpy(((u8 *)e->mask) + skip, mask, len); + clib_memcpy(((u8 *)e->value) + skip, value, len); + clib_memcpy(((u8 *)e->mask) + skip, mask, len); int i; for (i = 0; i < e->rewrite_n_vectors; i++) { @@ -586,3 +604,5 @@ VLIB_REGISTER_NODE (l2_rw_node) = { .next_nodes = { [L2_RW_NEXT_DROP] = "error-drop"}, }; +VLIB_NODE_FUNCTION_MULTIARCH (l2_rw_node, l2_rw_node_fn) +