void efrm_filter_resource_redirect(struct filter_resource *frs, struct vi_resource *vi) { struct efhw_nic *nic = frs->rs.rs_client->nic; int vi_instance; EFRM_ASSERT(frs != NULL); EFRM_ASSERT(vi != NULL); vi_instance = EFRM_RESOURCE_INSTANCE(vi->rs.rs_handle); if( frs->filter_idx >= 0 ) efhw_nic_ipfilter_redirect(nic, frs->filter_idx, vi_instance); efrm_vi_resource_release(frs->pt); frs->pt = vi; efrm_resource_ref(&frs->pt->rs); }
void efrm_filter_resource_free(struct filter_resource *frs) { struct efhw_nic *nic = frs->rs.rs_client->nic; int id; EFRM_RESOURCE_ASSERT_VALID(&frs->rs, 1); EFRM_TRACE("%s: " EFRM_RESOURCE_FMT, __func__, EFRM_RESOURCE_PRI_ARG(frs->rs.rs_handle)); efhw_nic_ipfilter_clear(nic, frs->filter_idx); frs->filter_idx = -1; efrm_vi_resource_release(frs->pt); /* Free this filter. */ id = EFRM_RESOURCE_INSTANCE(frs->rs.rs_handle); EFRM_VERIFY_EQ(kfifo_put(efrm_filter_manager->free_ids, (unsigned char *)&id, sizeof(id)), sizeof(id)); efrm_client_put(frs->rs.rs_client); EFRM_DO_DEBUG(memset(frs, 0, sizeof(*frs))); kfree(frs); }
static int free_ep(struct efx_vi_state *efx_state) { efrm_vi_resource_release(efx_state->vi_res); return 0; }