DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jasvinder Singh <jasvinder.singh@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/4] librte_table: modify LPM table parameter structure
Date: Tue,  8 Sep 2015 11:11:25 +0100	[thread overview]
Message-ID: <1441707088-18563-2-git-send-email-jasvinder.singh@intel.com> (raw)
In-Reply-To: <1441707088-18563-1-git-send-email-jasvinder.singh@intel.com>

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

  reply	other threads:[~2015-09-08 10:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441707088-18563-2-git-send-email-jasvinder.singh@intel.com \
    --to=jasvinder.singh@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).