* [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table @ 2015-09-08 10:11 Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 1/4] librte_table: modify LPM table parameter structure Jasvinder Singh ` (4 more replies) 0 siblings, 5 replies; 8+ messages in thread From: Jasvinder Singh @ 2015-09-08 10:11 UTC (permalink / raw) To: dev This patchset links to ABI change announced for librte_table. For lpm table, name parameter has been included in LPM table parameters structure. It will eventually allow applications to create more than one instances of lpm table, if required. Jasvinder Singh (4): librte_table: add name parameter to LPM table app/test: modify table and pipeline test ip_pipeline: modify lpm table for routing pipeline librte_table: modify release notes and deprecation notice app/test-pipeline/pipeline_lpm.c | 1 + app/test-pipeline/pipeline_lpm_ipv6.c | 1 + app/test/test_table_combined.c | 2 + app/test/test_table_tables.c | 102 ++++++++++++--------- doc/guides/rel_notes/deprecation.rst | 3 - doc/guides/rel_notes/release_2_2.rst | 4 +- .../ip_pipeline/pipeline/pipeline_routing_be.c | 1 + lib/librte_table/Makefile | 2 +- lib/librte_table/rte_table_lpm.c | 8 +- lib/librte_table/rte_table_lpm.h | 3 + lib/librte_table/rte_table_lpm_ipv6.c | 8 +- lib/librte_table/rte_table_lpm_ipv6.h | 3 + 12 files changed, 86 insertions(+), 52 deletions(-) -- 2.1.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 1/4] librte_table: modify LPM table parameter structure 2015-09-08 10:11 [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Jasvinder Singh @ 2015-09-08 10:11 ` Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 2/4] app/test: modify table and pipeline test Jasvinder Singh ` (3 subsequent siblings) 4 siblings, 0 replies; 8+ messages in thread From: Jasvinder Singh @ 2015-09-08 10:11 UTC (permalink / raw) To: dev This patch relates to ABI change proposed for librte_table (lpm table). A new parameter to hold the table name has been added to the LPM table parameter structures rte_table_lpm_params and rte_table_lpm_ipv6_params. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> --- lib/librte_table/rte_table_lpm.c | 8 ++++++-- lib/librte_table/rte_table_lpm.h | 3 +++ lib/librte_table/rte_table_lpm_ipv6.c | 8 ++++++-- lib/librte_table/rte_table_lpm_ipv6.h | 3 +++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/librte_table/rte_table_lpm.c b/lib/librte_table/rte_table_lpm.c index b218d64..849d899 100644 --- a/lib/librte_table/rte_table_lpm.c +++ b/lib/librte_table/rte_table_lpm.c @@ -103,7 +103,11 @@ rte_table_lpm_create(void *params, int socket_id, uint32_t entry_size) __func__); return NULL; } - + if (p->name == NULL) { + RTE_LOG(ERR, TABLE, "%s: Table name is NULL\n", + __func__); + return NULL; + } entry_size = RTE_ALIGN(entry_size, sizeof(uint64_t)); /* Memory allocation */ @@ -119,7 +123,7 @@ rte_table_lpm_create(void *params, int socket_id, uint32_t entry_size) } /* LPM low-level table creation */ - lpm->lpm = rte_lpm_create("LPM", socket_id, p->n_rules, 0); + lpm->lpm = rte_lpm_create(p->name, socket_id, p->n_rules, 0); if (lpm->lpm == NULL) { rte_free(lpm); RTE_LOG(ERR, TABLE, "Unable to create low-level LPM table\n"); diff --git a/lib/librte_table/rte_table_lpm.h b/lib/librte_table/rte_table_lpm.h index c08c958..06e8410 100644 --- a/lib/librte_table/rte_table_lpm.h +++ b/lib/librte_table/rte_table_lpm.h @@ -77,6 +77,9 @@ extern "C" { /** LPM table parameters */ struct rte_table_lpm_params { + /** Table name */ + const char *name; + /** Maximum number of LPM rules (i.e. IP routes) */ uint32_t n_rules; diff --git a/lib/librte_table/rte_table_lpm_ipv6.c b/lib/librte_table/rte_table_lpm_ipv6.c index ff4a9c2..ce91db2 100644 --- a/lib/librte_table/rte_table_lpm_ipv6.c +++ b/lib/librte_table/rte_table_lpm_ipv6.c @@ -109,13 +109,17 @@ rte_table_lpm_ipv6_create(void *params, int socket_id, uint32_t entry_size) __func__); return NULL; } - + if (p->name == NULL) { + RTE_LOG(ERR, TABLE, "%s: Table name is NULL\n", + __func__); + return NULL; + } entry_size = RTE_ALIGN(entry_size, sizeof(uint64_t)); /* Memory allocation */ nht_size = RTE_TABLE_LPM_MAX_NEXT_HOPS * entry_size; total_size = sizeof(struct rte_table_lpm_ipv6) + nht_size; - lpm = rte_zmalloc_socket("TABLE", total_size, RTE_CACHE_LINE_SIZE, + lpm = rte_zmalloc_socket(p->name, total_size, RTE_CACHE_LINE_SIZE, socket_id); if (lpm == NULL) { RTE_LOG(ERR, TABLE, diff --git a/lib/librte_table/rte_table_lpm_ipv6.h b/lib/librte_table/rte_table_lpm_ipv6.h index 91fb0d8..43aea39 100644 --- a/lib/librte_table/rte_table_lpm_ipv6.h +++ b/lib/librte_table/rte_table_lpm_ipv6.h @@ -79,6 +79,9 @@ extern "C" { /** LPM table parameters */ struct rte_table_lpm_ipv6_params { + /** Table name */ + const char *name; + /** Maximum number of LPM rules (i.e. IP routes) */ uint32_t n_rules; -- 2.1.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 2/4] app/test: modify table and pipeline test 2015-09-08 10:11 [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 1/4] librte_table: modify LPM table parameter structure Jasvinder Singh @ 2015-09-08 10:11 ` Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 3/4] ip_pipeline: modify lpm table for routing pipeline Jasvinder Singh ` (2 subsequent siblings) 4 siblings, 0 replies; 8+ messages in thread From: Jasvinder Singh @ 2015-09-08 10:11 UTC (permalink / raw) To: dev LPM table and test-pipeline has been modified to include name parameter of the lpm table. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> --- app/test-pipeline/pipeline_lpm.c | 1 + app/test-pipeline/pipeline_lpm_ipv6.c | 1 + app/test/test_table_combined.c | 2 + app/test/test_table_tables.c | 102 ++++++++++++++++++++-------------- 4 files changed, 63 insertions(+), 43 deletions(-) diff --git a/app/test-pipeline/pipeline_lpm.c b/app/test-pipeline/pipeline_lpm.c index b1a2c13..c03799c 100644 --- a/app/test-pipeline/pipeline_lpm.c +++ b/app/test-pipeline/pipeline_lpm.c @@ -112,6 +112,7 @@ app_main_loop_worker_pipeline_lpm(void) { /* Table configuration */ { struct rte_table_lpm_params table_lpm_params = { + .name = "LPM", .n_rules = 1 << 24, .entry_unique_size = sizeof(struct rte_pipeline_table_entry), diff --git a/app/test-pipeline/pipeline_lpm_ipv6.c b/app/test-pipeline/pipeline_lpm_ipv6.c index 3f24a2d..02b7a9c 100644 --- a/app/test-pipeline/pipeline_lpm_ipv6.c +++ b/app/test-pipeline/pipeline_lpm_ipv6.c @@ -113,6 +113,7 @@ app_main_loop_worker_pipeline_lpm_ipv6(void) { /* Table configuration */ { struct rte_table_lpm_ipv6_params table_lpm_ipv6_params = { + .name = "LPM", .n_rules = 1 << 24, .number_tbl8s = 1 << 21, .entry_unique_size = diff --git a/app/test/test_table_combined.c b/app/test/test_table_combined.c index dd09da5..f5c7c9b 100644 --- a/app/test/test_table_combined.c +++ b/app/test/test_table_combined.c @@ -293,6 +293,7 @@ test_table_lpm_combined(void) /* Traffic flow */ struct rte_table_lpm_params lpm_params = { + .name = "LPM", .n_rules = 1 << 16, .entry_unique_size = 8, .offset = 0, @@ -352,6 +353,7 @@ test_table_lpm_ipv6_combined(void) /* Traffic flow */ struct rte_table_lpm_ipv6_params lpm_ipv6_params = { + .name = "LPM", .n_rules = 1 << 16, .number_tbl8s = 1 << 13, .entry_unique_size = 8, diff --git a/app/test/test_table_tables.c b/app/test/test_table_tables.c index 566964b..9d75fbf 100644 --- a/app/test/test_table_tables.c +++ b/app/test/test_table_tables.c @@ -322,6 +322,7 @@ test_table_lpm(void) /* Initialize params and create tables */ struct rte_table_lpm_params lpm_params = { + .name = "LPM", .n_rules = 1 << 24, .entry_unique_size = entry_size, .offset = 1 @@ -331,40 +332,47 @@ test_table_lpm(void) if (table != NULL) return -1; - lpm_params.n_rules = 0; + lpm_params.name = NULL; table = rte_table_lpm_ops.f_create(&lpm_params, 0, entry_size); if (table != NULL) return -2; + lpm_params.name = "LPM"; + lpm_params.n_rules = 0; + + table = rte_table_lpm_ops.f_create(&lpm_params, 0, entry_size); + if (table != NULL) + return -3; + lpm_params.n_rules = 1 << 24; lpm_params.offset = 32; lpm_params.entry_unique_size = 0; table = rte_table_lpm_ops.f_create(&lpm_params, 0, entry_size); if (table != NULL) - return -3; + return -4; lpm_params.entry_unique_size = entry_size + 1; table = rte_table_lpm_ops.f_create(&lpm_params, 0, entry_size); if (table != NULL) - return -4; + return -5; lpm_params.entry_unique_size = entry_size; table = rte_table_lpm_ops.f_create(&lpm_params, 0, entry_size); if (table == NULL) - return -5; + return -6; /* Free */ status = rte_table_lpm_ops.f_free(table); if (status < 0) - return -6; + return -7; status = rte_table_lpm_ops.f_free(NULL); if (status == 0) - return -7; + return -8; /* Add */ struct rte_table_lpm_key lpm_key; @@ -372,75 +380,75 @@ test_table_lpm(void) table = rte_table_lpm_ops.f_create(&lpm_params, 0, 1); if (table == NULL) - return -8; + return -9; status = rte_table_lpm_ops.f_add(NULL, &lpm_key, &entry, &key_found, &entry_ptr); if (status == 0) - return -9; + return -10; status = rte_table_lpm_ops.f_add(table, NULL, &entry, &key_found, &entry_ptr); if (status == 0) - return -10; + return -11; status = rte_table_lpm_ops.f_add(table, &lpm_key, NULL, &key_found, &entry_ptr); if (status == 0) - return -11; + return -12; lpm_key.depth = 0; status = rte_table_lpm_ops.f_add(table, &lpm_key, &entry, &key_found, &entry_ptr); if (status == 0) - return -12; + return -13; lpm_key.depth = 33; status = rte_table_lpm_ops.f_add(table, &lpm_key, &entry, &key_found, &entry_ptr); if (status == 0) - return -13; + return -14; lpm_key.depth = 16; status = rte_table_lpm_ops.f_add(table, &lpm_key, &entry, &key_found, &entry_ptr); if (status != 0) - return -14; + return -15; /* Delete */ status = rte_table_lpm_ops.f_delete(NULL, &lpm_key, &key_found, NULL); if (status == 0) - return -15; + return -16; status = rte_table_lpm_ops.f_delete(table, NULL, &key_found, NULL); if (status == 0) - return -16; + return -17; lpm_key.depth = 0; status = rte_table_lpm_ops.f_delete(table, &lpm_key, &key_found, NULL); if (status == 0) - return -17; + return -18; lpm_key.depth = 33; status = rte_table_lpm_ops.f_delete(table, &lpm_key, &key_found, NULL); if (status == 0) - return -18; + return -19; lpm_key.depth = 16; status = rte_table_lpm_ops.f_delete(table, &lpm_key, &key_found, NULL); if (status != 0) - return -19; + return -20; status = rte_table_lpm_ops.f_delete(table, &lpm_key, &key_found, NULL); if (status != 0) - return -20; + return -21; /* Traffic flow */ entry = 'A'; status = rte_table_lpm_ops.f_add(table, &lpm_key, &entry, &key_found, &entry_ptr); if (status < 0) - return -21; + return -22; for (i = 0; i < RTE_PORT_IN_BURST_SIZE_MAX; i++) if (i % 2 == 0) { @@ -452,7 +460,7 @@ test_table_lpm(void) rte_table_lpm_ops.f_lookup(table, mbufs, -1, &result_mask, (void **)entries); if (result_mask != expected_mask) - return -22; + return -23; /* Free resources */ for (i = 0; i < RTE_PORT_IN_BURST_SIZE_MAX; i++) @@ -478,6 +486,7 @@ test_table_lpm_ipv6(void) /* Initialize params and create tables */ struct rte_table_lpm_ipv6_params lpm_params = { + .name = "LPM", .n_rules = 1 << 24, .number_tbl8s = 1 << 21, .entry_unique_size = entry_size, @@ -488,44 +497,51 @@ test_table_lpm_ipv6(void) if (table != NULL) return -1; - lpm_params.n_rules = 0; + lpm_params.name = NULL; table = rte_table_lpm_ipv6_ops.f_create(&lpm_params, 0, entry_size); if (table != NULL) return -2; + lpm_params.name = "LPM"; + lpm_params.n_rules = 0; + + table = rte_table_lpm_ipv6_ops.f_create(&lpm_params, 0, entry_size); + if (table != NULL) + return -3; + lpm_params.n_rules = 1 << 24; lpm_params.number_tbl8s = 0; table = rte_table_lpm_ipv6_ops.f_create(&lpm_params, 0, entry_size); if (table != NULL) - return -2; + return -4; lpm_params.number_tbl8s = 1 << 21; lpm_params.entry_unique_size = 0; table = rte_table_lpm_ipv6_ops.f_create(&lpm_params, 0, entry_size); if (table != NULL) - return -2; + return -5; lpm_params.entry_unique_size = entry_size + 1; table = rte_table_lpm_ipv6_ops.f_create(&lpm_params, 0, entry_size); if (table != NULL) - return -2; + return -6; lpm_params.entry_unique_size = entry_size; lpm_params.offset = 32; table = rte_table_lpm_ipv6_ops.f_create(&lpm_params, 0, entry_size); if (table == NULL) - return -3; + return -7; /* Free */ status = rte_table_lpm_ipv6_ops.f_free(table); if (status < 0) - return -4; + return -8; status = rte_table_lpm_ipv6_ops.f_free(NULL); if (status == 0) - return -5; + return -9; /* Add */ struct rte_table_lpm_ipv6_key lpm_key; @@ -537,80 +553,80 @@ test_table_lpm_ipv6(void) table = rte_table_lpm_ipv6_ops.f_create(&lpm_params, 0, entry_size); if (table == NULL) - return -6; + return -10; status = rte_table_lpm_ipv6_ops.f_add(NULL, &lpm_key, &entry, &key_found, &entry_ptr); if (status == 0) - return -7; + return -11; status = rte_table_lpm_ipv6_ops.f_add(table, NULL, &entry, &key_found, &entry_ptr); if (status == 0) - return -8; + return -12; status = rte_table_lpm_ipv6_ops.f_add(table, &lpm_key, NULL, &key_found, &entry_ptr); if (status == 0) - return -9; + return -13; lpm_key.depth = 0; status = rte_table_lpm_ipv6_ops.f_add(table, &lpm_key, &entry, &key_found, &entry_ptr); if (status == 0) - return -10; + return -14; lpm_key.depth = 129; status = rte_table_lpm_ipv6_ops.f_add(table, &lpm_key, &entry, &key_found, &entry_ptr); if (status == 0) - return -11; + return -15; lpm_key.depth = 16; status = rte_table_lpm_ipv6_ops.f_add(table, &lpm_key, &entry, &key_found, &entry_ptr); if (status != 0) - return -12; + return -16; /* Delete */ status = rte_table_lpm_ipv6_ops.f_delete(NULL, &lpm_key, &key_found, NULL); if (status == 0) - return -13; + return -17; status = rte_table_lpm_ipv6_ops.f_delete(table, NULL, &key_found, NULL); if (status == 0) - return -14; + return -18; lpm_key.depth = 0; status = rte_table_lpm_ipv6_ops.f_delete(table, &lpm_key, &key_found, NULL); if (status == 0) - return -15; + return -19; lpm_key.depth = 129; status = rte_table_lpm_ipv6_ops.f_delete(table, &lpm_key, &key_found, NULL); if (status == 0) - return -16; + return -20; lpm_key.depth = 16; status = rte_table_lpm_ipv6_ops.f_delete(table, &lpm_key, &key_found, NULL); if (status != 0) - return -17; + return -21; status = rte_table_lpm_ipv6_ops.f_delete(table, &lpm_key, &key_found, NULL); if (status != 0) - return -18; + return -22; /* Traffic flow */ entry = 'A'; status = rte_table_lpm_ipv6_ops.f_add(table, &lpm_key, &entry, &key_found, &entry_ptr); if (status < 0) - return -19; + return -23; for (i = 0; i < RTE_PORT_IN_BURST_SIZE_MAX; i++) if (i % 2 == 0) { @@ -622,7 +638,7 @@ test_table_lpm_ipv6(void) rte_table_lpm_ipv6_ops.f_lookup(table, mbufs, -1, &result_mask, (void **)entries); if (result_mask != expected_mask) - return -20; + return -24; /* Free resources */ for (i = 0; i < RTE_PORT_IN_BURST_SIZE_MAX; i++) -- 2.1.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 3/4] ip_pipeline: modify lpm table for routing pipeline 2015-09-08 10:11 [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 1/4] librte_table: modify LPM table parameter structure Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 2/4] app/test: modify table and pipeline test Jasvinder Singh @ 2015-09-08 10:11 ` Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 4/4] librte_table: modify release notes and deprecation notice Jasvinder Singh 2015-09-08 12:57 ` [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Dumitrescu, Cristian 4 siblings, 0 replies; 8+ messages in thread From: Jasvinder Singh @ 2015-09-08 10:11 UTC (permalink / raw) To: dev The name parameter has been defined in lpm table of routing pipeline. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> --- examples/ip_pipeline/pipeline/pipeline_routing_be.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/ip_pipeline/pipeline/pipeline_routing_be.c b/examples/ip_pipeline/pipeline/pipeline_routing_be.c index 1e817dd..06d3e65 100644 --- a/examples/ip_pipeline/pipeline/pipeline_routing_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_routing_be.c @@ -484,6 +484,7 @@ pipeline_routing_init(struct pipeline_params *params, p->n_tables = 1; { struct rte_table_lpm_params table_lpm_params = { + .name = p->name, .n_rules = p_rt->n_routes, .entry_unique_size = sizeof(struct routing_table_entry), .offset = p_rt->ip_da_offset, -- 2.1.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 4/4] librte_table: modify release notes and deprecation notice 2015-09-08 10:11 [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Jasvinder Singh ` (2 preceding siblings ...) 2015-09-08 10:11 ` [dpdk-dev] [PATCH 3/4] ip_pipeline: modify lpm table for routing pipeline Jasvinder Singh @ 2015-09-08 10:11 ` Jasvinder Singh 2015-09-08 12:57 ` [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Dumitrescu, Cristian 4 siblings, 0 replies; 8+ messages in thread From: Jasvinder Singh @ 2015-09-08 10:11 UTC (permalink / raw) To: dev The LIBABIVER number is incremented. The release notes is updated and the deprecation announce is removed. Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> --- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_2_2.rst | 4 +++- lib/librte_table/Makefile | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 5f6079b..ce6147e 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -62,9 +62,6 @@ Deprecation Notices as currently they are able to access any packet buffer location except the packet mbuf structure. -* librte_table LPM: A new parameter to hold the table name will be added to - the LPM table parameter structure. - * librte_table: New functions for table entry bulk add/delete will be added to the table operations structure. diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst index abe57b4..75fc1ab 100644 --- a/doc/guides/rel_notes/release_2_2.rst +++ b/doc/guides/rel_notes/release_2_2.rst @@ -44,6 +44,8 @@ ABI Changes * The LPM structure is changed. The deprecated field mem_location is removed. +* librte_table LPM: A new parameter to hold the table name will be added to + the LPM table parameter structure. Shared Library Versions ----------------------- @@ -76,6 +78,6 @@ The libraries prepended with a plus sign were incremented in this version. librte_reorder.so.1 librte_ring.so.1 librte_sched.so.1 - librte_table.so.1 + + librte_table.so.2 librte_timer.so.1 librte_vhost.so.1 diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile index c5b3eaf..7f02af3 100644 --- a/lib/librte_table/Makefile +++ b/lib/librte_table/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_table_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y -- 2.1.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table 2015-09-08 10:11 [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Jasvinder Singh ` (3 preceding siblings ...) 2015-09-08 10:11 ` [dpdk-dev] [PATCH 4/4] librte_table: modify release notes and deprecation notice Jasvinder Singh @ 2015-09-08 12:57 ` Dumitrescu, Cristian 2015-10-09 10:49 ` Thomas Monjalon 4 siblings, 1 reply; 8+ messages in thread From: Dumitrescu, Cristian @ 2015-09-08 12:57 UTC (permalink / raw) To: Singh, Jasvinder, dev > -----Original Message----- > From: Singh, Jasvinder > Sent: Tuesday, September 8, 2015 1:11 PM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian > Subject: [PATCH 0/4] librte_table: add name parameter to lpm table > > This patchset links to ABI change announced for librte_table. For lpm table, > name parameter has been included in LPM table parameters structure. > It will eventually allow applications to create more than one instances > of lpm table, if required. > Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table 2015-09-08 12:57 ` [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Dumitrescu, Cristian @ 2015-10-09 10:49 ` Thomas Monjalon 0 siblings, 0 replies; 8+ messages in thread From: Thomas Monjalon @ 2015-10-09 10:49 UTC (permalink / raw) To: Singh, Jasvinder; +Cc: dev 2015-09-08 12:57, Dumitrescu, Cristian: > From: Singh, Jasvinder > > This patchset links to ABI change announced for librte_table. For lpm table, > > name parameter has been included in LPM table parameters structure. > > It will eventually allow applications to create more than one instances > > of lpm table, if required. > > > > Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Applied, thanks ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 0/4]librte_port: modify macros to access packet meta-data @ 2015-09-11 13:35 roy.fan.zhang 2015-09-11 13:35 ` [dpdk-dev] [PATCH 2/4] app/test: modify table and pipeline test roy.fan.zhang 0 siblings, 1 reply; 8+ messages in thread From: roy.fan.zhang @ 2015-09-11 13:35 UTC (permalink / raw) To: dev From: Fan Zhang <roy.fan.zhang@intel.com> This patchset links to ABI change announced for librte_port. Macros to access the packet meta-data stored within the packet buffer has been adjusted to cover the packet mbuf structure. Fan Zhang (4): librte_port: modify macros to access packet meta-data app/test: modify table and pipeline test app/test_pipeline: modify pipeline test librte_port: modify release notes and deprecation notice app/test-pipeline/main.h | 2 ++ app/test-pipeline/pipeline_hash.c | 34 ++++++++++++++------------- app/test-pipeline/pipeline_lpm.c | 2 +- app/test-pipeline/pipeline_lpm_ipv6.c | 2 +- app/test/test_table.h | 8 +++++-- app/test/test_table_combined.c | 28 +++++++++++----------- app/test/test_table_pipeline.c | 3 ++- app/test/test_table_tables.c | 44 ++++++++++++++++++----------------- doc/guides/rel_notes/deprecation.rst | 5 ---- doc/guides/rel_notes/release_2_2.rst | 4 +++- lib/librte_port/Makefile | 2 +- lib/librte_port/rte_port.h | 2 +- 12 files changed, 72 insertions(+), 64 deletions(-) -- 2.1.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 2/4] app/test: modify table and pipeline test 2015-09-11 13:35 [dpdk-dev] [PATCH 0/4]librte_port: modify macros to access packet meta-data roy.fan.zhang @ 2015-09-11 13:35 ` roy.fan.zhang 0 siblings, 0 replies; 8+ messages in thread From: roy.fan.zhang @ 2015-09-11 13:35 UTC (permalink / raw) To: dev From: Fan Zhang <roy.fan.zhang@intel.com> Test_table has been modified to work on updated macros to access meta-data stored in the mbuf structure. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> --- app/test/test_table.h | 8 ++++++-- app/test/test_table_combined.c | 28 +++++++++++++-------------- app/test/test_table_pipeline.c | 3 ++- app/test/test_table_tables.c | 44 ++++++++++++++++++++++-------------------- 4 files changed, 45 insertions(+), 38 deletions(-) diff --git a/app/test/test_table.h b/app/test/test_table.h index accc6f8..2077893 100644 --- a/app/test/test_table.h +++ b/app/test/test_table.h @@ -78,6 +78,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,8 +88,10 @@ 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); \ diff --git a/app/test/test_table_combined.c b/app/test/test_table_combined.c index dd09da5..5da005b 100644 --- a/app/test/test_table_combined.c +++ b/app/test/test_table_combined.c @@ -295,7 +295,7 @@ test_table_lpm_combined(void) struct rte_table_lpm_params lpm_params = { .n_rules = 1 << 16, .entry_unique_size = 8, - .offset = 0, + .offset = APP_METADATA_OFFSET(0), }; struct rte_table_lpm_key lpm_key = { @@ -355,7 +355,7 @@ test_table_lpm_ipv6_combined(void) .n_rules = 1 << 16, .number_tbl8s = 1 << 13, .entry_unique_size = 8, - .offset = 32, + .offset = APP_METADATA_OFFSET(32), }; struct rte_table_lpm_ipv6_key lpm_ipv6_key = { @@ -417,8 +417,8 @@ test_table_hash8lru(void) .n_entries = 1<<24, .f_hash = pipeline_test_hash, .seed = 0, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), }; uint8_t key8lru[8]; @@ -475,8 +475,8 @@ test_table_hash16lru(void) .n_entries = 1<<16, .f_hash = pipeline_test_hash, .seed = 0, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), }; uint8_t key16lru[16]; @@ -533,8 +533,8 @@ test_table_hash32lru(void) .n_entries = 1<<16, .f_hash = pipeline_test_hash, .seed = 0, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), }; uint8_t key32lru[32]; @@ -592,8 +592,8 @@ test_table_hash8ext(void) .n_entries_ext = 1<<15, .f_hash = pipeline_test_hash, .seed = 0, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), }; uint8_t key8ext[8]; @@ -658,8 +658,8 @@ test_table_hash16ext(void) .n_entries_ext = 1<<15, .f_hash = pipeline_test_hash, .seed = 0, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), }; uint8_t key16ext[16]; @@ -724,8 +724,8 @@ test_table_hash32ext(void) .n_entries_ext = 1<<15, .f_hash = pipeline_test_hash, .seed = 0, - .signature_offset = 0, - .key_offset = 32, + .signature_offset = APP_METADATA_OFFSET(0), + .key_offset = APP_METADATA_OFFSET(32), }; uint8_t key32ext[32]; diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c index a0a9e04..ff07cda 100644 --- a/app/test/test_table_pipeline.c +++ b/app/test/test_table_pipeline.c @@ -457,7 +457,8 @@ test_pipeline_single_filter(int test_type, int expected_count) rte_panic("Failed to alloc mbuf from pool\n"); return -1; } - key = RTE_MBUF_METADATA_UINT8_PTR(m, 32); + key = RTE_MBUF_METADATA_UINT8_PTR(m, + APP_METADATA_OFFSET(32)); k32 = (uint32_t *) key; k32[0] = 0xadadadad >> (j % 2); diff --git a/app/test/test_table_tables.c b/app/test/test_table_tables.c index 566964b..581316e 100644 --- a/app/test/test_table_tables.c +++ b/app/test/test_table_tables.c @@ -52,8 +52,10 @@ table_test table_tests[] = { uint32_t *k32, *signature; \ uint8_t *key; \ mbuf = rte_pktmbuf_alloc(pool); \ - signature = RTE_MBUF_METADATA_UINT32_PTR(mbuf, 0); \ - key = RTE_MBUF_METADATA_UINT8_PTR(mbuf, 32); \ + signature = RTE_MBUF_METADATA_UINT32_PTR(mbuf, \ + APP_METADATA_OFFSET(0)); \ + key = RTE_MBUF_METADATA_UINT8_PTR(mbuf, \ + APP_METADATA_OFFSET(32)); \ memset(key, 0, 32); \ k32 = (uint32_t *) key; \ k32[0] = (value); \ @@ -206,7 +208,7 @@ test_table_array(void) /* Initialize params and create tables */ struct rte_table_array_params array_params = { .n_entries = 7, - .offset = 1 + .offset = APP_METADATA_OFFSET(1) }; table = rte_table_array_ops.f_create(NULL, 0, 1); @@ -226,13 +228,13 @@ test_table_array(void) return -3; array_params.n_entries = 1 << 24; - array_params.offset = 1; + array_params.offset = APP_METADATA_OFFSET(1); table = rte_table_array_ops.f_create(&array_params, 0, 1); if (table == NULL) return -4; - array_params.offset = 32; + array_params.offset = APP_METADATA_OFFSET(32); table = rte_table_array_ops.f_create(&array_params, 0, 1); if (table == NULL) @@ -324,7 +326,7 @@ test_table_lpm(void) struct rte_table_lpm_params lpm_params = { .n_rules = 1 << 24, .entry_unique_size = entry_size, - .offset = 1 + .offset = APP_METADATA_OFFSET(1) }; table = rte_table_lpm_ops.f_create(NULL, 0, entry_size); @@ -338,7 +340,7 @@ test_table_lpm(void) return -2; lpm_params.n_rules = 1 << 24; - lpm_params.offset = 32; + lpm_params.offset = APP_METADATA_OFFSET(32); lpm_params.entry_unique_size = 0; table = rte_table_lpm_ops.f_create(&lpm_params, 0, entry_size); @@ -481,7 +483,7 @@ test_table_lpm_ipv6(void) .n_rules = 1 << 24, .number_tbl8s = 1 << 21, .entry_unique_size = entry_size, - .offset = 32 + .offset = APP_METADATA_OFFSET(32) }; table = rte_table_lpm_ipv6_ops.f_create(NULL, 0, entry_size); @@ -512,7 +514,7 @@ test_table_lpm_ipv6(void) return -2; lpm_params.entry_unique_size = entry_size; - lpm_params.offset = 32; + lpm_params.offset = APP_METADATA_OFFSET(32); table = rte_table_lpm_ipv6_ops.f_create(&lpm_params, 0, entry_size); if (table == NULL) @@ -650,8 +652,8 @@ test_table_hash_lru_generic(struct rte_table_ops *ops) .n_entries = 1 << 10, .f_hash = pipeline_test_hash, .seed = 0, - .signature_offset = 1, - .key_offset = 32 + .signature_offset = APP_METADATA_OFFSET(1), + .key_offset = APP_METADATA_OFFSET(32) }; hash_params.n_entries = 0; @@ -661,20 +663,20 @@ test_table_hash_lru_generic(struct rte_table_ops *ops) return -1; hash_params.n_entries = 1 << 10; - hash_params.signature_offset = 1; + hash_params.signature_offset = APP_METADATA_OFFSET(1); table = ops->f_create(&hash_params, 0, 1); if (table == NULL) return -2; - hash_params.signature_offset = 0; - hash_params.key_offset = 1; + hash_params.signature_offset = APP_METADATA_OFFSET(0); + hash_params.key_offset = APP_METADATA_OFFSET(1); table = ops->f_create(&hash_params, 0, 1); if (table == NULL) return -3; - hash_params.key_offset = 32; + hash_params.key_offset = APP_METADATA_OFFSET(32); hash_params.f_hash = NULL; table = ops->f_create(&hash_params, 0, 1); @@ -765,8 +767,8 @@ test_table_hash_ext_generic(struct rte_table_ops *ops) .n_entries_ext = 1 << 4, .f_hash = pipeline_test_hash, .seed = 0, - .signature_offset = 1, - .key_offset = 32 + .signature_offset = APP_METADATA_OFFSET(1), + .key_offset = APP_METADATA_OFFSET(32) }; hash_params.n_entries = 0; @@ -782,19 +784,19 @@ test_table_hash_ext_generic(struct rte_table_ops *ops) return -2; hash_params.n_entries_ext = 1 << 4; - hash_params.signature_offset = 1; + hash_params.signature_offset = APP_METADATA_OFFSET(1); table = ops->f_create(&hash_params, 0, 1); if (table == NULL) return -2; - hash_params.signature_offset = 0; - hash_params.key_offset = 1; + hash_params.signature_offset = APP_METADATA_OFFSET(0); + hash_params.key_offset = APP_METADATA_OFFSET(1); table = ops->f_create(&hash_params, 0, 1); if (table == NULL) return -3; - hash_params.key_offset = 32; + hash_params.key_offset = APP_METADATA_OFFSET(32); hash_params.f_hash = NULL; table = ops->f_create(&hash_params, 0, 1); -- 2.1.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-10-09 10:50 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-09-08 10:11 [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 1/4] librte_table: modify LPM table parameter structure Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 2/4] app/test: modify table and pipeline test Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 3/4] ip_pipeline: modify lpm table for routing pipeline Jasvinder Singh 2015-09-08 10:11 ` [dpdk-dev] [PATCH 4/4] librte_table: modify release notes and deprecation notice Jasvinder Singh 2015-09-08 12:57 ` [dpdk-dev] [PATCH 0/4] librte_table: add name parameter to lpm table Dumitrescu, Cristian 2015-10-09 10:49 ` Thomas Monjalon 2015-09-11 13:35 [dpdk-dev] [PATCH 0/4]librte_port: modify macros to access packet meta-data roy.fan.zhang 2015-09-11 13:35 ` [dpdk-dev] [PATCH 2/4] app/test: modify table and pipeline test roy.fan.zhang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).