lpm6: fix size of tbl8 group
authorAlex Kiselev <alex@therouter.net>
Wed, 8 Apr 2020 13:07:30 +0000 (15:07 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 24 Apr 2020 17:19:44 +0000 (19:19 +0200)
Fixes: e480688dce6d ("lpm6: add incremental update on delete")
Cc: stable@dpdk.org
Signed-off-by: Alex Kiselev <alex@therouter.net>
Acked-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_lpm/rte_lpm6.c

index 1047efa..f5979fb 100644 (file)
@@ -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