Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixl/if_iavf.c
Show First 20 Lines • Show All 352 Lines • ▼ Show 20 Lines | iavf_if_attach_pre(if_ctx_t ctx) | ||||
/* Do PCI setup - map BAR0, etc */ | /* Do PCI setup - map BAR0, etc */ | ||||
if (iavf_allocate_pci_resources(sc)) { | if (iavf_allocate_pci_resources(sc)) { | ||||
device_printf(dev, "%s: Allocation of PCI resources failed\n", | device_printf(dev, "%s: Allocation of PCI resources failed\n", | ||||
__func__); | __func__); | ||||
error = ENXIO; | error = ENXIO; | ||||
goto err_early; | goto err_early; | ||||
} | } | ||||
iavf_dbg_init(sc, "Allocated PCI resources and MSIX vectors\n"); | iavf_dbg_init(sc, "Allocated PCI resources and MSI-X vectors\n"); | ||||
/* | /* | ||||
* XXX: This is called by init_shared_code in the PF driver, | * XXX: This is called by init_shared_code in the PF driver, | ||||
* but the rest of that function does not support VFs. | * but the rest of that function does not support VFs. | ||||
*/ | */ | ||||
error = i40e_set_mac_type(hw); | error = i40e_set_mac_type(hw); | ||||
if (error) { | if (error) { | ||||
device_printf(dev, "%s: set_mac_type failed: %d\n", | device_printf(dev, "%s: set_mac_type failed: %d\n", | ||||
Show All 32 Lines | iavf_if_attach_pre(if_ctx_t ctx) | ||||
/* Ask for VF config from PF */ | /* Ask for VF config from PF */ | ||||
error = iavf_vf_config(sc); | error = iavf_vf_config(sc); | ||||
if (error) { | if (error) { | ||||
device_printf(dev, "Error getting configuration from PF: %d\n", | device_printf(dev, "Error getting configuration from PF: %d\n", | ||||
error); | error); | ||||
goto err_aq; | goto err_aq; | ||||
} | } | ||||
device_printf(dev, "VSIs %d, QPs %d, MSIX %d, RSS sizes: key %d lut %d\n", | device_printf(dev, | ||||
"VSIs %d, QPs %d, MSI-X %d, RSS sizes: key %d lut %d\n", | |||||
sc->vf_res->num_vsis, | sc->vf_res->num_vsis, | ||||
sc->vf_res->num_queue_pairs, | sc->vf_res->num_queue_pairs, | ||||
sc->vf_res->max_vectors, | sc->vf_res->max_vectors, | ||||
sc->vf_res->rss_key_size, | sc->vf_res->rss_key_size, | ||||
sc->vf_res->rss_lut_size); | sc->vf_res->rss_lut_size); | ||||
iavf_dbg_info(sc, "Capabilities=%b\n", | iavf_dbg_info(sc, "Capabilities=%b\n", | ||||
sc->vf_res->vf_cap_flags, IAVF_PRINTF_VF_OFFLOAD_FLAGS); | sc->vf_res->vf_cap_flags, IAVF_PRINTF_VF_OFFLOAD_FLAGS); | ||||
▲ Show 20 Lines • Show All 1,061 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
iavf_free_pci_resources(struct iavf_sc *sc) | iavf_free_pci_resources(struct iavf_sc *sc) | ||||
{ | { | ||||
struct ixl_vsi *vsi = &sc->vsi; | struct ixl_vsi *vsi = &sc->vsi; | ||||
struct ixl_rx_queue *rx_que = vsi->rx_queues; | struct ixl_rx_queue *rx_que = vsi->rx_queues; | ||||
device_t dev = sc->dev; | device_t dev = sc->dev; | ||||
/* We may get here before stations are setup */ | /* We may get here before stations are set up */ | ||||
if (rx_que == NULL) | if (rx_que == NULL) | ||||
goto early; | goto early; | ||||
/* Release all interrupts */ | /* Release all interrupts */ | ||||
iflib_irq_free(vsi->ctx, &vsi->irq); | iflib_irq_free(vsi->ctx, &vsi->irq); | ||||
for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++) | for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++) | ||||
iflib_irq_free(vsi->ctx, &rx_que->que_irq); | iflib_irq_free(vsi->ctx, &rx_que->que_irq); | ||||
early: | early: | ||||
if (sc->pci_mem != NULL) | if (sc->pci_mem != NULL) | ||||
bus_release_resource(dev, SYS_RES_MEMORY, | bus_release_resource(dev, SYS_RES_MEMORY, | ||||
PCIR_BAR(0), sc->pci_mem); | rman_get_rid(sc->pci_mem), sc->pci_mem); | ||||
} | } | ||||
/* | /* | ||||
** Requests a VF reset from the PF. | ** Requests a VF reset from the PF. | ||||
** | ** | ||||
** Requires the VF's Admin Queue to be initialized. | ** Requires the VF's Admin Queue to be initialized. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 925 Lines • Show Last 20 Lines |