4 * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 #include <sys/types.h>
40 #include <sys/queue.h>
46 #include <rte_debug.h>
47 #include <rte_ether.h>
48 #include <rte_ethdev.h>
50 #include <rte_mempool.h>
51 #include <rte_cycles.h>
60 #ifdef RTE_MACHINE_CPUFLAG_SSE4_2
61 #include <rte_hash_crc.h>
62 #define DEFAULT_HASH_FUNC rte_hash_crc
64 #include <rte_jhash.h>
65 #define DEFAULT_HASH_FUNC rte_jhash
66 #endif /* RTE_MACHINE_CPUFLAG_SSE4_2 */
68 #define IPV6_ADDR_LEN 16
76 } __attribute__((__packed__));
78 union ipv4_5tuple_host {
91 #define XMM_NUM_IN_IPV6_5TUPLE 3
94 uint8_t ip_dst[IPV6_ADDR_LEN];
95 uint8_t ip_src[IPV6_ADDR_LEN];
99 } __attribute__((__packed__));
101 union ipv6_5tuple_host {
106 uint8_t ip_src[IPV6_ADDR_LEN];
107 uint8_t ip_dst[IPV6_ADDR_LEN];
112 xmm_t xmm[XMM_NUM_IN_IPV6_5TUPLE];
117 struct ipv4_l3fwd_em_route {
118 struct ipv4_5tuple key;
122 struct ipv6_l3fwd_em_route {
123 struct ipv6_5tuple key;
127 static struct ipv4_l3fwd_em_route ipv4_l3fwd_em_route_array[] = {
128 {{IPv4(101, 0, 0, 0), IPv4(100, 10, 0, 1), 101, 11, IPPROTO_TCP}, 0},
129 {{IPv4(201, 0, 0, 0), IPv4(200, 20, 0, 1), 102, 12, IPPROTO_TCP}, 1},
130 {{IPv4(111, 0, 0, 0), IPv4(100, 30, 0, 1), 101, 11, IPPROTO_TCP}, 2},
131 {{IPv4(211, 0, 0, 0), IPv4(200, 40, 0, 1), 102, 12, IPPROTO_TCP}, 3},
134 static struct ipv6_l3fwd_em_route ipv6_l3fwd_em_route_array[] = {
136 {0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0x02, 0x1e, 0x67, 0xff, 0xfe, 0, 0, 0},
137 {0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0x02, 0x1b, 0x21, 0xff, 0xfe, 0x91, 0x38, 0x05},
138 101, 11, IPPROTO_TCP}, 0},
141 {0xfe, 0x90, 0, 0, 0, 0, 0, 0, 0x02, 0x1e, 0x67, 0xff, 0xfe, 0, 0, 0},
142 {0xfe, 0x90, 0, 0, 0, 0, 0, 0, 0x02, 0x1b, 0x21, 0xff, 0xfe, 0x91, 0x38, 0x05},
143 102, 12, IPPROTO_TCP}, 1},
146 {0xfe, 0xa0, 0, 0, 0, 0, 0, 0, 0x02, 0x1e, 0x67, 0xff, 0xfe, 0, 0, 0},
147 {0xfe, 0xa0, 0, 0, 0, 0, 0, 0, 0x02, 0x1b, 0x21, 0xff, 0xfe, 0x91, 0x38, 0x05},
148 101, 11, IPPROTO_TCP}, 2},
151 {0xfe, 0xb0, 0, 0, 0, 0, 0, 0, 0x02, 0x1e, 0x67, 0xff, 0xfe, 0, 0, 0},
152 {0xfe, 0xb0, 0, 0, 0, 0, 0, 0, 0x02, 0x1b, 0x21, 0xff, 0xfe, 0x91, 0x38, 0x05},
153 102, 12, IPPROTO_TCP}, 3},
156 struct rte_hash *ipv4_l3fwd_em_lookup_struct[NB_SOCKETS];
157 struct rte_hash *ipv6_l3fwd_em_lookup_struct[NB_SOCKETS];
159 static inline uint32_t
160 ipv4_hash_crc(const void *data, __rte_unused uint32_t data_len,
163 const union ipv4_5tuple_host *k;
169 p = (const uint32_t *)&k->port_src;
171 #ifdef RTE_MACHINE_CPUFLAG_SSE4_2
172 init_val = rte_hash_crc_4byte(t, init_val);
173 init_val = rte_hash_crc_4byte(k->ip_src, init_val);
174 init_val = rte_hash_crc_4byte(k->ip_dst, init_val);
175 init_val = rte_hash_crc_4byte(*p, init_val);
176 #else /* RTE_MACHINE_CPUFLAG_SSE4_2 */
177 init_val = rte_jhash_1word(t, init_val);
178 init_val = rte_jhash_1word(k->ip_src, init_val);
179 init_val = rte_jhash_1word(k->ip_dst, init_val);
180 init_val = rte_jhash_1word(*p, init_val);
181 #endif /* RTE_MACHINE_CPUFLAG_SSE4_2 */
186 static inline uint32_t
187 ipv6_hash_crc(const void *data, __rte_unused uint32_t data_len,
190 const union ipv6_5tuple_host *k;
193 #ifdef RTE_MACHINE_CPUFLAG_SSE4_2
194 const uint32_t *ip_src0, *ip_src1, *ip_src2, *ip_src3;
195 const uint32_t *ip_dst0, *ip_dst1, *ip_dst2, *ip_dst3;
196 #endif /* RTE_MACHINE_CPUFLAG_SSE4_2 */
200 p = (const uint32_t *)&k->port_src;
202 #ifdef RTE_MACHINE_CPUFLAG_SSE4_2
203 ip_src0 = (const uint32_t *) k->ip_src;
204 ip_src1 = (const uint32_t *)(k->ip_src+4);
205 ip_src2 = (const uint32_t *)(k->ip_src+8);
206 ip_src3 = (const uint32_t *)(k->ip_src+12);
207 ip_dst0 = (const uint32_t *) k->ip_dst;
208 ip_dst1 = (const uint32_t *)(k->ip_dst+4);
209 ip_dst2 = (const uint32_t *)(k->ip_dst+8);
210 ip_dst3 = (const uint32_t *)(k->ip_dst+12);
211 init_val = rte_hash_crc_4byte(t, init_val);
212 init_val = rte_hash_crc_4byte(*ip_src0, init_val);
213 init_val = rte_hash_crc_4byte(*ip_src1, init_val);
214 init_val = rte_hash_crc_4byte(*ip_src2, init_val);
215 init_val = rte_hash_crc_4byte(*ip_src3, init_val);
216 init_val = rte_hash_crc_4byte(*ip_dst0, init_val);
217 init_val = rte_hash_crc_4byte(*ip_dst1, init_val);
218 init_val = rte_hash_crc_4byte(*ip_dst2, init_val);
219 init_val = rte_hash_crc_4byte(*ip_dst3, init_val);
220 init_val = rte_hash_crc_4byte(*p, init_val);
221 #else /* RTE_MACHINE_CPUFLAG_SSE4_2 */
222 init_val = rte_jhash_1word(t, init_val);
223 init_val = rte_jhash(k->ip_src,
224 sizeof(uint8_t) * IPV6_ADDR_LEN, init_val);
225 init_val = rte_jhash(k->ip_dst,
226 sizeof(uint8_t) * IPV6_ADDR_LEN, init_val);
227 init_val = rte_jhash_1word(*p, init_val);
228 #endif /* RTE_MACHINE_CPUFLAG_SSE4_2 */
232 #define IPV4_L3FWD_EM_NUM_ROUTES \
233 (sizeof(ipv4_l3fwd_em_route_array) / sizeof(ipv4_l3fwd_em_route_array[0]))
235 #define IPV6_L3FWD_EM_NUM_ROUTES \
236 (sizeof(ipv6_l3fwd_em_route_array) / sizeof(ipv6_l3fwd_em_route_array[0]))
238 static uint8_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned;
239 static uint8_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned;
241 static rte_xmm_t mask0;
242 static rte_xmm_t mask1;
243 static rte_xmm_t mask2;
245 #if defined(__SSE2__)
247 em_mask_key(void *key, xmm_t mask)
249 __m128i data = _mm_loadu_si128((__m128i *)(key));
251 return _mm_and_si128(data, mask);
253 #elif defined(RTE_MACHINE_CPUFLAG_NEON)
255 em_mask_key(void *key, xmm_t mask)
257 int32x4_t data = vld1q_s32((int32_t *)key);
259 return vandq_s32(data, mask);
263 static inline uint8_t
264 em_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct)
267 union ipv4_5tuple_host key;
268 struct rte_hash *ipv4_l3fwd_lookup_struct =
269 (struct rte_hash *)lookup_struct;
271 ipv4_hdr = (uint8_t *)ipv4_hdr + offsetof(struct ipv4_hdr, time_to_live);
274 * Get 5 tuple: dst port, src port, dst IP address,
275 * src IP address and protocol.
277 key.xmm = em_mask_key(ipv4_hdr, mask0.x);
279 /* Find destination port */
280 ret = rte_hash_lookup(ipv4_l3fwd_lookup_struct, (const void *)&key);
281 return (uint8_t)((ret < 0) ? portid : ipv4_l3fwd_out_if[ret]);
284 static inline uint8_t
285 em_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct)
288 union ipv6_5tuple_host key;
289 struct rte_hash *ipv6_l3fwd_lookup_struct =
290 (struct rte_hash *)lookup_struct;
292 ipv6_hdr = (uint8_t *)ipv6_hdr + offsetof(struct ipv6_hdr, payload_len);
293 void *data0 = ipv6_hdr;
294 void *data1 = ((uint8_t *)ipv6_hdr) + sizeof(xmm_t);
295 void *data2 = ((uint8_t *)ipv6_hdr) + sizeof(xmm_t) + sizeof(xmm_t);
297 /* Get part of 5 tuple: src IP address lower 96 bits and protocol */
298 key.xmm[0] = em_mask_key(data0, mask1.x);
301 * Get part of 5 tuple: dst IP address lower 96 bits
302 * and src IP address higher 32 bits.
304 key.xmm[1] = *(xmm_t *)data1;
307 * Get part of 5 tuple: dst port and src port
308 * and dst IP address higher 32 bits.
310 key.xmm[2] = em_mask_key(data2, mask2.x);
312 /* Find destination port */
313 ret = rte_hash_lookup(ipv6_l3fwd_lookup_struct, (const void *)&key);
314 return (uint8_t)((ret < 0) ? portid : ipv6_l3fwd_out_if[ret]);
317 #if defined(__SSE4_1__)
318 #if defined(NO_HASH_MULTI_LOOKUP)
319 #include "l3fwd_em_sse.h"
321 #include "l3fwd_em_hlm_sse.h"
324 #include "l3fwd_em.h"
328 convert_ipv4_5tuple(struct ipv4_5tuple *key1,
329 union ipv4_5tuple_host *key2)
331 key2->ip_dst = rte_cpu_to_be_32(key1->ip_dst);
332 key2->ip_src = rte_cpu_to_be_32(key1->ip_src);
333 key2->port_dst = rte_cpu_to_be_16(key1->port_dst);
334 key2->port_src = rte_cpu_to_be_16(key1->port_src);
335 key2->proto = key1->proto;
341 convert_ipv6_5tuple(struct ipv6_5tuple *key1,
342 union ipv6_5tuple_host *key2)
346 for (i = 0; i < 16; i++) {
347 key2->ip_dst[i] = key1->ip_dst[i];
348 key2->ip_src[i] = key1->ip_src[i];
350 key2->port_dst = rte_cpu_to_be_16(key1->port_dst);
351 key2->port_src = rte_cpu_to_be_16(key1->port_src);
352 key2->proto = key1->proto;
358 #define BYTE_VALUE_MAX 256
359 #define ALL_32_BITS 0xffffffff
360 #define BIT_8_TO_15 0x0000ff00
363 populate_ipv4_few_flow_into_table(const struct rte_hash *h)
368 mask0 = (rte_xmm_t){.u32 = {BIT_8_TO_15, ALL_32_BITS,
369 ALL_32_BITS, ALL_32_BITS} };
371 for (i = 0; i < IPV4_L3FWD_EM_NUM_ROUTES; i++) {
372 struct ipv4_l3fwd_em_route entry;
373 union ipv4_5tuple_host newkey;
375 entry = ipv4_l3fwd_em_route_array[i];
376 convert_ipv4_5tuple(&entry.key, &newkey);
377 ret = rte_hash_add_key(h, (void *) &newkey);
379 rte_exit(EXIT_FAILURE, "Unable to add entry %" PRIu32
380 " to the l3fwd hash.\n", i);
382 ipv4_l3fwd_out_if[ret] = entry.if_out;
384 printf("Hash: Adding 0x%" PRIx64 " keys\n",
385 (uint64_t)IPV4_L3FWD_EM_NUM_ROUTES);
388 #define BIT_16_TO_23 0x00ff0000
390 populate_ipv6_few_flow_into_table(const struct rte_hash *h)
395 mask1 = (rte_xmm_t){.u32 = {BIT_16_TO_23, ALL_32_BITS,
396 ALL_32_BITS, ALL_32_BITS} };
398 mask2 = (rte_xmm_t){.u32 = {ALL_32_BITS, ALL_32_BITS, 0, 0} };
400 for (i = 0; i < IPV6_L3FWD_EM_NUM_ROUTES; i++) {
401 struct ipv6_l3fwd_em_route entry;
402 union ipv6_5tuple_host newkey;
404 entry = ipv6_l3fwd_em_route_array[i];
405 convert_ipv6_5tuple(&entry.key, &newkey);
406 ret = rte_hash_add_key(h, (void *) &newkey);
408 rte_exit(EXIT_FAILURE, "Unable to add entry %" PRIu32
409 " to the l3fwd hash.\n", i);
411 ipv6_l3fwd_out_if[ret] = entry.if_out;
413 printf("Hash: Adding 0x%" PRIx64 "keys\n",
414 (uint64_t)IPV6_L3FWD_EM_NUM_ROUTES);
417 #define NUMBER_PORT_USED 4
419 populate_ipv4_many_flow_into_table(const struct rte_hash *h,
420 unsigned int nr_flow)
424 mask0 = (rte_xmm_t){.u32 = {BIT_8_TO_15, ALL_32_BITS,
425 ALL_32_BITS, ALL_32_BITS} };
427 for (i = 0; i < nr_flow; i++) {
428 struct ipv4_l3fwd_em_route entry;
429 union ipv4_5tuple_host newkey;
431 uint8_t a = (uint8_t)
432 ((i/NUMBER_PORT_USED)%BYTE_VALUE_MAX);
433 uint8_t b = (uint8_t)
434 (((i/NUMBER_PORT_USED)/BYTE_VALUE_MAX)%BYTE_VALUE_MAX);
435 uint8_t c = (uint8_t)
436 ((i/NUMBER_PORT_USED)/(BYTE_VALUE_MAX*BYTE_VALUE_MAX));
438 /* Create the ipv4 exact match flow */
439 memset(&entry, 0, sizeof(entry));
440 switch (i & (NUMBER_PORT_USED - 1)) {
442 entry = ipv4_l3fwd_em_route_array[0];
443 entry.key.ip_dst = IPv4(101, c, b, a);
446 entry = ipv4_l3fwd_em_route_array[1];
447 entry.key.ip_dst = IPv4(201, c, b, a);
450 entry = ipv4_l3fwd_em_route_array[2];
451 entry.key.ip_dst = IPv4(111, c, b, a);
454 entry = ipv4_l3fwd_em_route_array[3];
455 entry.key.ip_dst = IPv4(211, c, b, a);
458 convert_ipv4_5tuple(&entry.key, &newkey);
459 int32_t ret = rte_hash_add_key(h, (void *) &newkey);
462 rte_exit(EXIT_FAILURE, "Unable to add entry %u\n", i);
464 ipv4_l3fwd_out_if[ret] = (uint8_t) entry.if_out;
467 printf("Hash: Adding 0x%x keys\n", nr_flow);
471 populate_ipv6_many_flow_into_table(const struct rte_hash *h,
472 unsigned int nr_flow)
476 mask1 = (rte_xmm_t){.u32 = {BIT_16_TO_23, ALL_32_BITS,
477 ALL_32_BITS, ALL_32_BITS} };
478 mask2 = (rte_xmm_t){.u32 = {ALL_32_BITS, ALL_32_BITS, 0, 0} };
480 for (i = 0; i < nr_flow; i++) {
481 struct ipv6_l3fwd_em_route entry;
482 union ipv6_5tuple_host newkey;
484 uint8_t a = (uint8_t)
485 ((i/NUMBER_PORT_USED)%BYTE_VALUE_MAX);
486 uint8_t b = (uint8_t)
487 (((i/NUMBER_PORT_USED)/BYTE_VALUE_MAX)%BYTE_VALUE_MAX);
488 uint8_t c = (uint8_t)
489 ((i/NUMBER_PORT_USED)/(BYTE_VALUE_MAX*BYTE_VALUE_MAX));
491 /* Create the ipv6 exact match flow */
492 memset(&entry, 0, sizeof(entry));
493 switch (i & (NUMBER_PORT_USED - 1)) {
495 entry = ipv6_l3fwd_em_route_array[0];
498 entry = ipv6_l3fwd_em_route_array[1];
501 entry = ipv6_l3fwd_em_route_array[2];
504 entry = ipv6_l3fwd_em_route_array[3];
507 entry.key.ip_dst[13] = c;
508 entry.key.ip_dst[14] = b;
509 entry.key.ip_dst[15] = a;
510 convert_ipv6_5tuple(&entry.key, &newkey);
511 int32_t ret = rte_hash_add_key(h, (void *) &newkey);
514 rte_exit(EXIT_FAILURE, "Unable to add entry %u\n", i);
516 ipv6_l3fwd_out_if[ret] = (uint8_t) entry.if_out;
519 printf("Hash: Adding 0x%x keys\n", nr_flow);
522 /* main processing loop */
524 em_main_loop(__attribute__((unused)) void *dummy)
526 struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
528 uint64_t prev_tsc, diff_tsc, cur_tsc;
530 uint8_t portid, queueid;
531 struct lcore_conf *qconf;
532 const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /
533 US_PER_S * BURST_TX_DRAIN_US;
537 lcore_id = rte_lcore_id();
538 qconf = &lcore_conf[lcore_id];
540 if (qconf->n_rx_queue == 0) {
541 RTE_LOG(INFO, L3FWD, "lcore %u has nothing to do\n", lcore_id);
545 RTE_LOG(INFO, L3FWD, "entering main loop on lcore %u\n", lcore_id);
547 for (i = 0; i < qconf->n_rx_queue; i++) {
549 portid = qconf->rx_queue_list[i].port_id;
550 queueid = qconf->rx_queue_list[i].queue_id;
552 " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n",
553 lcore_id, portid, queueid);
556 while (!force_quit) {
558 cur_tsc = rte_rdtsc();
561 * TX burst queue drain
563 diff_tsc = cur_tsc - prev_tsc;
564 if (unlikely(diff_tsc > drain_tsc)) {
566 for (i = 0; i < qconf->n_tx_port; ++i) {
567 portid = qconf->tx_port_id[i];
568 if (qconf->tx_mbufs[portid].len == 0)
571 qconf->tx_mbufs[portid].len,
573 qconf->tx_mbufs[portid].len = 0;
580 * Read packet from RX queues
582 for (i = 0; i < qconf->n_rx_queue; ++i) {
583 portid = qconf->rx_queue_list[i].port_id;
584 queueid = qconf->rx_queue_list[i].queue_id;
585 nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst,
590 #if defined(__SSE4_1__)
591 l3fwd_em_send_packets(nb_rx, pkts_burst,
594 l3fwd_em_no_opt_send_packets(nb_rx, pkts_burst,
596 #endif /* __SSE_4_1__ */
604 * Initialize exact match (hash) parameters.
607 setup_hash(const int socketid)
609 struct rte_hash_parameters ipv4_l3fwd_hash_params = {
611 .entries = L3FWD_HASH_ENTRIES,
612 .key_len = sizeof(union ipv4_5tuple_host),
613 .hash_func = ipv4_hash_crc,
614 .hash_func_init_val = 0,
617 struct rte_hash_parameters ipv6_l3fwd_hash_params = {
619 .entries = L3FWD_HASH_ENTRIES,
620 .key_len = sizeof(union ipv6_5tuple_host),
621 .hash_func = ipv6_hash_crc,
622 .hash_func_init_val = 0,
627 /* create ipv4 hash */
628 snprintf(s, sizeof(s), "ipv4_l3fwd_hash_%d", socketid);
629 ipv4_l3fwd_hash_params.name = s;
630 ipv4_l3fwd_hash_params.socket_id = socketid;
631 ipv4_l3fwd_em_lookup_struct[socketid] =
632 rte_hash_create(&ipv4_l3fwd_hash_params);
633 if (ipv4_l3fwd_em_lookup_struct[socketid] == NULL)
634 rte_exit(EXIT_FAILURE,
635 "Unable to create the l3fwd hash on socket %d\n",
638 /* create ipv6 hash */
639 snprintf(s, sizeof(s), "ipv6_l3fwd_hash_%d", socketid);
640 ipv6_l3fwd_hash_params.name = s;
641 ipv6_l3fwd_hash_params.socket_id = socketid;
642 ipv6_l3fwd_em_lookup_struct[socketid] =
643 rte_hash_create(&ipv6_l3fwd_hash_params);
644 if (ipv6_l3fwd_em_lookup_struct[socketid] == NULL)
645 rte_exit(EXIT_FAILURE,
646 "Unable to create the l3fwd hash on socket %d\n",
649 if (hash_entry_number != HASH_ENTRY_NUMBER_DEFAULT) {
650 /* For testing hash matching with a large number of flows we
651 * generate millions of IP 5-tuples with an incremented dst
652 * address to initialize the hash table. */
654 /* populate the ipv4 hash */
655 populate_ipv4_many_flow_into_table(
656 ipv4_l3fwd_em_lookup_struct[socketid],
659 /* populate the ipv6 hash */
660 populate_ipv6_many_flow_into_table(
661 ipv6_l3fwd_em_lookup_struct[socketid],
666 * Use data in ipv4/ipv6 l3fwd lookup table
667 * directly to initialize the hash table.
670 /* populate the ipv4 hash */
671 populate_ipv4_few_flow_into_table(
672 ipv4_l3fwd_em_lookup_struct[socketid]);
674 /* populate the ipv6 hash */
675 populate_ipv6_few_flow_into_table(
676 ipv6_l3fwd_em_lookup_struct[socketid]);
681 /* Return ipv4/ipv6 em fwd lookup struct. */
683 em_get_ipv4_l3fwd_lookup_struct(const int socketid)
685 return ipv4_l3fwd_em_lookup_struct[socketid];
689 em_get_ipv6_l3fwd_lookup_struct(const int socketid)
691 return ipv6_l3fwd_em_lookup_struct[socketid];