X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=test%2Ftest-pipeline%2Fpipeline_hash.c;h=11e2402d07007068dd65faaca74fc5b4f1e3d977;hb=655c901bf7345e2eb7e2bb603a6c30ac6feff3c9;hp=24df81cde04ea7a70e7aa9d29ad4522b641bcadc;hpb=ec35c73ec6470e92afd5cab8cef748e8484a1187;p=dpdk.git diff --git a/test/test-pipeline/pipeline_hash.c b/test/test-pipeline/pipeline_hash.c index 24df81cde0..11e2402d07 100644 --- a/test/test-pipeline/pipeline_hash.c +++ b/test/test-pipeline/pipeline_hash.c @@ -1,34 +1,5 @@ -/*- - * BSD LICENSE - * - * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2016 Intel Corporation */ #include @@ -169,23 +140,23 @@ app_main_loop_worker_pipeline_hash(void) { "ring %d\n", i); } + struct rte_table_hash_params table_hash_params = { + .name = "TABLE", + .key_size = key_size, + .key_offset = APP_METADATA_OFFSET(32), + .key_mask = NULL, + .n_keys = 1 << 24, + .n_buckets = 1 << 22, + .f_hash = test_hash, + .seed = 0, + }; + /* Table configuration */ switch (app.pipeline_type) { case e_APP_PIPELINE_HASH_KEY8_EXT: case e_APP_PIPELINE_HASH_KEY16_EXT: case e_APP_PIPELINE_HASH_KEY32_EXT: { - struct rte_table_hash_params table_hash_params = { - .name = "TABLE", - .key_size = key_size, - .key_offset = APP_METADATA_OFFSET(32), - .key_mask = NULL, - .n_keys = 1 << 24, - .n_buckets = 1 << 22, - .f_hash = (rte_table_hash_op_hash)test_hash, - .seed = 0, - }; - struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_ext_ops, .arg_create = &table_hash_params, @@ -204,17 +175,6 @@ app_main_loop_worker_pipeline_hash(void) { case e_APP_PIPELINE_HASH_KEY16_LRU: case e_APP_PIPELINE_HASH_KEY32_LRU: { - struct rte_table_hash_params table_hash_params = { - .name = "TABLE", - .key_size = key_size, - .key_offset = APP_METADATA_OFFSET(32), - .key_mask = NULL, - .n_keys = 1 << 24, - .n_buckets = 1 << 22, - .f_hash = (rte_table_hash_op_hash)test_hash, - .seed = 0, - }; - struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_lru_ops, .arg_create = &table_hash_params, @@ -231,17 +191,6 @@ app_main_loop_worker_pipeline_hash(void) { case e_APP_PIPELINE_HASH_SPEC_KEY8_EXT: { - struct rte_table_hash_params table_hash_params = { - .name = "TABLE", - .key_size = key_size, - .key_offset = APP_METADATA_OFFSET(32), - .key_mask = NULL, - .n_keys = 1 << 24, - .n_buckets = 1 << 22, - .f_hash = (rte_table_hash_op_hash)test_hash, - .seed = 0, - }; - struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_key8_ext_ops, .arg_create = &table_hash_params, @@ -258,17 +207,6 @@ app_main_loop_worker_pipeline_hash(void) { case e_APP_PIPELINE_HASH_SPEC_KEY8_LRU: { - struct rte_table_hash_params table_hash_params = { - .name = "TABLE", - .key_size = key_size, - .key_offset = APP_METADATA_OFFSET(32), - .key_mask = NULL, - .n_keys = 1 << 24, - .n_buckets = 1 << 22, - .f_hash = (rte_table_hash_op_hash)test_hash, - .seed = 0, - }; - struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_key8_lru_ops, .arg_create = &table_hash_params, @@ -285,17 +223,6 @@ app_main_loop_worker_pipeline_hash(void) { case e_APP_PIPELINE_HASH_SPEC_KEY16_EXT: { - struct rte_table_hash_params table_hash_params = { - .name = "TABLE", - .key_size = key_size, - .key_offset = APP_METADATA_OFFSET(32), - .key_mask = NULL, - .n_keys = 1 << 24, - .n_buckets = 1 << 22, - .f_hash = (rte_table_hash_op_hash)test_hash, - .seed = 0, - }; - struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_key16_ext_ops, .arg_create = &table_hash_params, @@ -312,17 +239,6 @@ app_main_loop_worker_pipeline_hash(void) { case e_APP_PIPELINE_HASH_SPEC_KEY16_LRU: { - struct rte_table_hash_params table_hash_params = { - .name = "TABLE", - .key_size = key_size, - .key_offset = APP_METADATA_OFFSET(32), - .key_mask = NULL, - .n_keys = 1 << 24, - .n_buckets = 1 << 22, - .f_hash = (rte_table_hash_op_hash)test_hash, - .seed = 0, - }; - struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_key16_lru_ops, .arg_create = &table_hash_params, @@ -339,17 +255,6 @@ app_main_loop_worker_pipeline_hash(void) { case e_APP_PIPELINE_HASH_SPEC_KEY32_EXT: { - struct rte_table_hash_params table_hash_params = { - .name = "TABLE", - .key_size = key_size, - .key_offset = APP_METADATA_OFFSET(32), - .key_mask = NULL, - .n_keys = 1 << 24, - .n_buckets = 1 << 22, - .f_hash = (rte_table_hash_op_hash)test_hash, - .seed = 0, - }; - struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_key32_ext_ops, .arg_create = &table_hash_params, @@ -367,17 +272,6 @@ app_main_loop_worker_pipeline_hash(void) { case e_APP_PIPELINE_HASH_SPEC_KEY32_LRU: { - struct rte_table_hash_params table_hash_params = { - .name = "TABLE", - .key_size = key_size, - .key_offset = APP_METADATA_OFFSET(32), - .key_mask = NULL, - .n_keys = 1 << 24, - .n_buckets = 1 << 22, - .f_hash = (rte_table_hash_op_hash)test_hash, - .seed = 0, - }; - struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_key32_lru_ops, .arg_create = &table_hash_params, @@ -402,17 +296,6 @@ app_main_loop_worker_pipeline_hash(void) { case e_APP_PIPELINE_HASH_CUCKOO_KEY112: case e_APP_PIPELINE_HASH_CUCKOO_KEY128: { - struct rte_table_hash_params table_hash_params = { - .name = "TABLE", - .key_size = key_size, - .key_offset = APP_METADATA_OFFSET(32), - .key_mask = NULL, - .n_keys = 1 << 24, - .n_buckets = 1 << 22, - .f_hash = (rte_table_hash_op_hash)test_hash, - .seed = 0, - }; - struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_cuckoo_ops, .arg_create = &table_hash_params, @@ -485,6 +368,7 @@ app_main_loop_worker_pipeline_hash(void) { uint64_t test_hash( void *key, + __attribute__((unused)) void *key_mask, __attribute__((unused)) uint32_t key_size, __attribute__((unused)) uint64_t seed) { @@ -547,7 +431,7 @@ app_main_loop_rx_metadata(void) { } else continue; - *signature = test_hash(key, 0, 0); + *signature = test_hash(key, NULL, 0, 0); } do {