diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2018-08-14 18:52:30 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2018-08-14 18:53:17 +0100 |
commit | b63264c8342e6a1b6971c79550d2af2024b6a4de (patch) | |
tree | 83114aac64286fe616506c0b3dfaec2ab86ef835 /test/test-pipeline | |
parent | ca33590b6af032bff57d9cc70455660466a654b2 (diff) |
New upstream version 18.08upstream/18.08
Change-Id: I32fdf5e5016556d9c0a6d88ddaf1fc468961790a
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'test/test-pipeline')
-rw-r--r-- | test/test-pipeline/init.c | 6 | ||||
-rw-r--r-- | test/test-pipeline/main.h | 4 | ||||
-rw-r--r-- | test/test-pipeline/pipeline_hash.c | 26 |
3 files changed, 30 insertions, 6 deletions
diff --git a/test/test-pipeline/init.c b/test/test-pipeline/init.c index 19cf04a6..f33216c9 100644 --- a/test/test-pipeline/init.c +++ b/test/test-pipeline/init.c @@ -70,11 +70,7 @@ struct app_params app = { static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, - .header_split = 0, /* Header Split disabled */ - .hw_ip_checksum = 1, /* IP checksum offload enabled */ - .hw_vlan_filter = 0, /* VLAN filtering disabled */ - .jumbo_frame = 0, /* Jumbo Frame Support disabled */ - .hw_strip_crc = 1, /* CRC stripped by hardware */ + .offloads = DEV_RX_OFFLOAD_CHECKSUM | DEV_RX_OFFLOAD_CRC_STRIP, }, .rx_adv_conf = { .rss_conf = { diff --git a/test/test-pipeline/main.h b/test/test-pipeline/main.h index f844e941..59dcfddb 100644 --- a/test/test-pipeline/main.h +++ b/test/test-pipeline/main.h @@ -107,6 +107,10 @@ uint64_t test_hash(void *key, uint32_t key_size, uint64_t seed); +uint32_t test_hash_cuckoo(const void *key, + uint32_t key_size, + uint32_t seed); + void app_main_loop_worker(void); void app_main_loop_worker_pipeline_stub(void); void app_main_loop_worker_pipeline_hash(void); diff --git a/test/test-pipeline/pipeline_hash.c b/test/test-pipeline/pipeline_hash.c index 11e2402d..c2014723 100644 --- a/test/test-pipeline/pipeline_hash.c +++ b/test/test-pipeline/pipeline_hash.c @@ -15,6 +15,7 @@ #include <rte_port_ring.h> #include <rte_table_hash.h> #include <rte_hash.h> +#include <rte_table_hash_cuckoo.h> #include <rte_pipeline.h> #include "main.h" @@ -151,6 +152,17 @@ app_main_loop_worker_pipeline_hash(void) { .seed = 0, }; + struct rte_table_hash_cuckoo_params table_hash_cuckoo_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_cuckoo, + .seed = 0, + }; + /* Table configuration */ switch (app.pipeline_type) { case e_APP_PIPELINE_HASH_KEY8_EXT: @@ -298,7 +310,7 @@ app_main_loop_worker_pipeline_hash(void) { { struct rte_pipeline_table_params table_params = { .ops = &rte_table_hash_cuckoo_ops, - .arg_create = &table_hash_params, + .arg_create = &table_hash_cuckoo_params, .f_action_hit = NULL, .f_action_miss = NULL, .arg_ah = NULL, @@ -379,6 +391,18 @@ uint64_t test_hash( return signature; } +uint32_t test_hash_cuckoo( + const void *key, + __attribute__((unused)) uint32_t key_size, + __attribute__((unused)) uint32_t seed) +{ + const uint32_t *k32 = key; + uint32_t ip_dst = rte_be_to_cpu_32(k32[0]); + uint32_t signature = (ip_dst >> 2) | ((ip_dst & 0x3) << 30); + + return signature; +} + void app_main_loop_rx_metadata(void) { uint32_t i, j; |