Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixl/ixl_pf_main.c
Show First 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | case 1: | ||||
break; | break; | ||||
default: | default: | ||||
/* Should not happen */ | /* Should not happen */ | ||||
device_printf(dev, "Error setting I2C access functions\n"); | device_printf(dev, "Error setting I2C access functions\n"); | ||||
break; | break; | ||||
} | } | ||||
/* Print a subset of the capability information. */ | /* Print a subset of the capability information. */ | ||||
device_printf(dev, "PF-ID[%d]: VFs %d, MSIX %d, VF MSIX %d, QPs %d, %s\n", | device_printf(dev, | ||||
"PF-ID[%d]: VFs %d, MSI-X %d, VF MSI-X %d, QPs %d, %s\n", | |||||
hw->pf_id, hw->func_caps.num_vfs, hw->func_caps.num_msix_vectors, | hw->pf_id, hw->func_caps.num_vfs, hw->func_caps.num_msix_vectors, | ||||
hw->func_caps.num_msix_vectors_vf, hw->func_caps.num_tx_qp, | hw->func_caps.num_msix_vectors_vf, hw->func_caps.num_tx_qp, | ||||
(hw->func_caps.mdio_port_mode == 2) ? "I2C" : | (hw->func_caps.mdio_port_mode == 2) ? "I2C" : | ||||
(hw->func_caps.mdio_port_mode == 1 && pf->has_i2c) ? "MDIO & I2C" : | (hw->func_caps.mdio_port_mode == 1 && pf->has_i2c) ? "MDIO & I2C" : | ||||
(hw->func_caps.mdio_port_mode == 1) ? "MDIO dedicated" : | (hw->func_caps.mdio_port_mode == 1) ? "MDIO dedicated" : | ||||
"MDIO shared"); | "MDIO shared"); | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | if (icr0 & I40E_PFINT_ICR0_QUEUE_0_MASK) | ||||
return (FILTER_SCHEDULE_THREAD); | return (FILTER_SCHEDULE_THREAD); | ||||
else | else | ||||
return (FILTER_HANDLED); | return (FILTER_HANDLED); | ||||
} | } | ||||
/********************************************************************* | /********************************************************************* | ||||
* | * | ||||
* MSIX VSI Interrupt Service routine | * MSI-X VSI Interrupt Service routine | ||||
* | * | ||||
**********************************************************************/ | **********************************************************************/ | ||||
int | int | ||||
ixl_msix_que(void *arg) | ixl_msix_que(void *arg) | ||||
{ | { | ||||
struct ixl_rx_queue *rx_que = arg; | struct ixl_rx_queue *rx_que = arg; | ||||
++rx_que->irqs; | ++rx_que->irqs; | ||||
ixl_set_queue_rx_itr(rx_que); | ixl_set_queue_rx_itr(rx_que); | ||||
// ixl_set_queue_tx_itr(que); | // ixl_set_queue_tx_itr(que); | ||||
return (FILTER_SCHEDULE_THREAD); | return (FILTER_SCHEDULE_THREAD); | ||||
} | } | ||||
/********************************************************************* | /********************************************************************* | ||||
* | * | ||||
* MSIX Admin Queue Interrupt Service routine | * MSI-X Admin Queue Interrupt Service routine | ||||
* | * | ||||
**********************************************************************/ | **********************************************************************/ | ||||
int | int | ||||
ixl_msix_adminq(void *arg) | ixl_msix_adminq(void *arg) | ||||
{ | { | ||||
struct ixl_pf *pf = arg; | struct ixl_pf *pf = arg; | ||||
struct i40e_hw *hw = &pf->hw; | struct i40e_hw *hw = &pf->hw; | ||||
device_t dev = pf->dev; | device_t dev = pf->dev; | ||||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | reg = I40E_PFINT_ICR0_ENA_ECC_ERR_MASK | | ||||
I40E_PFINT_ICR0_ENA_VFLR_MASK | | I40E_PFINT_ICR0_ENA_VFLR_MASK | | ||||
I40E_PFINT_ICR0_ENA_PE_CRITERR_MASK | | I40E_PFINT_ICR0_ENA_PE_CRITERR_MASK | | ||||
I40E_PFINT_ICR0_ENA_PCI_EXCEPTION_MASK; | I40E_PFINT_ICR0_ENA_PCI_EXCEPTION_MASK; | ||||
wr32(hw, I40E_PFINT_ICR0_ENA, reg); | wr32(hw, I40E_PFINT_ICR0_ENA, reg); | ||||
/* | /* | ||||
* 0x7FF is the end of the queue list. | * 0x7FF is the end of the queue list. | ||||
* This means we won't use MSI-X vector 0 for a queue interrupt | * This means we won't use MSI-X vector 0 for a queue interrupt | ||||
* in MSIX mode. | * in MSI-X mode. | ||||
*/ | */ | ||||
wr32(hw, I40E_PFINT_LNKLST0, 0x7FF); | wr32(hw, I40E_PFINT_LNKLST0, 0x7FF); | ||||
/* Value is in 2 usec units, so 0x3E is 62*2 = 124 usecs. */ | /* Value is in 2 usec units, so 0x3E is 62*2 = 124 usecs. */ | ||||
wr32(hw, I40E_PFINT_ITR0(IXL_RX_ITR), 0x3E); | wr32(hw, I40E_PFINT_ITR0(IXL_RX_ITR), 0x3E); | ||||
wr32(hw, I40E_PFINT_DYN_CTL0, | wr32(hw, I40E_PFINT_DYN_CTL0, | ||||
I40E_PFINT_DYN_CTL0_SW_ITR_INDX_MASK | | I40E_PFINT_DYN_CTL0_SW_ITR_INDX_MASK | | ||||
I40E_PFINT_DYN_CTL0_INTENA_MSK_MASK); | I40E_PFINT_DYN_CTL0_INTENA_MSK_MASK); | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
ixl_free_pci_resources(struct ixl_pf *pf) | ixl_free_pci_resources(struct ixl_pf *pf) | ||||
{ | { | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
device_t dev = iflib_get_dev(vsi->ctx); | device_t dev = iflib_get_dev(vsi->ctx); | ||||
struct ixl_rx_queue *rx_que = vsi->rx_queues; | struct ixl_rx_queue *rx_que = vsi->rx_queues; | ||||
/* 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 msix VSI resources: | ** Release all MSI-X VSI resources: | ||||
*/ | */ | ||||
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 (pf->pci_mem != NULL) | if (pf->pci_mem != NULL) | ||||
bus_release_resource(dev, SYS_RES_MEMORY, | bus_release_resource(dev, SYS_RES_MEMORY, | ||||
PCIR_BAR(0), pf->pci_mem); | rman_get_rid(pf->pci_mem), pf->pci_mem); | ||||
} | } | ||||
void | void | ||||
ixl_add_ifmedia(struct ixl_vsi *vsi, u64 phy_types) | ixl_add_ifmedia(struct ixl_vsi *vsi, u64 phy_types) | ||||
{ | { | ||||
/* Display supported media types */ | /* Display supported media types */ | ||||
if (phy_types & (I40E_CAP_PHY_TYPE_100BASE_TX)) | if (phy_types & (I40E_CAP_PHY_TYPE_100BASE_TX)) | ||||
ifmedia_add(vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); | ifmedia_add(vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); | ||||
▲ Show 20 Lines • Show All 4,138 Lines • Show Last 20 Lines |