FreeBSD/sys/dev/ixl/if_ixlv.c
/*********************************************************************
 *
 *  Free all station queue structs.
 *
 **********************************************************************/
Free all station queue structs.
Free all station queue structs .
static void
ixlv_free_queues(struct ixl_vsi *vsi)
{
	struct ixlv_sc	*sc = (struct ixlv_sc *)vsi->back;
	struct ixl_queue	*que = vsi->queues;
	for (int i = 0; i < vsi->num_queues; i++, que++) {
		struct tx_ring *txr = &que->txr;
		struct rx_ring *rxr = &que->rxr;
		if (!mtx_initialized(&txr->mtx)) 
			continue;
		IXL_TX_LOCK(txr);
		ixl_free_que_tx(que);
		if (txr->base)
			i40e_free_dma_mem(&sc->hw, &txr->dma);
		IXL_TX_UNLOCK(txr);
		IXL_TX_LOCK_DESTROY(txr);
		if (!mtx_initialized(&rxr->mtx)) 
			continue;
		IXL_RX_LOCK(rxr);
		ixl_free_que_rx(que);
		if (rxr->base)
			i40e_free_dma_mem(&sc->hw, &rxr->dma);
		IXL_RX_UNLOCK(rxr);
		IXL_RX_LOCK_DESTROY(rxr);
	}
	free(vsi->queues, M_DEVBUF);
}
static void ixlv_free_queues ( struct ixl_vsi * vsi ) { struct ixlv_sc * sc = ( struct ixlv_sc * ) vsi -> back ; struct ixl_queue * que = vsi -> queues ; for ( int i = 0 ; i < vsi -> num_queues ; i ++ , que ++ ) { struct tx_ring * txr = & que -> txr ; struct rx_ring * rxr = & que -> rxr ; if ( ! mtx_initialized ( & txr -> mtx ) ) continue ; IXL_TX_LOCK ( txr ) ; ixl_free_que_tx ( que ) ; if ( txr -> base ) i40e_free_dma_mem ( & sc -> hw , & txr -> dma ) ; IXL_TX_UNLOCK ( txr ) ; IXL_TX_LOCK_DESTROY ( txr ) ; if ( ! mtx_initialized ( & rxr -> mtx ) ) continue ; IXL_RX_LOCK ( rxr ) ; ixl_free_que_rx ( que ) ; if ( rxr -> base ) i40e_free_dma_mem ( & sc -> hw , & rxr -> dma ) ; IXL_RX_UNLOCK ( rxr ) ; IXL_RX_LOCK_DESTROY ( rxr ) ; } free ( vsi -> queues , M_DEVBUF ) ; }
Free all station queue structs.
Free all station queue structs .
/* uninitialized */ /* uninitialized */