4 * Copyright(c) 2010-2014 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.
35 #include "test_table_combined.h"
36 #include "test_table.h"
37 #include <rte_table_lpm_ipv6.h>
39 #define MAX_TEST_KEYS 128
42 enum check_table_result {
44 CHECK_TABLE_PORT_CONFIG,
45 CHECK_TABLE_PORT_ENABLE,
46 CHECK_TABLE_TABLE_CONFIG,
47 CHECK_TABLE_ENTRY_ADD,
48 CHECK_TABLE_DEFAULT_ENTRY_ADD,
50 CHECK_TABLE_MANAGE_ERROR,
51 CHECK_TABLE_CONSISTENCY,
52 CHECK_TABLE_NO_TRAFFIC,
53 CHECK_TABLE_INVALID_PARAMETER,
56 struct table_packets {
57 uint32_t hit_packet[MAX_TEST_KEYS];
58 uint32_t miss_packet[MAX_TEST_KEYS];
59 uint32_t n_hit_packets;
60 uint32_t n_miss_packets;
63 combined_table_test table_tests_combined[] = {
64 test_table_lpm_combined,
65 test_table_lpm_ipv6_combined,
74 unsigned n_table_tests_combined = RTE_DIM(table_tests_combined);
76 /* Generic port tester function */
78 test_table_type(struct rte_table_ops *table_ops, void *table_args,
79 void *key, struct table_packets *table_packets,
80 struct manage_ops *manage_ops, unsigned n_ops)
82 uint32_t ring_in_id, table_id, ring_out_id, ring_out_2_id;
85 RTE_SET_USED(manage_ops);
88 struct rte_pipeline_params pipeline_params = {
93 struct rte_pipeline *pipeline = rte_pipeline_create(&pipeline_params);
95 /* Create input ring */
96 struct rte_port_ring_reader_params ring_params_rx = {
100 struct rte_port_ring_writer_params ring_params_tx = {
102 .tx_burst_sz = RTE_PORT_IN_BURST_SIZE_MAX,
105 struct rte_pipeline_port_in_params ring_in_params = {
106 .ops = &rte_port_ring_reader_ops,
107 .arg_create = (void *)&ring_params_rx,
109 .burst_size = RTE_PORT_IN_BURST_SIZE_MAX,
112 if (rte_pipeline_port_in_create(pipeline, &ring_in_params,
114 rte_pipeline_free(pipeline);
115 return -CHECK_TABLE_PORT_CONFIG;
119 struct rte_pipeline_table_params table_params = {
121 .arg_create = table_args,
122 .f_action_hit = NULL,
123 .f_action_miss = NULL,
125 .action_data_size = 0,
128 if (rte_pipeline_table_create(pipeline, &table_params,
130 rte_pipeline_free(pipeline);
131 return -CHECK_TABLE_TABLE_CONFIG;
134 /* Create output ports */
135 ring_params_tx.ring = RING_TX;
137 struct rte_pipeline_port_out_params ring_out_params = {
138 .ops = &rte_port_ring_writer_ops,
139 .arg_create = (void *)&ring_params_tx,
143 if (rte_pipeline_port_out_create(pipeline, &ring_out_params,
144 &ring_out_id) != 0) {
145 rte_pipeline_free(pipeline);
146 return -CHECK_TABLE_PORT_CONFIG;
149 ring_params_tx.ring = RING_TX_2;
151 if (rte_pipeline_port_out_create(pipeline, &ring_out_params,
152 &ring_out_2_id) != 0) {
153 rte_pipeline_free(pipeline);
154 return -CHECK_TABLE_PORT_CONFIG;
157 /* Add entry to the table */
158 struct rte_pipeline_table_entry default_entry = {
159 .action = RTE_PIPELINE_ACTION_DROP,
160 {.table_id = ring_out_id},
163 struct rte_pipeline_table_entry table_entry = {
164 .action = RTE_PIPELINE_ACTION_PORT,
165 {.table_id = ring_out_id},
168 struct rte_pipeline_table_entry *default_entry_ptr, *entry_ptr;
172 if (rte_pipeline_table_default_entry_add(pipeline, table_id,
173 &default_entry, &default_entry_ptr) != 0) {
174 rte_pipeline_free(pipeline);
175 return -CHECK_TABLE_DEFAULT_ENTRY_ADD;
178 if (rte_pipeline_table_entry_add(pipeline, table_id,
179 key ? key : &table_entry, &table_entry, &key_found,
181 rte_pipeline_free(pipeline);
182 return -CHECK_TABLE_ENTRY_ADD;
185 /* Create connections and check consistency */
186 if (rte_pipeline_port_in_connect_to_table(pipeline, ring_in_id,
188 rte_pipeline_free(pipeline);
189 return -CHECK_TABLE_CONNECT;
192 if (rte_pipeline_port_in_enable(pipeline, ring_in_id) != 0) {
193 rte_pipeline_free(pipeline);
194 return -CHECK_TABLE_PORT_ENABLE;
197 if (rte_pipeline_check(pipeline) != 0) {
198 rte_pipeline_free(pipeline);
199 return -CHECK_TABLE_CONSISTENCY;
204 /* Flow test - All hits */
205 if (table_packets->n_hit_packets) {
206 for (i = 0; i < table_packets->n_hit_packets; i++)
207 RING_ENQUEUE(RING_RX, table_packets->hit_packet[i]);
209 RUN_PIPELINE(pipeline);
211 VERIFY_TRAFFIC(RING_TX, table_packets->n_hit_packets,
212 table_packets->n_hit_packets);
215 /* Flow test - All misses */
216 if (table_packets->n_miss_packets) {
217 for (i = 0; i < table_packets->n_miss_packets; i++)
218 RING_ENQUEUE(RING_RX, table_packets->miss_packet[i]);
220 RUN_PIPELINE(pipeline);
222 VERIFY_TRAFFIC(RING_TX, table_packets->n_miss_packets, 0);
225 /* Flow test - Half hits, half misses */
226 if (table_packets->n_hit_packets && table_packets->n_miss_packets) {
227 for (i = 0; i < (table_packets->n_hit_packets) / 2; i++)
228 RING_ENQUEUE(RING_RX, table_packets->hit_packet[i]);
230 for (i = 0; i < (table_packets->n_miss_packets) / 2; i++)
231 RING_ENQUEUE(RING_RX, table_packets->miss_packet[i]);
233 RUN_PIPELINE(pipeline);
234 VERIFY_TRAFFIC(RING_TX, table_packets->n_hit_packets,
235 table_packets->n_hit_packets / 2);
238 /* Flow test - Single packet */
239 if (table_packets->n_hit_packets) {
240 RING_ENQUEUE(RING_RX, table_packets->hit_packet[0]);
241 RUN_PIPELINE(pipeline);
242 VERIFY_TRAFFIC(RING_TX, table_packets->n_hit_packets, 1);
244 if (table_packets->n_miss_packets) {
245 RING_ENQUEUE(RING_RX, table_packets->miss_packet[0]);
246 RUN_PIPELINE(pipeline);
247 VERIFY_TRAFFIC(RING_TX, table_packets->n_miss_packets, 0);
251 /* Change table entry action */
252 printf("Change entry action\n");
253 table_entry.table_id = ring_out_2_id;
255 if (rte_pipeline_table_default_entry_add(pipeline, table_id,
256 &default_entry, &default_entry_ptr) != 0) {
257 rte_pipeline_free(pipeline);
258 return -CHECK_TABLE_ENTRY_ADD;
261 if (rte_pipeline_table_entry_add(pipeline, table_id,
262 key ? key : &table_entry, &table_entry, &key_found,
264 rte_pipeline_free(pipeline);
265 return -CHECK_TABLE_ENTRY_ADD;
268 /* Check that traffic destination has changed */
269 if (table_packets->n_hit_packets) {
270 for (i = 0; i < table_packets->n_hit_packets; i++)
271 RING_ENQUEUE(RING_RX, table_packets->hit_packet[i]);
273 RUN_PIPELINE(pipeline);
274 VERIFY_TRAFFIC(RING_TX, table_packets->n_hit_packets, 0);
275 VERIFY_TRAFFIC(RING_TX_2, table_packets->n_hit_packets,
276 table_packets->n_hit_packets);
279 printf("delete entry\n");
280 /* Delete table entry */
281 rte_pipeline_table_entry_delete(pipeline, table_id,
282 key ? key : &table_entry, &key_found, NULL);
284 rte_pipeline_free(pipeline);
291 test_table_stub_combined(void)
294 struct table_packets table_packets;
296 printf("--------------\n");
297 printf("RUNNING TEST - %s\n", __func__);
298 printf("--------------\n");
299 for (i = 0; i < N_PACKETS; i++)
300 table_packets.hit_packet[i] = i;
302 table_packets.n_hit_packets = N_PACKETS;
303 table_packets.n_miss_packets = 0;
305 status = test_table_type(&rte_table_stub_ops, NULL, NULL,
306 &table_packets, NULL, 1);
307 VERIFY(status, CHECK_TABLE_OK);
313 test_table_lpm_combined(void)
318 struct rte_table_lpm_params lpm_params = {
321 .number_tbl8s = 1 << 8,
323 .entry_unique_size = 8,
324 .offset = APP_METADATA_OFFSET(0),
327 struct rte_table_lpm_key lpm_key = {
332 struct table_packets table_packets;
334 printf("--------------\n");
335 printf("RUNNING TEST - %s\n", __func__);
336 printf("--------------\n");
338 for (i = 0; i < N_PACKETS; i++)
339 table_packets.hit_packet[i] = 0xadadadad;
341 for (i = 0; i < N_PACKETS; i++)
342 table_packets.miss_packet[i] = 0xfefefefe;
344 table_packets.n_hit_packets = N_PACKETS;
345 table_packets.n_miss_packets = N_PACKETS;
347 status = test_table_type(&rte_table_lpm_ops, (void *)&lpm_params,
348 (void *)&lpm_key, &table_packets, NULL, 0);
349 VERIFY(status, CHECK_TABLE_OK);
351 /* Invalid parameters */
352 lpm_params.n_rules = 0;
354 status = test_table_type(&rte_table_lpm_ops, (void *)&lpm_params,
355 (void *)&lpm_key, &table_packets, NULL, 0);
356 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
358 lpm_params.n_rules = 1 << 24;
361 status = test_table_type(&rte_table_lpm_ops, (void *)&lpm_params,
362 (void *)&lpm_key, &table_packets, NULL, 0);
363 VERIFY(status, CHECK_TABLE_ENTRY_ADD);
367 status = test_table_type(&rte_table_lpm_ops, (void *)&lpm_params,
368 (void *)&lpm_key, &table_packets, NULL, 0);
369 VERIFY(status, CHECK_TABLE_ENTRY_ADD);
375 test_table_lpm_ipv6_combined(void)
380 struct rte_table_lpm_ipv6_params lpm_ipv6_params = {
383 .number_tbl8s = 1 << 13,
384 .entry_unique_size = 8,
385 .offset = APP_METADATA_OFFSET(32),
388 struct rte_table_lpm_ipv6_key lpm_ipv6_key = {
391 memset(lpm_ipv6_key.ip, 0xad, 16);
393 struct table_packets table_packets;
395 printf("--------------\n");
396 printf("RUNNING TEST - %s\n", __func__);
397 printf("--------------\n");
398 for (i = 0; i < N_PACKETS; i++)
399 table_packets.hit_packet[i] = 0xadadadad;
401 for (i = 0; i < N_PACKETS; i++)
402 table_packets.miss_packet[i] = 0xadadadab;
404 table_packets.n_hit_packets = N_PACKETS;
405 table_packets.n_miss_packets = N_PACKETS;
407 status = test_table_type(&rte_table_lpm_ipv6_ops,
408 (void *)&lpm_ipv6_params,
409 (void *)&lpm_ipv6_key, &table_packets, NULL, 0);
410 VERIFY(status, CHECK_TABLE_OK);
412 /* Invalid parameters */
413 lpm_ipv6_params.n_rules = 0;
415 status = test_table_type(&rte_table_lpm_ipv6_ops,
416 (void *)&lpm_ipv6_params,
417 (void *)&lpm_ipv6_key, &table_packets, NULL, 0);
418 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
420 lpm_ipv6_params.n_rules = 1 << 24;
421 lpm_ipv6_key.depth = 0;
423 status = test_table_type(&rte_table_lpm_ipv6_ops,
424 (void *)&lpm_ipv6_params,
425 (void *)&lpm_ipv6_key, &table_packets, NULL, 0);
426 VERIFY(status, CHECK_TABLE_ENTRY_ADD);
428 lpm_ipv6_key.depth = 129;
429 status = test_table_type(&rte_table_lpm_ipv6_ops,
430 (void *)&lpm_ipv6_params,
431 (void *)&lpm_ipv6_key, &table_packets, NULL, 0);
432 VERIFY(status, CHECK_TABLE_ENTRY_ADD);
438 test_table_hash8lru(void)
443 struct rte_table_hash_key8_lru_params key8lru_params = {
445 .f_hash = pipeline_test_hash,
446 .signature_offset = APP_METADATA_OFFSET(0),
447 .key_offset = APP_METADATA_OFFSET(32),
452 uint32_t *k8lru = (uint32_t *) key8lru;
454 memset(key8lru, 0, sizeof(key8lru));
455 k8lru[0] = 0xadadadad;
457 struct table_packets table_packets;
459 printf("--------------\n");
460 printf("RUNNING TEST - %s\n", __func__);
461 printf("--------------\n");
462 for (i = 0; i < 50; i++)
463 table_packets.hit_packet[i] = 0xadadadad;
465 for (i = 0; i < 50; i++)
466 table_packets.miss_packet[i] = 0xfefefefe;
468 table_packets.n_hit_packets = 50;
469 table_packets.n_miss_packets = 50;
471 status = test_table_type(&rte_table_hash_key8_lru_ops,
472 (void *)&key8lru_params, (void *)key8lru, &table_packets,
474 VERIFY(status, CHECK_TABLE_OK);
476 /* Invalid parameters */
477 key8lru_params.n_entries = 0;
479 status = test_table_type(&rte_table_hash_key8_lru_ops,
480 (void *)&key8lru_params, (void *)key8lru, &table_packets,
482 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
484 key8lru_params.n_entries = 1<<16;
485 key8lru_params.f_hash = NULL;
487 status = test_table_type(&rte_table_hash_key8_lru_ops,
488 (void *)&key8lru_params, (void *)key8lru, &table_packets,
490 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
496 test_table_hash16lru(void)
501 struct rte_table_hash_key16_lru_params key16lru_params = {
503 .f_hash = pipeline_test_hash,
505 .signature_offset = APP_METADATA_OFFSET(0),
506 .key_offset = APP_METADATA_OFFSET(32),
510 uint8_t key16lru[16];
511 uint32_t *k16lru = (uint32_t *) key16lru;
513 memset(key16lru, 0, sizeof(key16lru));
514 k16lru[0] = 0xadadadad;
516 struct table_packets table_packets;
518 printf("--------------\n");
519 printf("RUNNING TEST - %s\n", __func__);
520 printf("--------------\n");
521 for (i = 0; i < 50; i++)
522 table_packets.hit_packet[i] = 0xadadadad;
524 for (i = 0; i < 50; i++)
525 table_packets.miss_packet[i] = 0xfefefefe;
527 table_packets.n_hit_packets = 50;
528 table_packets.n_miss_packets = 50;
530 status = test_table_type(&rte_table_hash_key16_lru_ops,
531 (void *)&key16lru_params, (void *)key16lru, &table_packets,
533 VERIFY(status, CHECK_TABLE_OK);
535 /* Invalid parameters */
536 key16lru_params.n_entries = 0;
538 status = test_table_type(&rte_table_hash_key16_lru_ops,
539 (void *)&key16lru_params, (void *)key16lru, &table_packets,
541 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
543 key16lru_params.n_entries = 1<<16;
544 key16lru_params.f_hash = NULL;
546 status = test_table_type(&rte_table_hash_key16_lru_ops,
547 (void *)&key16lru_params, (void *)key16lru, &table_packets,
549 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
555 test_table_hash32lru(void)
560 struct rte_table_hash_key32_lru_params key32lru_params = {
562 .f_hash = pipeline_test_hash,
564 .signature_offset = APP_METADATA_OFFSET(0),
565 .key_offset = APP_METADATA_OFFSET(32),
568 uint8_t key32lru[32];
569 uint32_t *k32lru = (uint32_t *) key32lru;
571 memset(key32lru, 0, sizeof(key32lru));
572 k32lru[0] = 0xadadadad;
574 struct table_packets table_packets;
576 printf("--------------\n");
577 printf("RUNNING TEST - %s\n", __func__);
578 printf("--------------\n");
579 for (i = 0; i < 50; i++)
580 table_packets.hit_packet[i] = 0xadadadad;
582 for (i = 0; i < 50; i++)
583 table_packets.miss_packet[i] = 0xbdadadad;
585 table_packets.n_hit_packets = 50;
586 table_packets.n_miss_packets = 50;
588 status = test_table_type(&rte_table_hash_key32_lru_ops,
589 (void *)&key32lru_params, (void *)key32lru, &table_packets,
591 VERIFY(status, CHECK_TABLE_OK);
593 /* Invalid parameters */
594 key32lru_params.n_entries = 0;
596 status = test_table_type(&rte_table_hash_key32_lru_ops,
597 (void *)&key32lru_params, (void *)key32lru, &table_packets,
599 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
601 key32lru_params.n_entries = 1<<16;
602 key32lru_params.f_hash = NULL;
604 status = test_table_type(&rte_table_hash_key32_lru_ops,
605 (void *)&key32lru_params, (void *)key32lru, &table_packets,
607 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
613 test_table_hash8ext(void)
618 struct rte_table_hash_key8_ext_params key8ext_params = {
620 .n_entries_ext = 1<<15,
621 .f_hash = pipeline_test_hash,
623 .signature_offset = APP_METADATA_OFFSET(0),
624 .key_offset = APP_METADATA_OFFSET(32),
629 uint32_t *k8ext = (uint32_t *) key8ext;
631 memset(key8ext, 0, sizeof(key8ext));
632 k8ext[0] = 0xadadadad;
634 struct table_packets table_packets;
636 printf("--------------\n");
637 printf("RUNNING TEST - %s\n", __func__);
638 printf("--------------\n");
639 for (i = 0; i < 50; i++)
640 table_packets.hit_packet[i] = 0xadadadad;
642 for (i = 0; i < 50; i++)
643 table_packets.miss_packet[i] = 0xbdadadad;
645 table_packets.n_hit_packets = 50;
646 table_packets.n_miss_packets = 50;
648 status = test_table_type(&rte_table_hash_key8_ext_ops,
649 (void *)&key8ext_params, (void *)key8ext, &table_packets,
651 VERIFY(status, CHECK_TABLE_OK);
653 /* Invalid parameters */
654 key8ext_params.n_entries = 0;
656 status = test_table_type(&rte_table_hash_key8_ext_ops,
657 (void *)&key8ext_params, (void *)key8ext, &table_packets,
659 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
661 key8ext_params.n_entries = 1<<16;
662 key8ext_params.f_hash = NULL;
664 status = test_table_type(&rte_table_hash_key8_ext_ops,
665 (void *)&key8ext_params, (void *)key8ext, &table_packets,
667 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
669 key8ext_params.f_hash = pipeline_test_hash;
670 key8ext_params.n_entries_ext = 0;
672 status = test_table_type(&rte_table_hash_key8_ext_ops,
673 (void *)&key8ext_params, (void *)key8ext, &table_packets, NULL, 0);
674 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
680 test_table_hash16ext(void)
685 struct rte_table_hash_key16_ext_params key16ext_params = {
687 .n_entries_ext = 1<<15,
688 .f_hash = pipeline_test_hash,
690 .signature_offset = APP_METADATA_OFFSET(0),
691 .key_offset = APP_METADATA_OFFSET(32),
695 uint8_t key16ext[16];
696 uint32_t *k16ext = (uint32_t *) key16ext;
698 memset(key16ext, 0, sizeof(key16ext));
699 k16ext[0] = 0xadadadad;
701 struct table_packets table_packets;
703 printf("--------------\n");
704 printf("RUNNING TEST - %s\n", __func__);
705 printf("--------------\n");
706 for (i = 0; i < 50; i++)
707 table_packets.hit_packet[i] = 0xadadadad;
709 for (i = 0; i < 50; i++)
710 table_packets.miss_packet[i] = 0xbdadadad;
712 table_packets.n_hit_packets = 50;
713 table_packets.n_miss_packets = 50;
715 status = test_table_type(&rte_table_hash_key16_ext_ops,
716 (void *)&key16ext_params, (void *)key16ext, &table_packets,
718 VERIFY(status, CHECK_TABLE_OK);
720 /* Invalid parameters */
721 key16ext_params.n_entries = 0;
723 status = test_table_type(&rte_table_hash_key16_ext_ops,
724 (void *)&key16ext_params, (void *)key16ext, &table_packets,
726 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
728 key16ext_params.n_entries = 1<<16;
729 key16ext_params.f_hash = NULL;
731 status = test_table_type(&rte_table_hash_key16_ext_ops,
732 (void *)&key16ext_params, (void *)key16ext, &table_packets,
734 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
736 key16ext_params.f_hash = pipeline_test_hash;
737 key16ext_params.n_entries_ext = 0;
739 status = test_table_type(&rte_table_hash_key16_ext_ops,
740 (void *)&key16ext_params, (void *)key16ext, &table_packets, NULL, 0);
741 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
747 test_table_hash32ext(void)
752 struct rte_table_hash_key32_ext_params key32ext_params = {
754 .n_entries_ext = 1<<15,
755 .f_hash = pipeline_test_hash,
757 .signature_offset = APP_METADATA_OFFSET(0),
758 .key_offset = APP_METADATA_OFFSET(32),
761 uint8_t key32ext[32];
762 uint32_t *k32ext = (uint32_t *) key32ext;
764 memset(key32ext, 0, sizeof(key32ext));
765 k32ext[0] = 0xadadadad;
767 struct table_packets table_packets;
769 printf("--------------\n");
770 printf("RUNNING TEST - %s\n", __func__);
771 printf("--------------\n");
772 for (i = 0; i < 50; i++)
773 table_packets.hit_packet[i] = 0xadadadad;
775 for (i = 0; i < 50; i++)
776 table_packets.miss_packet[i] = 0xbdadadad;
778 table_packets.n_hit_packets = 50;
779 table_packets.n_miss_packets = 50;
781 status = test_table_type(&rte_table_hash_key32_ext_ops,
782 (void *)&key32ext_params, (void *)key32ext, &table_packets,
784 VERIFY(status, CHECK_TABLE_OK);
786 /* Invalid parameters */
787 key32ext_params.n_entries = 0;
789 status = test_table_type(&rte_table_hash_key32_ext_ops,
790 (void *)&key32ext_params, (void *)key32ext, &table_packets,
792 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
794 key32ext_params.n_entries = 1<<16;
795 key32ext_params.f_hash = NULL;
797 status = test_table_type(&rte_table_hash_key32_ext_ops,
798 (void *)&key32ext_params, (void *)key32ext, &table_packets,
800 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
802 key32ext_params.f_hash = pipeline_test_hash;
803 key32ext_params.n_entries_ext = 0;
805 status = test_table_type(&rte_table_hash_key32_ext_ops,
806 (void *)&key32ext_params, (void *)key32ext, &table_packets,
808 VERIFY(status, CHECK_TABLE_TABLE_CONFIG);