From: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
To: dev@dpdk.org
Cc: Michal Kobylinski <michalx.kobylinski@intel.com>
Subject: [dpdk-dev] [PATCH] lib/table: fix wrong type of nht field
Date: Mon, 20 Jun 2016 12:10:24 +0200 [thread overview]
Message-ID: <1466417424-3148-1-git-send-email-michalx.k.jastrzebski@intel.com> (raw)
From: Michal Kobylinski <michalx.kobylinski@intel.com>
Change type of nht field from uint32_t to uint8_t and increase max of
next hops.
Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field")
Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
examples/ip_pipeline/pipeline/pipeline_routing_be.h | 2 +-
lib/librte_table/rte_table_lpm.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/examples/ip_pipeline/pipeline/pipeline_routing_be.h b/examples/ip_pipeline/pipeline/pipeline_routing_be.h
index 1276342..ea50896 100644
--- a/examples/ip_pipeline/pipeline/pipeline_routing_be.h
+++ b/examples/ip_pipeline/pipeline/pipeline_routing_be.h
@@ -42,7 +42,7 @@
* Pipeline argument parsing
*/
#ifndef PIPELINE_ROUTING_N_ROUTES_DEFAULT
-#define PIPELINE_ROUTING_N_ROUTES_DEFAULT 4096
+#define PIPELINE_ROUTING_N_ROUTES_DEFAULT 65536
#endif
enum pipeline_routing_encap {
diff --git a/lib/librte_table/rte_table_lpm.c b/lib/librte_table/rte_table_lpm.c
index cdeb0f5..f2eaed5 100644
--- a/lib/librte_table/rte_table_lpm.c
+++ b/lib/librte_table/rte_table_lpm.c
@@ -44,7 +44,7 @@
#include "rte_table_lpm.h"
-#define RTE_TABLE_LPM_MAX_NEXT_HOPS 256
+#define RTE_TABLE_LPM_MAX_NEXT_HOPS 65536
#ifdef RTE_TABLE_STATS_COLLECT
@@ -74,7 +74,7 @@ struct rte_table_lpm {
/* Next Hop Table (NHT) */
uint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS];
- uint32_t nht[0] __rte_cache_aligned;
+ uint8_t nht[0] __rte_cache_aligned;
};
static void *
@@ -188,7 +188,7 @@ nht_find_existing(struct rte_table_lpm *lpm, void *entry, uint32_t *pos)
uint32_t i;
for (i = 0; i < RTE_TABLE_LPM_MAX_NEXT_HOPS; i++) {
- uint32_t *nht_entry = &lpm->nht[i * lpm->entry_size];
+ uint8_t *nht_entry = &lpm->nht[i * lpm->entry_size];
if ((lpm->nht_users[i] > 0) && (memcmp(nht_entry, entry,
lpm->entry_unique_size) == 0)) {
@@ -242,7 +242,7 @@ rte_table_lpm_entry_add(
/* Find existing or free NHT entry */
if (nht_find_existing(lpm, entry, &nht_pos) == 0) {
- uint32_t *nht_entry;
+ uint8_t *nht_entry;
if (nht_find_free(lpm, &nht_pos) == 0) {
RTE_LOG(ERR, TABLE, "%s: NHT full\n", __func__);
--
1.9.1
next reply other threads:[~2016-06-20 10:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 10:10 Michal Jastrzebski [this message]
2016-06-20 10:13 ` Thomas Monjalon
2016-06-21 11:16 ` Dumitrescu, Cristian
2016-06-21 11:20 ` Dumitrescu, Cristian
2016-06-21 12:27 ` [dpdk-dev] [PATCH v2] " Michal Kobylinski
2016-06-21 13:09 ` Dumitrescu, Cristian
2016-06-21 13:15 ` Thomas Monjalon
2016-06-21 13:21 ` Dumitrescu, Cristian
2016-06-21 13:20 ` [dpdk-dev] [PATCH v3] " Michal Kobylinski
2016-06-21 20:43 ` 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=1466417424-3148-1-git-send-email-michalx.k.jastrzebski@intel.com \
--to=michalx.k.jastrzebski@intel.com \
--cc=dev@dpdk.org \
--cc=michalx.kobylinski@intel.com \
/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).