lpm: fix free of data structure
authorRuifeng Wang <ruifeng.wang@arm.com>
Fri, 23 Oct 2020 09:38:17 +0000 (11:38 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Sat, 24 Oct 2020 17:08:06 +0000 (19:08 +0200)
The container structure should be freed instead of rte_lpm structure
after wrapping rte_lpm into internal structure __rte_lpm.

Fixes: 8a9f8564e9f9 ("lpm: implement RCU rule reclamation")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
lib/librte_lpm/rte_lpm.c

index 757436f..51a0ae5 100644 (file)
@@ -268,7 +268,7 @@ rte_lpm_free(struct rte_lpm *lpm)
                rte_rcu_qsbr_dq_delete(internal_lpm->dq);
        rte_free(lpm->tbl8);
        rte_free(lpm->rules_tbl);
-       rte_free(lpm);
+       rte_free(internal_lpm);
        rte_free(te);
 }