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: dc81ebbaca ("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>
This commit is contained in:
Wei Dai 2017-06-19 12:14:38 +08:00 committed by Thomas Monjalon
parent 058e2d294b
commit 9d042b3ee0

View File

@ -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,