X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2Fip_pipeline%2Fpipeline%2Fpipeline_flow_classification_be.c;h=097ec3469b7efc77946aaed22bb1e7f474954290;hb=0fe99cf73eec0426ef9cb5eb71c1b8b4de40162c;hp=e4a18e44d6f32e518fa846fa04ab8dc3070f0a18;hpb=fc972a130589bc43aeee7b09baf36e35873224ed;p=dpdk.git diff --git a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c index e4a18e44d6..097ec3469b 100644 --- a/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_flow_classification_be.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 @@ -118,7 +89,7 @@ struct flow_table_entry { uint32_t pad; }; -rte_table_hash_op_hash_nomask hash_func[] = { +rte_table_hash_op_hash hash_func[] = { hash_default_key8, hash_default_key16, hash_default_key24, @@ -499,8 +470,8 @@ static void *pipeline_fc_init(struct pipeline_params *params, .key_mask = (p_fc->key_mask_present) ? p_fc->key_mask : NULL, .n_keys = p_fc->n_flows, - .n_buckets = p_fc->n_flows / 4, - .f_hash = (rte_table_hash_op_hash)hash_func[(p_fc->key_size / 8) - 1], + .n_buckets = rte_align32pow2(p_fc->n_flows / 4), + .f_hash = hash_func[(p_fc->key_size / 8) - 1], .seed = 0, }; @@ -519,19 +490,18 @@ static void *pipeline_fc_init(struct pipeline_params *params, switch (p_fc->key_size) { case 8: table_params.ops = &rte_table_hash_key8_ext_ops; - table_params.arg_create = &table_hash_params; break; case 16: table_params.ops = &rte_table_hash_key16_ext_ops; - table_params.arg_create = &table_hash_params; break; default: table_params.ops = &rte_table_hash_ext_ops; - table_params.arg_create = &table_hash_params; } + table_params.arg_create = &table_hash_params; + status = rte_pipeline_table_create(p->p, &table_params, &p->table_id[0]);