From: Jasvinder Singh Date: Thu, 17 Sep 2015 16:03:19 +0000 (+0100) Subject: table: add name to LPM parameters X-Git-Tag: spdx-start~8394 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=f71c7fc0b9c73ce6e7057bdf5eb1815c1d26e7e8 table: add name to LPM parameters 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. The LIBABIVER number is incremented. The release notes is updated and the deprecation announcement is removed. Signed-off-by: Jasvinder Singh Acked-by: Cristian Dumitrescu --- diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index fa55117e8d..1f47e3dd97 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -50,9 +50,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 56876761f0..5a62bc67f9 100644 --- a/doc/guides/rel_notes/release_2_2.rst +++ b/doc/guides/rel_notes/release_2_2.rst @@ -98,6 +98,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 ----------------------- @@ -130,6 +132,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 c5b3eaf152..7f02af3c2a 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 diff --git a/lib/librte_table/rte_table_lpm.c b/lib/librte_table/rte_table_lpm.c index b218d64646..849d899602 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 c08c9580e4..06e8410213 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 ff4a9c26fd..e9bc6a702f 100644 --- a/lib/librte_table/rte_table_lpm_ipv6.c +++ b/lib/librte_table/rte_table_lpm_ipv6.c @@ -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, diff --git a/lib/librte_table/rte_table_lpm_ipv6.h b/lib/librte_table/rte_table_lpm_ipv6.h index 91fb0d8e8f..43aea399ed 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;