Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/if_ixl.c
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | |||||
static int ixl_if_mtu_set(if_ctx_t ctx, uint32_t mtu); | static int ixl_if_mtu_set(if_ctx_t ctx, uint32_t mtu); | ||||
static void ixl_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr); | static void ixl_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr); | ||||
static int ixl_if_media_change(if_ctx_t ctx); | static int ixl_if_media_change(if_ctx_t ctx); | ||||
static int ixl_if_promisc_set(if_ctx_t ctx, int flags); | static int ixl_if_promisc_set(if_ctx_t ctx, int flags); | ||||
static void ixl_if_timer(if_ctx_t ctx, uint16_t qid); | static void ixl_if_timer(if_ctx_t ctx, uint16_t qid); | ||||
static void ixl_if_vlan_register(if_ctx_t ctx, u16 vtag); | static void ixl_if_vlan_register(if_ctx_t ctx, u16 vtag); | ||||
static void ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag); | static void ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag); | ||||
static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt); | static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt); | ||||
static void ixl_if_vflr_handle(if_ctx_t ctx); | |||||
// static void ixl_if_link_intr_enable(if_ctx_t ctx); | |||||
static int ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); | static int ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); | ||||
static int ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); | static int ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); | ||||
#ifdef PCI_IOV | |||||
static void ixl_if_vflr_handle(if_ctx_t ctx); | |||||
#endif | |||||
/*** Other ***/ | /*** Other ***/ | ||||
static int ixl_mc_filter_apply(void *arg, struct ifmultiaddr *ifma, int); | static int ixl_mc_filter_apply(void *arg, struct ifmultiaddr *ifma, int); | ||||
static void ixl_save_pf_tunables(struct ixl_pf *); | static void ixl_save_pf_tunables(struct ixl_pf *); | ||||
static int ixl_allocate_pci_resources(struct ixl_pf *); | static int ixl_allocate_pci_resources(struct ixl_pf *); | ||||
/********************************************************************* | /********************************************************************* | ||||
* FreeBSD Device Interface Entry Points | * FreeBSD Device Interface Entry Points | ||||
*********************************************************************/ | *********************************************************************/ | ||||
static device_method_t ixl_methods[] = { | static device_method_t ixl_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_register, ixl_register), | DEVMETHOD(device_register, ixl_register), | ||||
DEVMETHOD(device_probe, iflib_device_probe), | DEVMETHOD(device_probe, iflib_device_probe), | ||||
DEVMETHOD(device_attach, iflib_device_attach), | DEVMETHOD(device_attach, iflib_device_attach), | ||||
DEVMETHOD(device_detach, iflib_device_detach), | DEVMETHOD(device_detach, iflib_device_detach), | ||||
DEVMETHOD(device_shutdown, iflib_device_shutdown), | DEVMETHOD(device_shutdown, iflib_device_shutdown), | ||||
#ifdef PCI_IOV | #ifdef PCI_IOV | ||||
DEVMETHOD(pci_iov_init, ixl_iov_init), | DEVMETHOD(pci_iov_init, iflib_device_iov_init), | ||||
DEVMETHOD(pci_iov_uninit, ixl_iov_uninit), | DEVMETHOD(pci_iov_uninit, iflib_device_iov_uninit), | ||||
DEVMETHOD(pci_iov_add_vf, ixl_add_vf), | DEVMETHOD(pci_iov_add_vf, iflib_device_iov_add_vf), | ||||
#endif | #endif | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
static driver_t ixl_driver = { | static driver_t ixl_driver = { | ||||
"ixl", ixl_methods, sizeof(struct ixl_pf), | "ixl", ixl_methods, sizeof(struct ixl_pf), | ||||
}; | }; | ||||
Show All 12 Lines | static device_method_t ixl_if_methods[] = { | ||||
DEVMETHOD(ifdi_shutdown, ixl_if_shutdown), | DEVMETHOD(ifdi_shutdown, ixl_if_shutdown), | ||||
DEVMETHOD(ifdi_suspend, ixl_if_suspend), | DEVMETHOD(ifdi_suspend, ixl_if_suspend), | ||||
DEVMETHOD(ifdi_resume, ixl_if_resume), | DEVMETHOD(ifdi_resume, ixl_if_resume), | ||||
DEVMETHOD(ifdi_init, ixl_if_init), | DEVMETHOD(ifdi_init, ixl_if_init), | ||||
DEVMETHOD(ifdi_stop, ixl_if_stop), | DEVMETHOD(ifdi_stop, ixl_if_stop), | ||||
DEVMETHOD(ifdi_msix_intr_assign, ixl_if_msix_intr_assign), | DEVMETHOD(ifdi_msix_intr_assign, ixl_if_msix_intr_assign), | ||||
DEVMETHOD(ifdi_intr_enable, ixl_if_enable_intr), | DEVMETHOD(ifdi_intr_enable, ixl_if_enable_intr), | ||||
DEVMETHOD(ifdi_intr_disable, ixl_if_disable_intr), | DEVMETHOD(ifdi_intr_disable, ixl_if_disable_intr), | ||||
//DEVMETHOD(ifdi_link_intr_enable, ixl_if_link_intr_enable), | |||||
DEVMETHOD(ifdi_rx_queue_intr_enable, ixl_if_rx_queue_intr_enable), | DEVMETHOD(ifdi_rx_queue_intr_enable, ixl_if_rx_queue_intr_enable), | ||||
DEVMETHOD(ifdi_tx_queue_intr_enable, ixl_if_tx_queue_intr_enable), | DEVMETHOD(ifdi_tx_queue_intr_enable, ixl_if_tx_queue_intr_enable), | ||||
DEVMETHOD(ifdi_tx_queues_alloc, ixl_if_tx_queues_alloc), | DEVMETHOD(ifdi_tx_queues_alloc, ixl_if_tx_queues_alloc), | ||||
DEVMETHOD(ifdi_rx_queues_alloc, ixl_if_rx_queues_alloc), | DEVMETHOD(ifdi_rx_queues_alloc, ixl_if_rx_queues_alloc), | ||||
DEVMETHOD(ifdi_queues_free, ixl_if_queues_free), | DEVMETHOD(ifdi_queues_free, ixl_if_queues_free), | ||||
DEVMETHOD(ifdi_update_admin_status, ixl_if_update_admin_status), | DEVMETHOD(ifdi_update_admin_status, ixl_if_update_admin_status), | ||||
DEVMETHOD(ifdi_multi_set, ixl_if_multi_set), | DEVMETHOD(ifdi_multi_set, ixl_if_multi_set), | ||||
DEVMETHOD(ifdi_mtu_set, ixl_if_mtu_set), | DEVMETHOD(ifdi_mtu_set, ixl_if_mtu_set), | ||||
DEVMETHOD(ifdi_media_status, ixl_if_media_status), | DEVMETHOD(ifdi_media_status, ixl_if_media_status), | ||||
DEVMETHOD(ifdi_media_change, ixl_if_media_change), | DEVMETHOD(ifdi_media_change, ixl_if_media_change), | ||||
DEVMETHOD(ifdi_promisc_set, ixl_if_promisc_set), | DEVMETHOD(ifdi_promisc_set, ixl_if_promisc_set), | ||||
DEVMETHOD(ifdi_timer, ixl_if_timer), | DEVMETHOD(ifdi_timer, ixl_if_timer), | ||||
DEVMETHOD(ifdi_vlan_register, ixl_if_vlan_register), | DEVMETHOD(ifdi_vlan_register, ixl_if_vlan_register), | ||||
DEVMETHOD(ifdi_vlan_unregister, ixl_if_vlan_unregister), | DEVMETHOD(ifdi_vlan_unregister, ixl_if_vlan_unregister), | ||||
DEVMETHOD(ifdi_get_counter, ixl_if_get_counter), | DEVMETHOD(ifdi_get_counter, ixl_if_get_counter), | ||||
DEVMETHOD(ifdi_vflr_handle, ixl_if_vflr_handle), | |||||
DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), | DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), | ||||
DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), | DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), | ||||
#ifdef PCI_IOV | |||||
DEVMETHOD(ifdi_iov_init, ixl_if_iov_init), | |||||
DEVMETHOD(ifdi_iov_uninit, ixl_if_iov_uninit), | |||||
DEVMETHOD(ifdi_iov_vf_add, ixl_if_iov_vf_add), | |||||
DEVMETHOD(ifdi_vflr_handle, ixl_if_vflr_handle), | |||||
#endif | |||||
// ifdi_led_func | // ifdi_led_func | ||||
// ifdi_debug | // ifdi_debug | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
static driver_t ixl_if_driver = { | static driver_t ixl_if_driver = { | ||||
"ixl_if", ixl_if_methods, sizeof(struct ixl_pf) | "ixl_if", ixl_if_methods, sizeof(struct ixl_pf) | ||||
}; | }; | ||||
/* | /* | ||||
** TUNEABLE PARAMETERS: | ** TUNEABLE PARAMETERS: | ||||
*/ | */ | ||||
static SYSCTL_NODE(_hw, OID_AUTO, ixl, CTLFLAG_RD, 0, | static SYSCTL_NODE(_hw, OID_AUTO, ixl, CTLFLAG_RD, 0, | ||||
"IXL driver parameters"); | "ixl driver parameters"); | ||||
/* | /* | ||||
* Leave this on unless you need to send flow control | * Leave this on unless you need to send flow control | ||||
* frames (or other control frames) from software | * frames (or other control frames) from software | ||||
*/ | */ | ||||
static int ixl_enable_tx_fc_filter = 1; | static int ixl_enable_tx_fc_filter = 1; | ||||
TUNABLE_INT("hw.ixl.enable_tx_fc_filter", | TUNABLE_INT("hw.ixl.enable_tx_fc_filter", | ||||
&ixl_enable_tx_fc_filter); | &ixl_enable_tx_fc_filter); | ||||
SYSCTL_INT(_hw_ixl, OID_AUTO, enable_tx_fc_filter, CTLFLAG_RDTUN, | SYSCTL_INT(_hw_ixl, OID_AUTO, enable_tx_fc_filter, CTLFLAG_RDTUN, | ||||
&ixl_enable_tx_fc_filter, 0, | &ixl_enable_tx_fc_filter, 0, | ||||
"Filter out packets with Ethertype 0x8808 from being sent out by non-HW sources"); | "Filter out packets with Ethertype 0x8808 from being sent out by non-HW sources"); | ||||
static int ixl_i2c_access_method = 0; | static int ixl_i2c_access_method = 0; | ||||
TUNABLE_INT("hw.ixl.i2c_access_method", | TUNABLE_INT("hw.ixl.i2c_access_method", | ||||
&ixl_i2c_access_method); | &ixl_i2c_access_method); | ||||
SYSCTL_INT(_hw_ixl, OID_AUTO, i2c_access_method, CTLFLAG_RDTUN, | SYSCTL_INT(_hw_ixl, OID_AUTO, i2c_access_method, CTLFLAG_RDTUN, | ||||
&ixl_i2c_access_method, 0, | &ixl_i2c_access_method, 0, | ||||
IXL_SYSCTL_HELP_I2C_METHOD); | IXL_SYSCTL_HELP_I2C_METHOD); | ||||
static int ixl_enable_vf_loopback = 1; | |||||
TUNABLE_INT("hw.ixl.enable_vf_loopback", | |||||
&ixl_enable_vf_loopback); | |||||
SYSCTL_INT(_hw_ixl, OID_AUTO, enable_vf_loopback, CTLFLAG_RDTUN, | |||||
&ixl_enable_vf_loopback, 0, | |||||
IXL_SYSCTL_HELP_VF_LOOPBACK); | |||||
/* | /* | ||||
* Different method for processing TX descriptor | * Different method for processing TX descriptor | ||||
* completion. | * completion. | ||||
*/ | */ | ||||
static int ixl_enable_head_writeback = 1; | static int ixl_enable_head_writeback = 1; | ||||
TUNABLE_INT("hw.ixl.enable_head_writeback", | TUNABLE_INT("hw.ixl.enable_head_writeback", | ||||
&ixl_enable_head_writeback); | &ixl_enable_head_writeback); | ||||
SYSCTL_INT(_hw_ixl, OID_AUTO, enable_head_writeback, CTLFLAG_RDTUN, | SYSCTL_INT(_hw_ixl, OID_AUTO, enable_head_writeback, CTLFLAG_RDTUN, | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
ixl_register(device_t dev) | ixl_register(device_t dev) | ||||
{ | { | ||||
return (ixl_sctx); | return (ixl_sctx); | ||||
} | } | ||||
static int | static int | ||||
ixl_allocate_pci_resources(struct ixl_pf *pf) | ixl_allocate_pci_resources(struct ixl_pf *pf) | ||||
{ | { | ||||
int rid; | |||||
struct i40e_hw *hw = &pf->hw; | |||||
device_t dev = iflib_get_dev(pf->vsi.ctx); | device_t dev = iflib_get_dev(pf->vsi.ctx); | ||||
struct i40e_hw *hw = &pf->hw; | |||||
int rid; | |||||
/* Map BAR0 */ | /* Map BAR0 */ | ||||
rid = PCIR_BAR(0); | rid = PCIR_BAR(0); | ||||
pf->pci_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, | pf->pci_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, | ||||
&rid, RF_ACTIVE); | &rid, RF_ACTIVE); | ||||
if (!(pf->pci_mem)) { | if (!(pf->pci_mem)) { | ||||
device_printf(dev, "Unable to allocate bus resource: PCI memory\n"); | device_printf(dev, "Unable to allocate bus resource: PCI memory\n"); | ||||
Show All 34 Lines | ixl_if_attach_pre(if_ctx_t ctx) | ||||
struct ixl_pf *pf; | struct ixl_pf *pf; | ||||
struct i40e_hw *hw; | struct i40e_hw *hw; | ||||
struct ixl_vsi *vsi; | struct ixl_vsi *vsi; | ||||
if_softc_ctx_t scctx; | if_softc_ctx_t scctx; | ||||
struct i40e_filter_control_settings filter; | struct i40e_filter_control_settings filter; | ||||
enum i40e_status_code status; | enum i40e_status_code status; | ||||
int error = 0; | int error = 0; | ||||
INIT_DEBUGOUT("ixl_if_attach_pre: begin"); | INIT_DBG_DEV(dev, "begin"); | ||||
/* Allocate, clear, and link in our primary soft structure */ | |||||
dev = iflib_get_dev(ctx); | dev = iflib_get_dev(ctx); | ||||
pf = iflib_get_softc(ctx); | pf = iflib_get_softc(ctx); | ||||
vsi = &pf->vsi; | vsi = &pf->vsi; | ||||
vsi->back = pf; | vsi->back = pf; | ||||
pf->dev = dev; | pf->dev = dev; | ||||
hw = &pf->hw; | hw = &pf->hw; | ||||
/* | vsi->dev = dev; | ||||
** Note this assumes we have a single embedded VSI, | |||||
** this could be enhanced later to allocate multiple | |||||
*/ | |||||
//vsi->dev = pf->dev; | |||||
vsi->hw = &pf->hw; | vsi->hw = &pf->hw; | ||||
vsi->id = 0; | vsi->id = 0; | ||||
vsi->num_vlans = 0; | vsi->num_vlans = 0; | ||||
vsi->ctx = ctx; | vsi->ctx = ctx; | ||||
vsi->media = iflib_get_media(ctx); | vsi->media = iflib_get_media(ctx); | ||||
vsi->shared = scctx = iflib_get_softc_ctx(ctx); | vsi->shared = scctx = iflib_get_softc_ctx(ctx); | ||||
/* Save tunable values */ | /* Save tunable values */ | ||||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | if (vsi->enable_head_writeback) { | ||||
scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] | scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] | ||||
* sizeof(struct i40e_tx_desc) + sizeof(u32), DBA_ALIGN); | * sizeof(struct i40e_tx_desc) + sizeof(u32), DBA_ALIGN); | ||||
scctx->isc_txrx = &ixl_txrx_hwb; | scctx->isc_txrx = &ixl_txrx_hwb; | ||||
} else { | } else { | ||||
scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] | scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] | ||||
* sizeof(struct i40e_tx_desc), DBA_ALIGN); | * sizeof(struct i40e_tx_desc), DBA_ALIGN); | ||||
scctx->isc_txrx = &ixl_txrx_dwb; | scctx->isc_txrx = &ixl_txrx_dwb; | ||||
} | } | ||||
scctx->isc_txrx->ift_legacy_intr = ixl_intr; | |||||
scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] | scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] | ||||
* sizeof(union i40e_32byte_rx_desc), DBA_ALIGN); | * sizeof(union i40e_32byte_rx_desc), DBA_ALIGN); | ||||
scctx->isc_msix_bar = PCIR_BAR(IXL_MSIX_BAR); | scctx->isc_msix_bar = PCIR_BAR(IXL_MSIX_BAR); | ||||
scctx->isc_tx_nsegments = IXL_MAX_TX_SEGS; | scctx->isc_tx_nsegments = IXL_MAX_TX_SEGS; | ||||
scctx->isc_tx_tso_segments_max = IXL_MAX_TSO_SEGS; | scctx->isc_tx_tso_segments_max = IXL_MAX_TSO_SEGS; | ||||
scctx->isc_tx_tso_size_max = IXL_TSO_SIZE; | scctx->isc_tx_tso_size_max = IXL_TSO_SIZE; | ||||
scctx->isc_tx_tso_segsize_max = IXL_MAX_DMA_SEG_SIZE; | scctx->isc_tx_tso_segsize_max = IXL_MAX_DMA_SEG_SIZE; | ||||
scctx->isc_rss_table_size = pf->hw.func_caps.rss_table_size; | scctx->isc_rss_table_size = pf->hw.func_caps.rss_table_size; | ||||
scctx->isc_tx_csum_flags = CSUM_OFFLOAD; | scctx->isc_tx_csum_flags = CSUM_OFFLOAD; | ||||
scctx->isc_capabilities = scctx->isc_capenable = IXL_CAPS; | scctx->isc_capabilities = scctx->isc_capenable = IXL_CAPS; | ||||
INIT_DEBUGOUT("ixl_if_attach_pre: end"); | INIT_DBG_DEV(dev, "end"); | ||||
return (0); | return (0); | ||||
err_mac_hmc: | err_mac_hmc: | ||||
i40e_shutdown_lan_hmc(hw); | i40e_shutdown_lan_hmc(hw); | ||||
err_get_cap: | err_get_cap: | ||||
i40e_shutdown_adminq(hw); | i40e_shutdown_adminq(hw); | ||||
err_out: | err_out: | ||||
ixl_free_pci_resources(pf); | ixl_free_pci_resources(pf); | ||||
err_pci_res: | err_pci_res: | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
ixl_if_attach_post(if_ctx_t ctx) | ixl_if_attach_post(if_ctx_t ctx) | ||||
{ | { | ||||
device_t dev; | device_t dev; | ||||
struct ixl_pf *pf; | struct ixl_pf *pf; | ||||
struct i40e_hw *hw; | struct i40e_hw *hw; | ||||
struct ixl_vsi *vsi; | struct ixl_vsi *vsi; | ||||
int error = 0; | int error = 0; | ||||
enum i40e_status_code status; | enum i40e_status_code status; | ||||
INIT_DEBUGOUT("ixl_if_attach_post: begin"); | INIT_DBG_DEV(dev, "begin"); | ||||
dev = iflib_get_dev(ctx); | dev = iflib_get_dev(ctx); | ||||
pf = iflib_get_softc(ctx); | pf = iflib_get_softc(ctx); | ||||
vsi = &pf->vsi; | vsi = &pf->vsi; | ||||
vsi->ifp = iflib_get_ifp(ctx); | vsi->ifp = iflib_get_ifp(ctx); | ||||
hw = &pf->hw; | hw = &pf->hw; | ||||
/* Save off determined number of queues for interface */ | |||||
vsi->num_rx_queues = vsi->shared->isc_nrxqsets; | |||||
vsi->num_tx_queues = vsi->shared->isc_ntxqsets; | |||||
/* Setup OS network interface / ifnet */ | /* Setup OS network interface / ifnet */ | ||||
if (ixl_setup_interface(dev, pf)) { | if (ixl_setup_interface(dev, pf)) { | ||||
device_printf(dev, "interface setup failed!\n"); | device_printf(dev, "interface setup failed!\n"); | ||||
error = EIO; | error = EIO; | ||||
goto err; | goto err; | ||||
} | } | ||||
/* Determine link state */ | /* Determine link state */ | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | #endif | ||||
return (0); | return (0); | ||||
err: | err: | ||||
INIT_DEBUGOUT("end: error %d", error); | INIT_DEBUGOUT("end: error %d", error); | ||||
/* ixl_if_detach() is called on error from this */ | /* ixl_if_detach() is called on error from this */ | ||||
return (error); | return (error); | ||||
} | } | ||||
/** | |||||
* XXX: iflib always ignores the return value of detach() | |||||
* -> This means that this isn't allowed to fail | |||||
*/ | |||||
static int | static int | ||||
ixl_if_detach(if_ctx_t ctx) | ixl_if_detach(if_ctx_t ctx) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct i40e_hw *hw = &pf->hw; | struct i40e_hw *hw = &pf->hw; | ||||
device_t dev = pf->dev; | device_t dev = pf->dev; | ||||
enum i40e_status_code status; | enum i40e_status_code status; | ||||
#if defined(PCI_IOV) || defined(IXL_IW) | #ifdef IXL_IW | ||||
int error; | int error; | ||||
#endif | #endif | ||||
INIT_DBG_DEV(dev, "begin"); | INIT_DBG_DEV(dev, "begin"); | ||||
#ifdef IXL_IW | #ifdef IXL_IW | ||||
if (ixl_enable_iwarp && pf->iw_enabled) { | if (ixl_enable_iwarp && pf->iw_enabled) { | ||||
error = ixl_iw_pf_detach(pf); | error = ixl_iw_pf_detach(pf); | ||||
if (error == EBUSY) { | if (error == EBUSY) { | ||||
device_printf(dev, "iwarp in use; stop it first.\n"); | device_printf(dev, "iwarp in use; stop it first.\n"); | ||||
return (error); | //return (error); | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
#ifdef PCI_IOV | |||||
error = pci_iov_detach(dev); | |||||
if (error != 0) { | |||||
device_printf(dev, "SR-IOV in use; detach first.\n"); | |||||
return (error); | |||||
} | |||||
#endif | |||||
/* Remove all previously allocated media types */ | /* Remove all previously allocated media types */ | ||||
ifmedia_removeall(vsi->media); | ifmedia_removeall(vsi->media); | ||||
/* Shutdown LAN HMC */ | /* Shutdown LAN HMC */ | ||||
if (hw->hmc.hmc_obj) { | if (hw->hmc.hmc_obj) { | ||||
status = i40e_shutdown_lan_hmc(hw); | status = i40e_shutdown_lan_hmc(hw); | ||||
if (status) | if (status) | ||||
device_printf(dev, | device_printf(dev, | ||||
Show All 11 Lines | #endif | ||||
ixl_pf_qmgr_destroy(&pf->qmgr); | ixl_pf_qmgr_destroy(&pf->qmgr); | ||||
ixl_free_pci_resources(pf); | ixl_free_pci_resources(pf); | ||||
ixl_free_mac_filters(vsi); | ixl_free_mac_filters(vsi); | ||||
INIT_DBG_DEV(dev, "end"); | INIT_DBG_DEV(dev, "end"); | ||||
return (0); | return (0); | ||||
} | } | ||||
/* TODO: Do shutdown-specific stuff here */ | |||||
static int | static int | ||||
ixl_if_shutdown(if_ctx_t ctx) | ixl_if_shutdown(if_ctx_t ctx) | ||||
{ | { | ||||
int error = 0; | int error = 0; | ||||
INIT_DEBUGOUT("ixl_if_shutdown: begin"); | INIT_DEBUGOUT("ixl_if_shutdown: begin"); | ||||
/* TODO: Call ixl_if_stop()? */ | /* TODO: Call ixl_if_stop()? */ | ||||
Show All 28 Lines | ixl_if_resume(if_ctx_t ctx) | ||||
/* Required after D3->D0 transition */ | /* Required after D3->D0 transition */ | ||||
if (ifp->if_flags & IFF_UP) | if (ifp->if_flags & IFF_UP) | ||||
ixl_if_init(ctx); | ixl_if_init(ctx); | ||||
return (0); | return (0); | ||||
} | } | ||||
/* Set Report Status queue fields to 0 */ | |||||
static void | |||||
ixl_init_tx_rsqs(struct ixl_vsi *vsi) | |||||
{ | |||||
if_softc_ctx_t scctx = vsi->shared; | |||||
struct ixl_tx_queue *tx_que; | |||||
int i, j; | |||||
for (i = 0, tx_que = vsi->tx_queues; i < vsi->num_tx_queues; i++, tx_que++) { | |||||
struct tx_ring *txr = &tx_que->txr; | |||||
txr->tx_rs_cidx = txr->tx_rs_pidx = txr->tx_cidx_processed = 0; | |||||
for (j = 0; j < scctx->isc_ntxd[0]; j++) | |||||
txr->tx_rsq[j] = QIDX_INVALID; | |||||
} | |||||
} | |||||
static void | |||||
ixl_init_tx_cidx(struct ixl_vsi *vsi) | |||||
{ | |||||
struct ixl_tx_queue *tx_que; | |||||
int i; | |||||
for (i = 0, tx_que = vsi->tx_queues; i < vsi->num_tx_queues; i++, tx_que++) { | |||||
struct tx_ring *txr = &tx_que->txr; | |||||
txr->tx_cidx_processed = 0; | |||||
} | |||||
} | |||||
void | void | ||||
ixl_if_init(if_ctx_t ctx) | ixl_if_init(if_ctx_t ctx) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct i40e_hw *hw = &pf->hw; | struct i40e_hw *hw = &pf->hw; | ||||
device_t dev = iflib_get_dev(ctx); | device_t dev = iflib_get_dev(ctx); | ||||
u8 tmpaddr[ETHER_ADDR_LEN]; | u8 tmpaddr[ETHER_ADDR_LEN]; | ||||
Show All 29 Lines | ixl_if_init(if_ctx_t ctx) | ||||
iflib_set_mac(ctx, hw->mac.addr); | iflib_set_mac(ctx, hw->mac.addr); | ||||
/* Prepare the VSI: rings, hmc contexts, etc... */ | /* Prepare the VSI: rings, hmc contexts, etc... */ | ||||
if (ixl_initialize_vsi(vsi)) { | if (ixl_initialize_vsi(vsi)) { | ||||
device_printf(dev, "initialize vsi failed!!\n"); | device_printf(dev, "initialize vsi failed!!\n"); | ||||
return; | return; | ||||
} | } | ||||
// TODO: Call iflib setup multicast filters here? | |||||
// It's called in ixgbe in D5213 | |||||
ixl_if_multi_set(ctx); | ixl_if_multi_set(ctx); | ||||
/* Set up RSS */ | /* Set up RSS */ | ||||
ixl_config_rss(pf); | ixl_config_rss(pf); | ||||
/* Set up MSI/X routing and the ITR settings */ | /* Set up MSI/X routing and the ITR settings */ | ||||
if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { | if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { | ||||
ixl_configure_queue_intr_msix(pf); | ixl_configure_queue_intr_msix(pf); | ||||
Show All 33 Lines | ixl_if_stop(if_ctx_t ctx) | ||||
// TODO: This may need to be reworked | // TODO: This may need to be reworked | ||||
#ifdef IXL_IW | #ifdef IXL_IW | ||||
/* Stop iWARP device */ | /* Stop iWARP device */ | ||||
if (ixl_enable_iwarp && pf->iw_enabled) | if (ixl_enable_iwarp && pf->iw_enabled) | ||||
ixl_iw_pf_stop(pf); | ixl_iw_pf_stop(pf); | ||||
#endif | #endif | ||||
ixl_disable_rings_intr(vsi); | ixl_disable_rings_intr(vsi); | ||||
ixl_disable_rings(vsi); | ixl_disable_rings(pf, vsi, &pf->qtag); | ||||
} | } | ||||
static int | static int | ||||
ixl_if_msix_intr_assign(if_ctx_t ctx, int msix) | ixl_if_msix_intr_assign(if_ctx_t ctx, int msix) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct ixl_rx_queue *rx_que = vsi->rx_queues; | struct ixl_rx_queue *rx_que = vsi->rx_queues; | ||||
struct ixl_tx_queue *tx_que = vsi->tx_queues; | struct ixl_tx_queue *tx_que = vsi->tx_queues; | ||||
int err, i, rid, vector = 0; | int err, i, rid, vector = 0; | ||||
char buf[16]; | char buf[16]; | ||||
MPASS(vsi->shared->isc_nrxqsets > 0); | |||||
MPASS(vsi->shared->isc_ntxqsets > 0); | |||||
/* Admin Que must use vector 0*/ | /* Admin Que must use vector 0*/ | ||||
rid = vector + 1; | rid = vector + 1; | ||||
err = iflib_irq_alloc_generic(ctx, &vsi->irq, rid, IFLIB_INTR_ADMIN, | err = iflib_irq_alloc_generic(ctx, &vsi->irq, rid, IFLIB_INTR_ADMIN, | ||||
ixl_msix_adminq, pf, 0, "aq"); | ixl_msix_adminq, pf, 0, "aq"); | ||||
if (err) { | if (err) { | ||||
iflib_irq_free(ctx, &vsi->irq); | iflib_irq_free(ctx, &vsi->irq); | ||||
device_printf(iflib_get_dev(ctx), | device_printf(iflib_get_dev(ctx), | ||||
"Failed to register Admin que handler"); | "Failed to register Admin Que handler"); | ||||
return (err); | return (err); | ||||
} | } | ||||
// TODO: Re-enable this at some point | /* Create soft IRQ for handling VFLRs */ | ||||
// iflib_softirq_alloc_generic(ctx, rid, IFLIB_INTR_IOV, pf, 0, "ixl_iov"); | iflib_softirq_alloc_generic(ctx, &pf->iov_irq, IFLIB_INTR_IOV, pf, 0, "iov"); | ||||
/* Now set up the stations */ | /* Now set up the stations */ | ||||
for (i = 0, vector = 1; i < vsi->num_rx_queues; i++, vector++, rx_que++) { | for (i = 0, vector = 1; i < vsi->shared->isc_nrxqsets; i++, vector++, rx_que++) { | ||||
rid = vector + 1; | rid = vector + 1; | ||||
snprintf(buf, sizeof(buf), "rxq%d", i); | snprintf(buf, sizeof(buf), "rxq%d", i); | ||||
err = iflib_irq_alloc_generic(ctx, &rx_que->que_irq, rid, | err = iflib_irq_alloc_generic(ctx, &rx_que->que_irq, rid, | ||||
IFLIB_INTR_RX, ixl_msix_que, rx_que, rx_que->rxr.me, buf); | IFLIB_INTR_RX, ixl_msix_que, rx_que, rx_que->rxr.me, buf); | ||||
/* XXX: Does the driver work as expected if there are fewer num_rx_queues than | /* XXX: Does the driver work as expected if there are fewer num_rx_queues than | ||||
* what's expected in the iflib context? */ | * what's expected in the iflib context? */ | ||||
if (err) { | if (err) { | ||||
device_printf(iflib_get_dev(ctx), | device_printf(iflib_get_dev(ctx), | ||||
"Failed to allocate q int %d err: %d", i, err); | "Failed to allocate queue RX int vector %d, err: %d\n", i, err); | ||||
vsi->num_rx_queues = i + 1; | vsi->num_rx_queues = i + 1; | ||||
goto fail; | goto fail; | ||||
} | } | ||||
rx_que->msix = vector; | rx_que->msix = vector; | ||||
} | } | ||||
bzero(buf, sizeof(buf)); | bzero(buf, sizeof(buf)); | ||||
for (i = 0; i < vsi->num_tx_queues; i++, tx_que++) { | for (i = 0; i < vsi->shared->isc_ntxqsets; i++, tx_que++) { | ||||
snprintf(buf, sizeof(buf), "txq%d", i); | snprintf(buf, sizeof(buf), "txq%d", i); | ||||
iflib_softirq_alloc_generic(ctx, | iflib_softirq_alloc_generic(ctx, | ||||
&vsi->rx_queues[i % vsi->num_rx_queues].que_irq, | &vsi->rx_queues[i % vsi->shared->isc_nrxqsets].que_irq, | ||||
IFLIB_INTR_TX, tx_que, tx_que->txr.me, buf); | IFLIB_INTR_TX, tx_que, tx_que->txr.me, buf); | ||||
/* TODO: Maybe call a strategy function for this to figure out which | /* TODO: Maybe call a strategy function for this to figure out which | ||||
* interrupts to map Tx queues to. I don't know if there's an immediately | * interrupts to map Tx queues to. I don't know if there's an immediately | ||||
* better way than this other than a user-supplied map, though. */ | * better way than this other than a user-supplied map, though. */ | ||||
tx_que->msix = (i % vsi->num_rx_queues) + 1; | tx_que->msix = (i % vsi->shared->isc_nrxqsets) + 1; | ||||
} | } | ||||
return (0); | return (0); | ||||
fail: | fail: | ||||
iflib_irq_free(ctx, &vsi->irq); | iflib_irq_free(ctx, &vsi->irq); | ||||
rx_que = vsi->rx_queues; | rx_que = vsi->rx_queues; | ||||
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(ctx, &rx_que->que_irq); | iflib_irq_free(ctx, &rx_que->que_irq); | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | ixl_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid) | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
ixl_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid) | ixl_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct i40e_hw *hw = vsi->hw; | struct i40e_hw *hw = vsi->hw; | ||||
struct ixl_tx_queue *tx_que = &vsi->tx_queues[txqid]; | struct ixl_tx_queue *tx_que = &vsi->tx_queues[txqid]; | ||||
ixl_enable_queue(hw, tx_que->msix - 1); | ixl_enable_queue(hw, tx_que->msix - 1); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
ixl_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int ntxqs, int ntxqsets) | ixl_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int ntxqs, int ntxqsets) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
if_softc_ctx_t scctx = vsi->shared; | if_softc_ctx_t scctx = vsi->shared; | ||||
struct ixl_tx_queue *que; | struct ixl_tx_queue *que; | ||||
// int i; | |||||
int i, j, error = 0; | int i, j, error = 0; | ||||
MPASS(vsi->num_tx_queues > 0); | MPASS(scctx->isc_ntxqsets > 0); | ||||
MPASS(ntxqs == 1); | MPASS(ntxqs == 1); | ||||
MPASS(vsi->num_tx_queues == ntxqsets); | MPASS(scctx->isc_ntxqsets == ntxqsets); | ||||
/* Allocate queue structure memory */ | /* Allocate queue structure memory */ | ||||
if (!(vsi->tx_queues = | if (!(vsi->tx_queues = | ||||
(struct ixl_tx_queue *) malloc(sizeof(struct ixl_tx_queue) *ntxqsets, M_IXL, M_NOWAIT | M_ZERO))) { | (struct ixl_tx_queue *) malloc(sizeof(struct ixl_tx_queue) *ntxqsets, M_IXL, M_NOWAIT | M_ZERO))) { | ||||
device_printf(iflib_get_dev(ctx), "Unable to allocate TX ring memory\n"); | device_printf(iflib_get_dev(ctx), "Unable to allocate TX ring memory\n"); | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
Show All 30 Lines | |||||
static int | static int | ||||
ixl_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int nrxqs, int nrxqsets) | ixl_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int nrxqs, int nrxqsets) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct ixl_rx_queue *que; | struct ixl_rx_queue *que; | ||||
int i, error = 0; | int i, error = 0; | ||||
MPASS(vsi->num_rx_queues > 0); | #ifdef INVARIANTS | ||||
if_softc_ctx_t scctx = vsi->shared; | |||||
MPASS(scctx->isc_nrxqsets > 0); | |||||
MPASS(nrxqs == 1); | MPASS(nrxqs == 1); | ||||
MPASS(vsi->num_rx_queues == nrxqsets); | MPASS(scctx->isc_nrxqsets == nrxqsets); | ||||
#endif | |||||
/* Allocate queue structure memory */ | /* Allocate queue structure memory */ | ||||
if (!(vsi->rx_queues = | if (!(vsi->rx_queues = | ||||
(struct ixl_rx_queue *) malloc(sizeof(struct ixl_rx_queue) * | (struct ixl_rx_queue *) malloc(sizeof(struct ixl_rx_queue) * | ||||
nrxqsets, M_IXL, M_NOWAIT | M_ZERO))) { | nrxqsets, M_IXL, M_NOWAIT | M_ZERO))) { | ||||
device_printf(iflib_get_dev(ctx), "Unable to allocate RX ring memory\n"); | device_printf(iflib_get_dev(ctx), "Unable to allocate RX ring memory\n"); | ||||
error = ENOMEM; | error = ENOMEM; | ||||
goto fail; | goto fail; | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | if (vsi->link_active == TRUE) { | ||||
iflib_link_state_change(vsi->ctx, LINK_STATE_DOWN, 0); | iflib_link_state_change(vsi->ctx, LINK_STATE_DOWN, 0); | ||||
#ifdef PCI_IOV | #ifdef PCI_IOV | ||||
ixl_broadcast_link_state(pf); | ixl_broadcast_link_state(pf); | ||||
#endif | #endif | ||||
} | } | ||||
} | } | ||||
} | } | ||||
static void | |||||
ixl_handle_lan_overflow_event(struct ixl_pf *pf, struct i40e_arq_event_info *e) | |||||
{ | |||||
device_t dev = pf->dev; | |||||
u32 rxq_idx, qtx_ctl; | |||||
rxq_idx = (e->desc.params.external.param0 & I40E_PRTDCB_RUPTQ_RXQNUM_MASK) >> | |||||
I40E_PRTDCB_RUPTQ_RXQNUM_SHIFT; | |||||
qtx_ctl = e->desc.params.external.param1; | |||||
gallatin: Please consider limiting this to a few prints. Otherwise, I anticipate this spamming the… | |||||
device_printf(dev, "LAN overflow event: global rxq_idx %d\n", rxq_idx); | |||||
device_printf(dev, "LAN overflow event: QTX_CTL 0x%08x\n", qtx_ctl); | |||||
} | |||||
static int | static int | ||||
ixl_process_adminq(struct ixl_pf *pf, u16 *pending) | ixl_process_adminq(struct ixl_pf *pf, u16 *pending) | ||||
{ | { | ||||
enum i40e_status_code status = I40E_SUCCESS; | enum i40e_status_code status = I40E_SUCCESS; | ||||
struct i40e_arq_event_info event; | struct i40e_arq_event_info event; | ||||
struct i40e_hw *hw = &pf->hw; | struct i40e_hw *hw = &pf->hw; | ||||
device_t dev = pf->dev; | device_t dev = pf->dev; | ||||
u16 opcode; | u16 opcode; | ||||
Show All 24 Lines | #ifdef PCI_IOV | ||||
ixl_handle_vf_msg(pf, &event); | ixl_handle_vf_msg(pf, &event); | ||||
#endif | #endif | ||||
break; | break; | ||||
/* | /* | ||||
* This should only occur on no-drop queues, which | * This should only occur on no-drop queues, which | ||||
* aren't currently configured. | * aren't currently configured. | ||||
*/ | */ | ||||
case i40e_aqc_opc_event_lan_overflow: | case i40e_aqc_opc_event_lan_overflow: | ||||
device_printf(dev, "LAN overflow event\n"); | ixl_handle_lan_overflow_event(pf, &event); | ||||
break; | break; | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
} while (*pending && (loop++ < IXL_ADM_LIMIT)); | } while (*pending && (loop++ < IXL_ADM_LIMIT)); | ||||
free(event.msg_buf, M_IXL); | free(event.msg_buf, M_IXL); | ||||
Show All 13 Lines | ixl_if_update_admin_status(if_ctx_t ctx) | ||||
u16 pending; | u16 pending; | ||||
if (pf->state & IXL_PF_STATE_ADAPTER_RESETTING) | if (pf->state & IXL_PF_STATE_ADAPTER_RESETTING) | ||||
ixl_handle_empr_reset(pf); | ixl_handle_empr_reset(pf); | ||||
if (pf->state & IXL_PF_STATE_MDD_PENDING) | if (pf->state & IXL_PF_STATE_MDD_PENDING) | ||||
ixl_handle_mdd_event(pf); | ixl_handle_mdd_event(pf); | ||||
#ifdef PCI_IOV | |||||
if (pf->state & IXL_PF_STATE_VF_RESET_REQ) | |||||
iflib_iov_intr_deferred(ctx); | |||||
#endif | |||||
ixl_process_adminq(pf, &pending); | ixl_process_adminq(pf, &pending); | ||||
ixl_update_link_status(pf); | ixl_update_link_status(pf); | ||||
ixl_update_stats_counters(pf); | |||||
/* | /* | ||||
* If there are still messages to process, reschedule ourselves. | * If there are still messages to process, reschedule ourselves. | ||||
* Otherwise, re-enable our interrupt and go to sleep. | * Otherwise, re-enable our interrupt and go to sleep. | ||||
*/ | */ | ||||
if (pending > 0) | if (pending > 0) | ||||
iflib_admin_intr_deferred(ctx); | iflib_admin_intr_deferred(ctx); | ||||
else | else | ||||
▲ Show 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | ixl_if_promisc_set(if_ctx_t ctx, int flags) | ||||
err = i40e_aq_set_vsi_multicast_promiscuous(hw, | err = i40e_aq_set_vsi_multicast_promiscuous(hw, | ||||
vsi->seid, multi, NULL); | vsi->seid, multi, NULL); | ||||
return (err); | return (err); | ||||
} | } | ||||
static void | static void | ||||
ixl_if_timer(if_ctx_t ctx, uint16_t qid) | ixl_if_timer(if_ctx_t ctx, uint16_t qid) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | |||||
//struct i40e_hw *hw = &pf->hw; | |||||
//struct ixl_tx_queue *que = &vsi->tx_queues[qid]; | |||||
#if 0 | |||||
u32 mask; | |||||
/* | |||||
** Check status of the queues | |||||
*/ | |||||
mask = (I40E_PFINT_DYN_CTLN_INTENA_MASK | | |||||
I40E_PFINT_DYN_CTLN_SWINT_TRIG_MASK); | |||||
/* If queue param has outstanding work, trigger sw irq */ | |||||
// TODO: TX queues in iflib don't use HW interrupts; does this do anything? | |||||
if (que->busy) | |||||
wr32(hw, I40E_PFINT_DYN_CTLN(que->txr.me), mask); | |||||
#endif | |||||
if (qid != 0) | if (qid != 0) | ||||
return; | return; | ||||
/* Fire off the adminq task */ | /* Fire off the adminq task */ | ||||
iflib_admin_intr_deferred(ctx); | iflib_admin_intr_deferred(ctx); | ||||
/* Update stats */ | |||||
ixl_update_stats_counters(pf); | |||||
} | } | ||||
static void | static void | ||||
ixl_if_vlan_register(if_ctx_t ctx, u16 vtag) | ixl_if_vlan_register(if_ctx_t ctx, u16 vtag) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct i40e_hw *hw = vsi->hw; | struct i40e_hw *hw = vsi->hw; | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | case IFCOUNTER_OQDROPS: | ||||
return (vsi->oqdrops); | return (vsi->oqdrops); | ||||
case IFCOUNTER_NOPROTO: | case IFCOUNTER_NOPROTO: | ||||
return (vsi->noproto); | return (vsi->noproto); | ||||
default: | default: | ||||
return (if_get_counter_default(ifp, cnt)); | return (if_get_counter_default(ifp, cnt)); | ||||
} | } | ||||
} | } | ||||
#ifdef PCI_IOV | |||||
static void | static void | ||||
ixl_if_vflr_handle(if_ctx_t ctx) | ixl_if_vflr_handle(if_ctx_t ctx) | ||||
{ | { | ||||
IXL_DEV_ERR(iflib_get_dev(ctx), ""); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
// TODO: call ixl_handle_vflr() | ixl_handle_vflr(pf); | ||||
} | } | ||||
#endif | |||||
static int | static int | ||||
ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req) | ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
if (pf->read_i2c_byte == NULL) | if (pf->read_i2c_byte == NULL) | ||||
return (EINVAL); | return (EINVAL); | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
device_t dev = pf->dev; | device_t dev = pf->dev; | ||||
/* Save tunable information */ | /* Save tunable information */ | ||||
pf->enable_tx_fc_filter = ixl_enable_tx_fc_filter; | pf->enable_tx_fc_filter = ixl_enable_tx_fc_filter; | ||||
pf->dbg_mask = ixl_core_debug_mask; | pf->dbg_mask = ixl_core_debug_mask; | ||||
pf->hw.debug_mask = ixl_shared_debug_mask; | pf->hw.debug_mask = ixl_shared_debug_mask; | ||||
pf->vsi.enable_head_writeback = !!(ixl_enable_head_writeback); | pf->vsi.enable_head_writeback = !!(ixl_enable_head_writeback); | ||||
pf->enable_vf_loopback = !!(ixl_enable_vf_loopback); | |||||
#if 0 | #if 0 | ||||
pf->dynamic_rx_itr = ixl_dynamic_rx_itr; | pf->dynamic_rx_itr = ixl_dynamic_rx_itr; | ||||
pf->dynamic_tx_itr = ixl_dynamic_tx_itr; | pf->dynamic_tx_itr = ixl_dynamic_tx_itr; | ||||
#endif | #endif | ||||
if (ixl_i2c_access_method > 3 || ixl_i2c_access_method < 0) | if (ixl_i2c_access_method > 3 || ixl_i2c_access_method < 0) | ||||
pf->i2c_access_method = 0; | pf->i2c_access_method = 0; | ||||
else | else | ||||
Show All 27 Lines |
Please consider limiting this to a few prints. Otherwise, I anticipate this spamming the console / messages log at some point for somebody.