summaryrefslogtreecommitdiff
path: root/lib/librte_lpm
diff options
context:
space:
mode:
authorWei Dai <wei.dai@intel.com>2017-06-19 12:14:38 +0800
committerThomas Monjalon <thomas@monjalon.net>2017-06-19 23:30:01 +0200
commit9d042b3ee0cc67e2db6cc81ef454113957793d2b (patch)
tree6b66b0a9cca49443a34782f9092e79ead5d86c8a /lib/librte_lpm
parent058e2d294bf9f726488644bf56f0db2c58c11532 (diff)
downloaddpdk-next-eventdev-9d042b3ee0cc67e2db6cc81ef454113957793d2b.zip
dpdk-next-eventdev-9d042b3ee0cc67e2db6cc81ef454113957793d2b.tar.gz
dpdk-next-eventdev-9d042b3ee0cc67e2db6cc81ef454113957793d2b.tar.xz
lpm: fix index of tbl8
From v20 to v1604, number of tbl8 can be up to 1<<24, (uint8_t) or (uint16_t) may truncate the number of index of tlb8 in v1604 and cause wrong number. Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field") Cc: stable@dpdk.org Signed-off-by: Wei Dai <wei.dai@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'lib/librte_lpm')
-rw-r--r--lib/librte_lpm/rte_lpm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 8c15c4c..978ac60 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -1034,7 +1034,7 @@ add_depth_big_v1604(struct rte_lpm *lpm, uint32_t ip_masked, uint8_t depth,
*/
struct rte_lpm_tbl_entry new_tbl24_entry = {
- .group_idx = (uint8_t)tbl8_group_index,
+ .group_idx = tbl8_group_index,
.valid = VALID,
.valid_group = 1,
.depth = 0,
@@ -1080,7 +1080,7 @@ add_depth_big_v1604(struct rte_lpm *lpm, uint32_t ip_masked, uint8_t depth,
*/
struct rte_lpm_tbl_entry new_tbl24_entry = {
- .group_idx = (uint8_t)tbl8_group_index,
+ .group_idx = tbl8_group_index,
.valid = VALID,
.valid_group = 1,
.depth = 0,