librte_table: add name parameter to lpm table
v2 cover 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.
Changes in v2:
- rte_table_lpm_ipv6.c: removed name varibale from rte_zmalloc_socket() and inserted that in rte_lpm6_create().
Jasvinder Singh (4):
librte_table: modify LPM table parameter structure 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(-)
Signature · 1 line
2.1.0
PATCH v2 1/4 librte_table: modify LPM table parameter structure
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.
--- 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(-)
lib/librte_table/rte_table_lpm.c +6 -2
@@ -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" );
lib/librte_table/rte_table_lpm.h +3 -0
@@ -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;
lib/librte_table/rte_table_lpm_ipv6.c +6 -2
@@ -109,7 +109,11 @@ 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 */
@@ -128,7 +132,7 @@ rte_table_lpm_ipv6_create(void *params, int socket_id, uint32_t entry_size) lpm6_config.max_rules = p->n_rules; lpm6_config.number_tbl8s = p->number_tbl8s; lpm6_config.flags =0 ; - lpm->lpm =rte_lpm6_create ("LPM IPv6" , socket_id, &lpm6_config); + lpm->lpm =rte_lpm6_create (p->name, socket_id, &lpm6_config);if (lpm->lpm ==NULL ) {rte_free (lpm); RTE_LOG(ERR, TABLE,
lib/librte_table/rte_table_lpm_ipv6.h +3 -0
@@ -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;
Signature · 1 line
2.1.0
PATCH v2 2/4 app/test: modify table and pipeline test
In reply to Jasvinder SinghLPM table and test-pipeline has been modified to
include name parameter of the lpm table.
--- 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(-)
app/test-pipeline/pipeline_lpm.c +1 -0
@@ -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 ),
app/test-pipeline/pipeline_lpm_ipv6.c +1 -0
@@ -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 =
app/test/test_table_combined.c +2 -0
@@ -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 ,
app/test/test_table_tables.c +59 -43
324 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH v2 3/4 ip_pipeline: modify lpm table for routing pipeline
In reply to Jasvinder SinghThe name parameter has been defined in lpm table of routing pipeline.
--- examples/ip_pipeline/pipeline/pipeline_routing_be.c | 1 + 1 file changed, 1 insertion(+)
examples/ip_pipeline/pipeline/pipeline_routing_be.c +1 -0
@@ -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,
Signature · 1 line
2.1.0
PATCH v2 4/4 librte_table: modify release notes and deprecation notice
In reply to Jasvinder SinghThe LIBABIVER number is incremented. The release notes is updated and the deprecation announcement is removed.
--- 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(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -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.
doc/guides/rel_notes/release_2_2.rst +3 -1
@@ -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
lib/librte_table/Makefile +1 -1
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_table_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y
Signature · 1 line
2.1.0
Quoted 9 lines
-----Original Message-----
From: Singh, Jasvinder
Sent: Thursday, September 17, 2015 7:03 PM
To: [email protected]
Cc: Dumitrescu, Cristian
Subject: [PATCH v2 0/4]librte_table: add name parameter to lpm table
Quoted 10 lines
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.Changes in v2:
-rte_table_lpm_ipv6.c: removed name varibale fromrte_zmalloc_socket()and inserted that inrte_lpm6_create().
Thomas Monjalon
Applied2015-09-17 16:13, Dumitrescu, Cristian:
Quoted 11 lines
From: Singh, Jasvinder
Quoted 8 lines
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.Changes in v2:
-rte_table_lpm_ipv6.c: removed name varibale fromrte_zmalloc_socket()and inserted that inrte_lpm6_create().
Applied, thanks