void ib_cache_cleanup_one(struct ib_device *device) { /* The cleanup function unregisters the event handler, * waits for all in-progress workqueue elements and cleans * up the GID cache. This function should be called after * the device was removed from the devices list and all * clients were removed, so the cache exists but is * non-functional and shouldn't be updated anymore. */ ib_unregister_event_handler(&device->cache.event_handler); flush_workqueue(ib_wq); gid_table_cleanup_one(device); }
static void ib_cache_cleanup_one(struct ib_device *device) { int p; ib_unregister_event_handler(&device->cache.event_handler); flush_scheduled_work(); for (p = 0; p <= end_port(device) - start_port(device); ++p) { kfree(device->cache.pkey_cache[p]); kfree(device->cache.gid_cache[p]); } kfree(device->cache.pkey_cache); kfree(device->cache.gid_cache); }
/** * iser_free_device_ib_res - destroy/dealloc/dereg the DMA MR, * CQ and PD created with the device associated with the adapator. */ static void iser_free_device_ib_res(struct iser_device *device) { BUG_ON(device->mr == NULL); tasklet_kill(&device->cq_tasklet); (void)ib_unregister_event_handler(&device->event_handler); (void)ib_dereg_mr(device->mr); (void)ib_destroy_cq(device->tx_cq); (void)ib_destroy_cq(device->rx_cq); (void)ib_dealloc_pd(device->pd); device->mr = NULL; device->tx_cq = NULL; device->rx_cq = NULL; device->pd = NULL; }
static void ib_cache_cleanup_one(struct ib_device *device) { int p; ib_unregister_event_handler(&device->cache.event_handler); #ifdef XXX flush_scheduled_work(); #endif for (p = 0; p <= end_port(device) - start_port(device); ++p) { free(device->cache.pkey_cache[p], M_DEVBUF); free(device->cache.gid_cache[p], M_DEVBUF); } free(device->cache.pkey_cache, M_DEVBUF); free(device->cache.gid_cache, M_DEVBUF); free(device->cache.lmc_cache, M_DEVBUF); }
static void ib_cache_cleanup_one(struct ib_device *device) { int p; if (!(device->cache.pkey_cache && device->cache.gid_cache && device->cache.lmc_cache)) return; ib_unregister_event_handler(&device->cache.event_handler); flush_workqueue(ib_wq); for (p = 0; p <= end_port(device) - start_port(device); ++p) { kfree(device->cache.pkey_cache[p]); kfree(device->cache.gid_cache[p]); } kfree(device->cache.pkey_cache); kfree(device->cache.gid_cache); kfree(device->cache.lmc_cache); }
int rdma_library_exit(void) { ib_unregister_event_handler(&rdma_ib_device.ieh); ib_unregister_client(&rdma_ib_device.ibclient); return 0; }