table: rework 16-byte key hash tables
[dpdk.git] / test / test / test_table_combined.c
index ddcd14b..4cfd955 100644 (file)
@@ -502,13 +502,15 @@ test_table_hash16lru(void)
        int status, i;
 
        /* Traffic flow */
-       struct rte_table_hash_key16_lru_params key16lru_params = {
-               .n_entries = 1<<16,
-               .f_hash = pipeline_test_hash,
-               .seed = 0,
-               .signature_offset = APP_METADATA_OFFSET(0),
+       struct rte_table_hash_params key16lru_params = {
+               .name = "TABLE",
+               .key_size = 16,
                .key_offset = APP_METADATA_OFFSET(32),
                .key_mask = NULL,
+               .n_keys = 1 << 16,
+               .n_buckets = 1 << 16,
+               .f_hash = (rte_table_hash_op_hash)pipeline_test_hash,
+               .seed = 0,
        };
 
        uint8_t key16lru[16];
@@ -537,14 +539,14 @@ test_table_hash16lru(void)
        VERIFY(status, CHECK_TABLE_OK);
 
        /* Invalid parameters */
-       key16lru_params.n_entries = 0;
+       key16lru_params.n_keys = 0;
 
        status = test_table_type(&rte_table_hash_key16_lru_ops,
                (void *)&key16lru_params, (void *)key16lru, &table_packets,
                        NULL, 0);
        VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
 
-       key16lru_params.n_entries = 1<<16;
+       key16lru_params.n_keys = 1<<16;
        key16lru_params.f_hash = NULL;
 
        status = test_table_type(&rte_table_hash_key16_lru_ops,
@@ -680,14 +682,15 @@ test_table_hash16ext(void)
        int status, i;
 
        /* Traffic flow */
-       struct rte_table_hash_key16_ext_params key16ext_params = {
-               .n_entries = 1<<16,
-               .n_entries_ext = 1<<15,
-               .f_hash = pipeline_test_hash,
-               .seed = 0,
-               .signature_offset = APP_METADATA_OFFSET(0),
+       struct rte_table_hash_params key16ext_params = {
+               .name = "TABLE",
+               .key_size = 16,
                .key_offset = APP_METADATA_OFFSET(32),
                .key_mask = NULL,
+               .n_keys = 1 << 16,
+               .n_buckets = 1 << 16,
+               .f_hash = (rte_table_hash_op_hash)pipeline_test_hash,
+               .seed = 0,
        };
 
        uint8_t key16ext[16];
@@ -716,14 +719,14 @@ test_table_hash16ext(void)
        VERIFY(status, CHECK_TABLE_OK);
 
        /* Invalid parameters */
-       key16ext_params.n_entries = 0;
+       key16ext_params.n_keys = 0;
 
        status = test_table_type(&rte_table_hash_key16_ext_ops,
                (void *)&key16ext_params, (void *)key16ext, &table_packets,
                NULL, 0);
        VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
 
-       key16ext_params.n_entries = 1<<16;
+       key16ext_params.n_keys = 1<<16;
        key16ext_params.f_hash = NULL;
 
        status = test_table_type(&rte_table_hash_key16_ext_ops,
@@ -731,13 +734,6 @@ test_table_hash16ext(void)
                NULL, 0);
        VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
 
-       key16ext_params.f_hash = pipeline_test_hash;
-       key16ext_params.n_entries_ext = 0;
-
-       status = test_table_type(&rte_table_hash_key16_ext_ops,
-       (void *)&key16ext_params, (void *)key16ext, &table_packets, NULL, 0);
-       VERIFY(status, CHECK_TABLE_TABLE_CONFIG);
-
        return 0;
 }