2 * Copyright (c) 2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #include <vnet/ip/ip.h>
17 #include <vnet/dpo/lookup_dpo.h>
18 #include <vnet/dpo/load_balance.h>
19 #include <vnet/mpls/mpls.h>
20 #include <vnet/fib/fib_table.h>
21 #include <vnet/fib/ip4_fib.h>
22 #include <vnet/fib/ip6_fib.h>
23 #include <vnet/fib/mpls_fib.h>
25 static const char *const lookup_input_names[] = LOOKUP_INPUTS;
28 * @brief Enumeration of the lookup subtypes
30 typedef enum lookup_sub_type_t_
34 LOOKUP_SUB_TYPE_DST_TABLE_FROM_INTERFACE,
36 #define LOOKUP_SUB_TYPE_NUM (LOOKUP_SUB_TYPE_DST_TABLE_FROM_INTERFACE+1)
38 #define FOR_EACH_LOOKUP_SUB_TYPE(_st) \
39 for (_st = LOOKUP_SUB_TYPE_IP4_SRC; _st < LOOKUP_SUB_TYPE_NUM; _st++)
42 * @brief pool of all MPLS Label DPOs
44 lookup_dpo_t *lookup_dpo_pool;
47 * @brief An array of registered DPO type values for the sub-types
49 static dpo_type_t lookup_dpo_sub_types[LOOKUP_SUB_TYPE_NUM];
52 lookup_dpo_alloc (void)
56 pool_get_aligned(lookup_dpo_pool, lkd, CLIB_CACHE_LINE_BYTES);
62 lookup_dpo_get_index (lookup_dpo_t *lkd)
64 return (lkd - lookup_dpo_pool);
68 lookup_dpo_add_or_lock_i (fib_node_index_t fib_index,
71 lookup_table_t table_config,
77 lkd = lookup_dpo_alloc();
78 lkd->lkd_fib_index = fib_index;
79 lkd->lkd_proto = proto;
80 lkd->lkd_input = input;
81 lkd->lkd_table = table_config;
84 * use the input type to select the lookup sub-type
90 case LOOKUP_INPUT_SRC_ADDR:
91 type = lookup_dpo_sub_types[LOOKUP_SUB_TYPE_SRC];
93 case LOOKUP_INPUT_DST_ADDR:
96 case LOOKUP_TABLE_FROM_INPUT_INTERFACE:
97 type = lookup_dpo_sub_types[LOOKUP_SUB_TYPE_DST_TABLE_FROM_INTERFACE];
99 case LOOKUP_TABLE_FROM_CONFIG:
100 type = lookup_dpo_sub_types[LOOKUP_SUB_TYPE_DST];
111 dpo_set(dpo, type, proto, lookup_dpo_get_index(lkd));
116 lookup_dpo_add_or_lock_w_fib_index (fib_node_index_t fib_index,
118 lookup_input_t input,
119 lookup_table_t table_config,
122 if (LOOKUP_TABLE_FROM_CONFIG == table_config)
124 fib_table_lock(fib_index, dpo_proto_to_fib(proto));
126 lookup_dpo_add_or_lock_i(fib_index, proto, input, table_config, dpo);
130 lookup_dpo_add_or_lock_w_table_id (u32 table_id,
132 lookup_input_t input,
133 lookup_table_t table_config,
136 fib_node_index_t fib_index = FIB_NODE_INDEX_INVALID;
138 if (LOOKUP_TABLE_FROM_CONFIG == table_config)
141 fib_table_find_or_create_and_lock(dpo_proto_to_fib(proto),
145 ASSERT(FIB_NODE_INDEX_INVALID != fib_index);
146 lookup_dpo_add_or_lock_i(fib_index, proto, input, table_config, dpo);
150 format_lookup_dpo (u8 *s, va_list *args)
152 index_t index = va_arg (*args, index_t);
155 lkd = lookup_dpo_get(index);
157 if (LOOKUP_TABLE_FROM_INPUT_INTERFACE == lkd->lkd_table)
159 s = format(s, "%s lookup in interface's %U table",
160 lookup_input_names[lkd->lkd_input],
161 format_dpo_proto, lkd->lkd_proto);
165 s = format(s, "%s lookup in %U",
166 lookup_input_names[lkd->lkd_input],
167 format_fib_table_name, lkd->lkd_fib_index,
168 dpo_proto_to_fib(lkd->lkd_proto));
174 lookup_dpo_lock (dpo_id_t *dpo)
178 lkd = lookup_dpo_get(dpo->dpoi_index);
184 lookup_dpo_unlock (dpo_id_t *dpo)
188 lkd = lookup_dpo_get(dpo->dpoi_index);
192 if (0 == lkd->lkd_locks)
194 if (LOOKUP_TABLE_FROM_CONFIG == lkd->lkd_table)
196 fib_table_unlock(lkd->lkd_fib_index,
197 dpo_proto_to_fib(lkd->lkd_proto));
199 pool_put(lookup_dpo_pool, lkd);
204 ip4_src_fib_lookup_one (u32 src_fib_index0,
205 const ip4_address_t * addr0,
206 u32 * src_adj_index0)
208 ip4_fib_mtrie_leaf_t leaf0, leaf1;
209 ip4_fib_mtrie_t * mtrie0;
211 mtrie0 = &ip4_fib_get (src_fib_index0)->mtrie;
213 leaf0 = leaf1 = IP4_FIB_MTRIE_LEAF_ROOT;
214 leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, addr0, 0);
215 leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, addr0, 1);
216 leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, addr0, 2);
217 leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, addr0, 3);
219 /* Handle default route. */
220 leaf0 = (leaf0 == IP4_FIB_MTRIE_LEAF_EMPTY ? mtrie0->default_leaf : leaf0);
221 src_adj_index0[0] = ip4_fib_mtrie_leaf_get_adj_index (leaf0);
225 ip4_src_fib_lookup_two (u32 src_fib_index0,
227 const ip4_address_t * addr0,
228 const ip4_address_t * addr1,
229 u32 * src_adj_index0,
230 u32 * src_adj_index1)
232 ip4_fib_mtrie_leaf_t leaf0, leaf1;
233 ip4_fib_mtrie_t * mtrie0, * mtrie1;
235 mtrie0 = &ip4_fib_get (src_fib_index0)->mtrie;
236 mtrie1 = &ip4_fib_get (src_fib_index1)->mtrie;
238 leaf0 = leaf1 = IP4_FIB_MTRIE_LEAF_ROOT;
240 leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, addr0, 0);
241 leaf1 = ip4_fib_mtrie_lookup_step (mtrie1, leaf1, addr1, 0);
243 leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, addr0, 1);
244 leaf1 = ip4_fib_mtrie_lookup_step (mtrie1, leaf1, addr1, 1);
246 leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, addr0, 2);
247 leaf1 = ip4_fib_mtrie_lookup_step (mtrie1, leaf1, addr1, 2);
249 leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, addr0, 3);
250 leaf1 = ip4_fib_mtrie_lookup_step (mtrie1, leaf1, addr1, 3);
252 /* Handle default route. */
253 leaf0 = (leaf0 == IP4_FIB_MTRIE_LEAF_EMPTY ? mtrie0->default_leaf : leaf0);
254 leaf1 = (leaf1 == IP4_FIB_MTRIE_LEAF_EMPTY ? mtrie1->default_leaf : leaf1);
255 src_adj_index0[0] = ip4_fib_mtrie_leaf_get_adj_index (leaf0);
256 src_adj_index1[0] = ip4_fib_mtrie_leaf_get_adj_index (leaf1);
260 * @brief Lookup trace data
262 typedef struct lookup_trace_t_
266 mpls_unicast_header_t hdr;
268 fib_node_index_t fib_index;
274 lookup_dpo_ip4_inline (vlib_main_t * vm,
275 vlib_node_runtime_t * node,
276 vlib_frame_t * from_frame,
278 int table_from_interface)
280 u32 n_left_from, next_index, * from, * to_next;
281 u32 cpu_index = os_get_cpu_number();
282 vlib_combined_counter_main_t * cm = &load_balance_main.lbm_to_counters;
284 from = vlib_frame_vector_args (from_frame);
285 n_left_from = from_frame->n_vectors;
287 next_index = node->cached_next_index;
289 while (n_left_from > 0)
293 vlib_get_next_frame(vm, node, next_index, to_next, n_left_to_next);
295 /* while (n_left_from >= 4 && n_left_to_next >= 2) */
298 while (n_left_from > 0 && n_left_to_next > 0)
300 u32 bi0, lkdi0, lbi0, fib_index0, next0;
301 const ip4_address_t *input_addr;
302 const load_balance_t *lb0;
303 const lookup_dpo_t * lkd0;
304 const ip4_header_t * ip0;
305 const dpo_id_t *dpo0;
315 b0 = vlib_get_buffer (vm, bi0);
316 ip0 = vlib_buffer_get_current (b0);
318 /* dst lookup was done by ip4 lookup */
319 lkdi0 = vnet_buffer(b0)->ip.adj_index[VLIB_TX];
320 lkd0 = lookup_dpo_get(lkdi0);
323 * choose between a lookup using the fib index in the DPO
324 * or getting the FIB index from the interface.
326 if (table_from_interface)
329 ip4_fib_table_get_index_for_sw_if_index(
330 vnet_buffer(b0)->sw_if_index[VLIB_RX]);
334 fib_index0 = lkd0->lkd_fib_index;
338 * choose between a source or destination address lookup in the table
342 input_addr = &ip0->src_address;
346 input_addr = &ip0->dst_address;
350 ip4_src_fib_lookup_one (fib_index0, input_addr, &lbi0);
351 lb0 = load_balance_get(lbi0);
352 dpo0 = load_balance_get_bucket_i(lb0, 0);
354 next0 = dpo0->dpoi_next_node;
355 vnet_buffer(b0)->ip.adj_index[VLIB_TX] = dpo0->dpoi_index;
357 vlib_increment_combined_counter
358 (cm, cpu_index, lbi0, 1,
359 vlib_buffer_length_in_chain (vm, b0));
361 if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
363 lookup_trace_t *tr = vlib_add_trace (vm, node,
365 tr->fib_index = fib_index0;
367 tr->addr.ip4 = *input_addr;
370 vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next,
371 n_left_to_next, bi0, next0);
373 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
375 return from_frame->n_vectors;
379 format_lookup_trace (u8 * s, va_list * args)
381 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
382 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
383 lookup_trace_t * t = va_arg (*args, lookup_trace_t *);
384 uword indent = format_get_indent (s);
385 s = format (s, "%U fib-index:%d addr:%U load-balance:%d",
386 format_white_space, indent,
388 format_ip46_address, &t->addr, IP46_TYPE_ANY,
394 lookup_ip4_dst (vlib_main_t * vm,
395 vlib_node_runtime_t * node,
396 vlib_frame_t * from_frame)
398 return (lookup_dpo_ip4_inline(vm, node, from_frame, 0, 0));
401 VLIB_REGISTER_NODE (lookup_ip4_dst_node) = {
402 .function = lookup_ip4_dst,
403 .name = "lookup-ip4-dst",
404 .vector_size = sizeof (u32),
405 .sibling_of = "ip4-lookup",
406 .format_trace = format_lookup_trace,
408 VLIB_NODE_FUNCTION_MULTIARCH (lookup_ip4_dst_node, lookup_ip4_dst)
411 lookup_ip4_dst_itf (vlib_main_t * vm,
412 vlib_node_runtime_t * node,
413 vlib_frame_t * from_frame)
415 return (lookup_dpo_ip4_inline(vm, node, from_frame, 0, 1));
418 VLIB_REGISTER_NODE (lookup_ip4_dst_itf_node) = {
419 .function = lookup_ip4_dst_itf,
420 .name = "lookup-ip4-dst-itf",
421 .vector_size = sizeof (u32),
422 .sibling_of = "ip4-lookup",
423 .format_trace = format_lookup_trace,
425 VLIB_NODE_FUNCTION_MULTIARCH (lookup_ip4_dst_itf_node, lookup_ip4_dst_itf)
428 lookup_ip4_src (vlib_main_t * vm,
429 vlib_node_runtime_t * node,
430 vlib_frame_t * from_frame)
432 return (lookup_dpo_ip4_inline(vm, node, from_frame, 1, 0));
435 VLIB_REGISTER_NODE (lookup_ip4_src_node) = {
436 .function = lookup_ip4_src,
437 .name = "lookup-ip4-src",
438 .vector_size = sizeof (u32),
439 .format_trace = format_lookup_trace,
440 .sibling_of = "ip4-lookup",
442 VLIB_NODE_FUNCTION_MULTIARCH (lookup_ip4_src_node, lookup_ip4_src)
445 lookup_dpo_ip6_inline (vlib_main_t * vm,
446 vlib_node_runtime_t * node,
447 vlib_frame_t * from_frame,
450 vlib_combined_counter_main_t * cm = &load_balance_main.lbm_to_counters;
451 u32 n_left_from, next_index, * from, * to_next;
452 u32 cpu_index = os_get_cpu_number();
454 from = vlib_frame_vector_args (from_frame);
455 n_left_from = from_frame->n_vectors;
457 next_index = node->cached_next_index;
459 while (n_left_from > 0)
463 vlib_get_next_frame(vm, node, next_index, to_next, n_left_to_next);
465 /* while (n_left_from >= 4 && n_left_to_next >= 2) */
469 while (n_left_from > 0 && n_left_to_next > 0)
471 u32 bi0, lkdi0, lbi0, fib_index0, next0;
472 const ip6_address_t *input_addr0;
473 const load_balance_t *lb0;
474 const lookup_dpo_t * lkd0;
475 const ip6_header_t * ip0;
476 const dpo_id_t *dpo0;
486 b0 = vlib_get_buffer (vm, bi0);
487 ip0 = vlib_buffer_get_current (b0);
489 /* dst lookup was done by ip6 lookup */
490 lkdi0 = vnet_buffer(b0)->ip.adj_index[VLIB_TX];
491 lkd0 = lookup_dpo_get(lkdi0);
492 fib_index0 = lkd0->lkd_fib_index;
495 * choose between a source or destination address lookup in the table
499 input_addr0 = &ip0->src_address;
503 input_addr0 = &ip0->dst_address;
507 lbi0 = ip6_fib_table_fwding_lookup(&ip6_main,
510 lb0 = load_balance_get(lbi0);
511 dpo0 = load_balance_get_bucket_i(lb0, 0);
513 next0 = dpo0->dpoi_next_node;
514 vnet_buffer(b0)->ip.adj_index[VLIB_TX] = dpo0->dpoi_index;
516 vlib_increment_combined_counter
517 (cm, cpu_index, lbi0, 1,
518 vlib_buffer_length_in_chain (vm, b0));
520 if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
522 lookup_trace_t *tr = vlib_add_trace (vm, node,
524 tr->fib_index = fib_index0;
526 tr->addr.ip6 = *input_addr0;
528 vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next,
529 n_left_to_next, bi0, next0);
531 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
533 return from_frame->n_vectors;
537 lookup_ip6_dst (vlib_main_t * vm,
538 vlib_node_runtime_t * node,
539 vlib_frame_t * from_frame)
541 return (lookup_dpo_ip6_inline(vm, node, from_frame, 0 /*use src*/));
544 VLIB_REGISTER_NODE (lookup_ip6_dst_node) = {
545 .function = lookup_ip6_dst,
546 .name = "lookup-ip6-dst",
547 .vector_size = sizeof (u32),
548 .format_trace = format_lookup_trace,
549 .sibling_of = "ip6-lookup",
551 VLIB_NODE_FUNCTION_MULTIARCH (lookup_ip6_dst_node, lookup_ip6_dst)
554 lookup_ip6_src (vlib_main_t * vm,
555 vlib_node_runtime_t * node,
556 vlib_frame_t * from_frame)
558 return (lookup_dpo_ip6_inline(vm, node, from_frame, 1 /*use src*/));
561 VLIB_REGISTER_NODE (lookup_ip6_src_node) = {
562 .function = lookup_ip6_src,
563 .name = "lookup-ip6-src",
564 .vector_size = sizeof (u32),
565 .format_trace = format_lookup_trace,
566 .sibling_of = "ip6-lookup",
568 VLIB_NODE_FUNCTION_MULTIARCH (lookup_ip6_src_node, lookup_ip6_src)
571 lookup_dpo_mpls_inline (vlib_main_t * vm,
572 vlib_node_runtime_t * node,
573 vlib_frame_t * from_frame,
574 int table_from_interface)
576 u32 n_left_from, next_index, * from, * to_next;
577 u32 cpu_index = os_get_cpu_number();
578 vlib_combined_counter_main_t * cm = &load_balance_main.lbm_to_counters;
580 from = vlib_frame_vector_args (from_frame);
581 n_left_from = from_frame->n_vectors;
583 next_index = node->cached_next_index;
585 while (n_left_from > 0)
589 vlib_get_next_frame(vm, node, next_index, to_next, n_left_to_next);
591 /* while (n_left_from >= 4 && n_left_to_next >= 2) */
594 while (n_left_from > 0 && n_left_to_next > 0)
596 u32 bi0, lkdi0, lbi0, fib_index0, next0;
597 const mpls_unicast_header_t * hdr0;
598 const load_balance_t *lb0;
599 const lookup_dpo_t * lkd0;
600 const dpo_id_t *dpo0;
610 b0 = vlib_get_buffer (vm, bi0);
611 hdr0 = vlib_buffer_get_current (b0);
613 /* dst lookup was done by mpls lookup */
614 lkdi0 = vnet_buffer(b0)->ip.adj_index[VLIB_TX];
615 lkd0 = lookup_dpo_get(lkdi0);
618 * choose between a lookup using the fib index in the DPO
619 * or getting the FIB index from the interface.
621 if (table_from_interface)
624 mpls_fib_table_get_index_for_sw_if_index(
625 vnet_buffer(b0)->sw_if_index[VLIB_RX]);
629 fib_index0 = lkd0->lkd_fib_index;
633 lbi0 = mpls_fib_table_forwarding_lookup (fib_index0, hdr0);
634 lb0 = load_balance_get(lbi0);
635 dpo0 = load_balance_get_bucket_i(lb0, 0);
637 next0 = dpo0->dpoi_next_node;
638 vnet_buffer(b0)->ip.adj_index[VLIB_TX] = dpo0->dpoi_index;
640 vlib_increment_combined_counter
641 (cm, cpu_index, lbi0, 1,
642 vlib_buffer_length_in_chain (vm, b0));
644 if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
646 lookup_trace_t *tr = vlib_add_trace (vm, node,
648 tr->fib_index = fib_index0;
653 vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next,
654 n_left_to_next, bi0, next0);
656 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
658 return from_frame->n_vectors;
662 format_lookup_mpls_trace (u8 * s, va_list * args)
664 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
665 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
666 lookup_trace_t * t = va_arg (*args, lookup_trace_t *);
667 uword indent = format_get_indent (s);
668 mpls_unicast_header_t hdr;
670 hdr.label_exp_s_ttl = clib_net_to_host_u32(t->hdr.label_exp_s_ttl);
672 s = format (s, "%U fib-index:%d hdr:%U load-balance:%d",
673 format_white_space, indent,
675 format_mpls_header, hdr,
681 lookup_mpls_dst (vlib_main_t * vm,
682 vlib_node_runtime_t * node,
683 vlib_frame_t * from_frame)
685 return (lookup_dpo_mpls_inline(vm, node, from_frame, 0));
688 VLIB_REGISTER_NODE (lookup_mpls_dst_node) = {
689 .function = lookup_mpls_dst,
690 .name = "lookup-mpls-dst",
691 .vector_size = sizeof (u32),
692 .sibling_of = "mpls-lookup",
693 .format_trace = format_lookup_mpls_trace,
696 VLIB_NODE_FUNCTION_MULTIARCH (lookup_mpls_dst_node, lookup_mpls_dst)
699 lookup_mpls_dst_itf (vlib_main_t * vm,
700 vlib_node_runtime_t * node,
701 vlib_frame_t * from_frame)
703 return (lookup_dpo_mpls_inline(vm, node, from_frame, 1));
706 VLIB_REGISTER_NODE (lookup_mpls_dst_itf_node) = {
707 .function = lookup_mpls_dst_itf,
708 .name = "lookup-mpls-dst-itf",
709 .vector_size = sizeof (u32),
710 .sibling_of = "mpls-lookup",
711 .format_trace = format_lookup_mpls_trace,
714 VLIB_NODE_FUNCTION_MULTIARCH (lookup_mpls_dst_itf_node, lookup_mpls_dst_itf)
716 const static dpo_vft_t lkd_vft = {
717 .dv_lock = lookup_dpo_lock,
718 .dv_unlock = lookup_dpo_unlock,
719 .dv_format = format_lookup_dpo,
722 const static char* const lookup_src_ip4_nodes[] =
727 const static char* const lookup_src_ip6_nodes[] =
732 const static char* const * const lookup_src_nodes[DPO_PROTO_NUM] =
734 [DPO_PROTO_IP4] = lookup_src_ip4_nodes,
735 [DPO_PROTO_IP6] = lookup_src_ip6_nodes,
736 [DPO_PROTO_MPLS] = NULL,
739 const static char* const lookup_dst_ip4_nodes[] =
744 const static char* const lookup_dst_ip6_nodes[] =
749 const static char* const lookup_dst_mpls_nodes[] =
754 const static char* const * const lookup_dst_nodes[DPO_PROTO_NUM] =
756 [DPO_PROTO_IP4] = lookup_dst_ip4_nodes,
757 [DPO_PROTO_IP6] = lookup_dst_ip6_nodes,
758 [DPO_PROTO_MPLS] = lookup_dst_mpls_nodes,
761 const static char* const lookup_dst_from_interface_ip4_nodes[] =
763 "lookup-ip4-dst-itf",
766 const static char* const lookup_dst_from_interface_ip6_nodes[] =
768 "lookup-ip6-dst-itf",
771 const static char* const lookup_dst_from_interface_mpls_nodes[] =
773 "lookup-mpls-dst-itf",
776 const static char* const * const lookup_dst_from_interface_nodes[DPO_PROTO_NUM] =
778 [DPO_PROTO_IP4] = lookup_dst_from_interface_ip4_nodes,
779 [DPO_PROTO_IP6] = lookup_dst_from_interface_ip6_nodes,
780 [DPO_PROTO_MPLS] = lookup_dst_from_interface_mpls_nodes,
785 lookup_dpo_module_init (void)
787 dpo_register(DPO_LOOKUP, &lkd_vft, NULL);
790 * There are various sorts of lookup; src or dst addr v4 /v6 etc.
791 * there isn't an object type for each (there is only the lookup_dpo_t),
792 * but, for performance reasons, there is a data plane function, and hence
793 * VLIB node for each. VLIB graph node construction is based on DPO types
794 * so we create sub-types.
796 lookup_dpo_sub_types[LOOKUP_SUB_TYPE_SRC] =
797 dpo_register_new_type(&lkd_vft, lookup_src_nodes);
798 lookup_dpo_sub_types[LOOKUP_SUB_TYPE_DST] =
799 dpo_register_new_type(&lkd_vft, lookup_dst_nodes);
800 lookup_dpo_sub_types[LOOKUP_SUB_TYPE_DST_TABLE_FROM_INTERFACE] =
801 dpo_register_new_type(&lkd_vft, lookup_dst_nodes);