X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_table.h;h=a66342cb65aafceffff5741c9fad6fa5d5a07d1a;hb=7718296d06916d0b2029763913944f0067a2d0dd;hp=be331c0c9cd5c599d155d2e50edc520afdb46aff;hpb=ea0c20ea95fd5d71a10757e6598ac66233ea1495;p=dpdk.git diff --git a/app/test/test_table.h b/app/test/test_table.h index be331c0c9c..a66342cb65 100644 --- a/app/test/test_table.h +++ b/app/test/test_table.h @@ -1,40 +1,12 @@ -/*- - * BSD LICENSE - * - * Copyright(c) 2010-2014 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-2014 Intel Corporation */ #include #include #include #include +#include #include #include @@ -65,7 +37,7 @@ #define PORT_TX_RING_SIZE 512 #define RING_RX_SIZE 128 #define RING_TX_SIZE 128 -#define POOL_BUFFER_SIZE (2048 + RTE_PKTMBUF_HEADROOM) +#define POOL_BUFFER_SIZE RTE_MBUF_DEFAULT_BUF_SIZE #define POOL_SIZE (32 * 1024) #define POOL_CACHE_SIZE 256 #define BURST_SIZE 8 @@ -78,6 +50,8 @@ #define MP_FLAGS 0 /* Macros */ +#define APP_METADATA_OFFSET(offset) (sizeof(struct rte_mbuf) + (offset)) + #define RING_ENQUEUE(ring, value) do { \ struct rte_mbuf *m; \ uint32_t *k32, *signature; \ @@ -86,11 +60,13 @@ m = rte_pktmbuf_alloc(pool); \ if (m == NULL) \ return -1; \ - signature = RTE_MBUF_METADATA_UINT32_PTR(m, 0); \ - key = RTE_MBUF_METADATA_UINT8_PTR(m, 32); \ + signature = RTE_MBUF_METADATA_UINT32_PTR(m, \ + APP_METADATA_OFFSET(0)); \ + key = RTE_MBUF_METADATA_UINT8_PTR(m, \ + APP_METADATA_OFFSET(32)); \ k32 = (uint32_t *) key; \ k32[0] = (value); \ - *signature = pipeline_test_hash(key, 0, 0); \ + *signature = pipeline_test_hash(key, NULL, 0, 0); \ rte_ring_enqueue((ring), m); \ } while (0) @@ -127,9 +103,15 @@ /* Function definitions */ uint64_t pipeline_test_hash( void *key, + __attribute__((unused)) void *key_mask, __attribute__((unused)) uint32_t key_size, __attribute__((unused)) uint64_t seed); +uint32_t pipeline_test_hash_cuckoo( + const void *key, + __attribute__((unused)) uint32_t key_size, + __attribute__((unused)) uint32_t seed); + /* Extern variables */ extern struct rte_pipeline *p; extern struct rte_ring *rings_rx[N_PORTS];