/** * This function deinits lacp DB * * @return 0 when successful, otherwise ERROR */ int lacp_db_deinit(void) { int err = 0; cl_map_item_t *map_item; struct mlag_lacp_entry *lacp_entry; struct lacp_pending_entry *pending_entry; const cl_map_item_t *map_end = NULL; map_item = cl_qmap_head(&(mlag_lacp_db.port_map)); map_end = cl_qmap_end(&(mlag_lacp_db.port_map)); while (map_item != map_end) { lacp_entry = PARENT_STRUCT(map_item, struct mlag_lacp_entry, map_item); MAP_ITEM_DEINIT(&(mlag_lacp_db.port_pool), lacp_entry); map_item = cl_qmap_next(map_item); } cl_qmap_remove_all(&(mlag_lacp_db.port_map)); cl_qpool_destroy(&(mlag_lacp_db.port_pool)); map_item = cl_qmap_head(&(mlag_lacp_db.pending_map)); map_end = cl_qmap_end(&(mlag_lacp_db.pending_map)); while (map_item != map_end) { pending_entry = PARENT_STRUCT(map_item, struct lacp_pending_entry, map_item); MAP_ITEM_DEINIT(&(mlag_lacp_db.pending_pool), pending_entry); map_item = cl_qmap_next(map_item); } cl_qmap_remove_all(&(mlag_lacp_db.pending_map)); cl_qpool_destroy(&(mlag_lacp_db.pending_pool)); return err; }
void cl_disp_destroy(IN cl_dispatcher_t * const p_disp) { CL_ASSERT(p_disp); cl_spinlock_destroy(&p_disp->lock); /* Destroy the message pool */ cl_qpool_destroy(&p_disp->msg_pool); /* Destroy the pointer vector of registrants. */ cl_ptr_vector_destroy(&p_disp->reg_vec); }