summaryrefslogtreecommitdiff
path: root/examples/l3fwd-vf
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/l3fwd-vf
parentdc81ebbacaeb87d9dab302576ab676564c78557e (diff)
downloaddpdk-f1f7261838b38f57fb1b3e62d1f97164439d017d.zip
dpdk-f1f7261838b38f57fb1b3e62d1f97164439d017d.tar.gz
dpdk-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/l3fwd-vf')
-rw-r--r--examples/l3fwd-vf/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 193c3ab..034c22a 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -869,10 +869,16 @@ setup_lpm(int socketid)
int ret;
char s[64];
+ struct rte_lpm_config lpm_ipv4_config;
+
+ lpm_ipv4_config.max_rules = L3FWD_LPM_MAX_RULES;
+ lpm_ipv4_config.number_tbl8s = 256;
+ lpm_ipv4_config.flags = 0;
+
/* create the LPM table */
snprintf(s, sizeof(s), "L3FWD_LPM_%d", socketid);
- l3fwd_lookup_struct[socketid] = rte_lpm_create(s, socketid,
- L3FWD_LPM_MAX_RULES, 0);
+ l3fwd_lookup_struct[socketid] =
+ rte_lpm_create(s, socketid, &lpm_ipv4_config);
if (l3fwd_lookup_struct[socketid] == NULL)
rte_exit(EXIT_FAILURE, "Unable to create the l3fwd LPM table"
" on socket %d\n", socketid);