X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_lpm%2Frte_lpm6.c;h=37baabb26d6e236100f6ab00cff27fedfd19b850;hb=e2a94f9ad3ef949c0df3e63699bd4e381b5003d9;hp=1047efa8a583862004aa1f2d64dde484504be746;hpb=10c69730a4b4910b4d57c365329a6c26479d25cd;p=dpdk.git diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c index 1047efa8a5..37baabb26d 100644 --- a/lib/librte_lpm/rte_lpm6.c +++ b/lib/librte_lpm/rte_lpm6.c @@ -726,7 +726,8 @@ add_step(struct rte_lpm6 *lpm, struct rte_lpm6_tbl_entry *tbl, tbl8_group_start = tbl8_gindex * RTE_LPM6_TBL8_GROUP_NUM_ENTRIES; memset(&lpm->tbl8[tbl8_group_start], 0, - RTE_LPM6_TBL8_GROUP_NUM_ENTRIES); + RTE_LPM6_TBL8_GROUP_NUM_ENTRIES * + sizeof(struct rte_lpm6_tbl_entry)); /* init the new table's header: * save the reference to the owner table @@ -813,7 +814,7 @@ add_step(struct rte_lpm6 *lpm, struct rte_lpm6_tbl_entry *tbl, * * Returns: * 0 on success - * -ENOSPC not enought tbl8 left + * -ENOSPC not enough tbl8 left */ static int simulate_add(struct rte_lpm6 *lpm, const uint8_t *masked_ip, uint8_t depth) @@ -843,7 +844,7 @@ simulate_add(struct rte_lpm6 *lpm, const uint8_t *masked_ip, uint8_t depth) } if (tbl8_available(lpm) < total_need_tbl_nb) - /* not enought tbl8 to add a rule */ + /* not enough tbl8 to add a rule */ return -ENOSPC; return 0; @@ -1211,7 +1212,7 @@ rule_find_range(struct rte_lpm6 *lpm, const uint8_t *ip, uint8_t depth, /* minus top level */ depth -= 24; - /* interate through levels (tbl8s) + /* iterate through levels (tbl8s) * until we reach the last one */ while (depth > 8) {