X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pipeline%2Fpipeline_hash.c;h=10d28695ef73cb22b04e774370cc7c6d487d1742;hb=576de42b83e505fe87eedf0fca0e07f6b5d3bad9;hp=8b888d795344cdd3dedf86ae6e9d110fcce10599;hpb=fc6bcc6fee46616729160720e06baef13e7447e4;p=dpdk.git diff --git a/app/test-pipeline/pipeline_hash.c b/app/test-pipeline/pipeline_hash.c index 8b888d7953..10d28695ef 100644 --- a/app/test-pipeline/pipeline_hash.c +++ b/app/test-pipeline/pipeline_hash.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,6 +43,7 @@ #include #include +#include #include #include "main.h" @@ -77,6 +78,25 @@ translate_options(uint32_t *special, uint32_t *ext, uint32_t *key_size) case e_APP_PIPELINE_HASH_SPEC_KEY32_LRU: *special = 1; *ext = 0; *key_size = 32; return; + case e_APP_PIPELINE_HASH_CUCKOO_KEY8: + *special = 0; *ext = 0; *key_size = 8; return; + case e_APP_PIPELINE_HASH_CUCKOO_KEY16: + *special = 0; *ext = 0; *key_size = 16; return; + case e_APP_PIPELINE_HASH_CUCKOO_KEY32: + *special = 0; *ext = 0; *key_size = 32; return; + case e_APP_PIPELINE_HASH_CUCKOO_KEY48: + *special = 0; *ext = 0; *key_size = 48; return; + case e_APP_PIPELINE_HASH_CUCKOO_KEY64: + *special = 0; *ext = 0; *key_size = 64; return; + case e_APP_PIPELINE_HASH_CUCKOO_KEY80: + *special = 0; *ext = 0; *key_size = 80; return; + case e_APP_PIPELINE_HASH_CUCKOO_KEY96: + *special = 0; *ext = 0; *key_size = 96; return; + case e_APP_PIPELINE_HASH_CUCKOO_KEY112: + *special = 0; *ext = 0; *key_size = 112; return; + case e_APP_PIPELINE_HASH_CUCKOO_KEY128: + *special = 0; *ext = 0; *key_size = 128; return; + default: rte_panic("Invalid hash table type or key size\n"); } @@ -140,7 +160,6 @@ app_main_loop_worker_pipeline_hash(void) { .ops = &rte_port_ring_writer_ops, .arg_create = (void *) &port_ring_params, .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, }; @@ -191,8 +210,8 @@ app_main_loop_worker_pipeline_hash(void) { .n_buckets = 1 << 22, .f_hash = test_hash, .seed = 0, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), }; struct rte_pipeline_table_params table_params = { @@ -361,6 +380,45 @@ app_main_loop_worker_pipeline_hash(void) { } break; + case e_APP_PIPELINE_HASH_CUCKOO_KEY8: + case e_APP_PIPELINE_HASH_CUCKOO_KEY16: + case e_APP_PIPELINE_HASH_CUCKOO_KEY32: + case e_APP_PIPELINE_HASH_CUCKOO_KEY48: + case e_APP_PIPELINE_HASH_CUCKOO_KEY64: + case e_APP_PIPELINE_HASH_CUCKOO_KEY80: + case e_APP_PIPELINE_HASH_CUCKOO_KEY96: + case e_APP_PIPELINE_HASH_CUCKOO_KEY112: + case e_APP_PIPELINE_HASH_CUCKOO_KEY128: + { + char hash_name[RTE_HASH_NAMESIZE]; + + snprintf(hash_name, sizeof(hash_name), "RTE_TH_CUCKOO_%d", + app.pipeline_type); + + struct rte_table_hash_cuckoo_params table_hash_params = { + .key_size = key_size, + .n_keys = (1 << 24) + 1, + .f_hash = test_hash, + .seed = 0, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), + .name = hash_name, + }; + + struct rte_pipeline_table_params table_params = { + .ops = &rte_table_hash_cuckoo_dosig_ops, + .arg_create = &table_hash_params, + .f_action_hit = NULL, + .f_action_miss = NULL, + .arg_ah = NULL, + .action_data_size = 0, + }; + + if (rte_pipeline_table_create(p, &table_params, &table_id)) + rte_panic("Unable to configure the hash table\n"); + } + break; + default: rte_panic("Invalid hash table type or key size\n"); }