summaryrefslogtreecommitdiff
path: root/examples/ip_fragmentation
diff options
context:
space:
mode:
authorMichal Kobylinski <michalx.kobylinski@intel.com>2016-03-09 17:57:16 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-03-09 23:05:05 +0100
commitf1f7261838b38f57fb1b3e62d1f97164439d017d (patch)
treedc9d154d184f192397c9b62e797056f7c57a6190 /examples/ip_fragmentation
parentdc81ebbacaeb87d9dab302576ab676564c78557e (diff)
downloaddpdk-draft-windows-f1f7261838b38f57fb1b3e62d1f97164439d017d.zip
dpdk-draft-windows-f1f7261838b38f57fb1b3e62d1f97164439d017d.tar.gz
dpdk-draft-windows-f1f7261838b38f57fb1b3e62d1f97164439d017d.tar.xz
lpm: add a new config structure for IPv4
A new rte_lpm_config structure is used so LPM library will allocate exactly the amount of memory which is necessary to hold application’s rules. Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
Diffstat (limited to 'examples/ip_fragmentation')
-rw-r--r--examples/ip_fragmentation/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 0302b2c..8021702 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -721,6 +721,7 @@ init_mem(void)
struct rte_mempool *mp;
struct rte_lpm *lpm;
struct rte_lpm6 *lpm6;
+ struct rte_lpm_config lpm_config;
int socket;
unsigned lcore_id;
@@ -768,7 +769,11 @@ init_mem(void)
RTE_LOG(INFO, IP_FRAG, "Creating LPM table on socket %i\n", socket);
snprintf(buf, sizeof(buf), "IP_FRAG_LPM_%i", socket);
- lpm = rte_lpm_create(buf, socket, LPM_MAX_RULES, 0);
+ lpm_config.max_rules = LPM_MAX_RULES;
+ lpm_config.number_tbl8s = 256;
+ lpm_config.flags = 0;
+
+ lpm = rte_lpm_create(buf, socket, &lpm_config);
if (lpm == NULL) {
RTE_LOG(ERR, IP_FRAG, "Cannot create LPM table\n");
return -1;