zebra: More memory free up on shutdown

a) nl_batch_tx_buf was not being freed
b) the mlag_fifo was not being freed
c) the vrf->ns_ctxt was not being freed

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-11-13 09:07:06 -05:00
parent 150e3ea26d
commit c416603235
3 changed files with 12 additions and 1 deletions

View file

@ -1924,8 +1924,11 @@ void kernel_terminate(struct zebra_ns *zns, bool complete)
/* During zebra shutdown, we need to leave the dataplane socket /* During zebra shutdown, we need to leave the dataplane socket
* around until all work is done. * around until all work is done.
*/ */
if (complete) if (complete) {
kernel_nlsock_fini(&zns->netlink_dplane_out); kernel_nlsock_fini(&zns->netlink_dplane_out);
XFREE(MTYPE_NL_BUF, nl_batch_tx_buf);
}
} }
/* /*

View file

@ -627,6 +627,8 @@ void zebra_mlag_init(void)
void zebra_mlag_terminate(void) void zebra_mlag_terminate(void)
{ {
stream_fifo_free(zrouter.mlag_info.mlag_fifo);
zrouter.mlag_info.mlag_fifo = NULL;
} }

View file

@ -265,6 +265,12 @@ static int zebra_vrf_delete(struct vrf *vrf)
otable_fini(&zvrf->other_tables); otable_fini(&zvrf->other_tables);
XFREE(MTYPE_ZEBRA_VRF, zvrf); XFREE(MTYPE_ZEBRA_VRF, zvrf);
if (vrf->ns_ctxt) {
ns_delete(vrf->ns_ctxt);
vrf->ns_ctxt = NULL;
}
vrf->info = NULL; vrf->info = NULL;
return 0; return 0;