lpm: fix index of tbl8
PATCH 1/1 lpm: fix index of tbl8
Quoted 1 line
From v20 to v1604, number of tlb8 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")
Signed-off-by Wei Dai <[email protected]>
--- lib/librte_lpm/rte_lpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_lpm/rte_lpm.c +2 -2
@@ -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 ,
Signature · 1 line
2.7.4
Quoted 8 lines · Wei Dai
From v20 to v1604, number of tlb8 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")Signed-off-by Wei Dai <[email protected]>
Acked-by Bruce Richardson <[email protected]>
Thomas Monjalon
Applied19/06/2017 13:25, Bruce Richardson:
Quoted 11 lines · Wei Dai
Quoted 8 lines
From v20 to v1604, number of tlb8 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")Signed-off-by Wei Dai <[email protected]>Acked-by Bruce Richardson <[email protected]>
Applied, thanks