Changeset View
Standalone View
sys/dev/e1000/if_em.c
Show First 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | |||||
static int igb_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); | static int igb_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); | ||||
static int igb_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); | static int igb_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); | ||||
static void em_if_multi_set(if_ctx_t ctx); | static void em_if_multi_set(if_ctx_t ctx); | ||||
static void em_if_update_admin_status(if_ctx_t ctx); | static void em_if_update_admin_status(if_ctx_t ctx); | ||||
static void em_if_debug(if_ctx_t ctx); | static void em_if_debug(if_ctx_t ctx); | ||||
static void em_update_stats_counters(struct adapter *); | static void em_update_stats_counters(struct adapter *); | ||||
static void em_add_hw_stats(struct adapter *adapter); | static void em_add_hw_stats(struct adapter *adapter); | ||||
static int em_if_set_promisc(if_ctx_t ctx, int flags); | static int em_if_set_promisc(if_ctx_t ctx, int flags); | ||||
static bool em_if_vlan_filter_capable(struct adapter *); | |||||
static bool em_if_vlan_filter_used(struct adapter *); | |||||
static void em_if_vlan_filter_enable(struct adapter *); | |||||
static void em_if_vlan_filter_disable(struct adapter *); | |||||
static void em_if_vlan_filter_write(struct adapter *); | |||||
static void em_setup_vlan_hw_support(struct adapter *); | static void em_setup_vlan_hw_support(struct adapter *); | ||||
static int em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); | static int em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); | ||||
static void em_print_nvm_info(struct adapter *); | static void em_print_nvm_info(struct adapter *); | ||||
static int em_sysctl_debug_info(SYSCTL_HANDLER_ARGS); | static int em_sysctl_debug_info(SYSCTL_HANDLER_ARGS); | ||||
static int em_get_rs(SYSCTL_HANDLER_ARGS); | static int em_get_rs(SYSCTL_HANDLER_ARGS); | ||||
static void em_print_debug_info(struct adapter *); | static void em_print_debug_info(struct adapter *); | ||||
static int em_is_valid_ether_addr(u8 *); | static int em_is_valid_ether_addr(u8 *); | ||||
static int em_sysctl_int_delay(SYSCTL_HANDLER_ARGS); | static int em_sysctl_int_delay(SYSCTL_HANDLER_ARGS); | ||||
▲ Show 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | if (hw->mac.type >= igb_mac_min) { | ||||
scctx->isc_rxqsizes[0] = roundup2((scctx->isc_nrxd[0] + 1) * sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); | scctx->isc_rxqsizes[0] = roundup2((scctx->isc_nrxd[0] + 1) * sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); | ||||
scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); | scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); | ||||
scctx->isc_rxd_size[0] = sizeof(struct e1000_rx_desc); | scctx->isc_rxd_size[0] = sizeof(struct e1000_rx_desc); | ||||
scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; | scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; | ||||
scctx->isc_txrx = &lem_txrx; | scctx->isc_txrx = &lem_txrx; | ||||
scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; | scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; | ||||
if (hw->mac.type < e1000_82543) | if (hw->mac.type < e1000_82543) | ||||
scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); | scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); | ||||
/* 82541ER doesn't do HW tagging */ | |||||
if (hw->device_id == E1000_DEV_ID_82541ER || hw->device_id == E1000_DEV_ID_82541ER_LOM) | |||||
scctx->isc_capenable &= ~IFCAP_VLAN_HWTAGGING; | |||||
/* INTx only */ | /* INTx only */ | ||||
scctx->isc_msix_bar = 0; | scctx->isc_msix_bar = 0; | ||||
} | } | ||||
/* Setup PCI resources */ | /* Setup PCI resources */ | ||||
if (em_allocate_pci_resources(ctx)) { | if (em_allocate_pci_resources(ctx)) { | ||||
device_printf(dev, "Allocation of PCI resources failed\n"); | device_printf(dev, "Allocation of PCI resources failed\n"); | ||||
error = ENXIO; | error = ENXIO; | ||||
▲ Show 20 Lines • Show All 419 Lines • ▼ Show 20 Lines | em_if_init(if_ctx_t ctx) | ||||
em_initialize_transmit_unit(ctx); | em_initialize_transmit_unit(ctx); | ||||
/* Setup Multicast table */ | /* Setup Multicast table */ | ||||
em_if_multi_set(ctx); | em_if_multi_set(ctx); | ||||
adapter->rx_mbuf_sz = iflib_get_rx_mbuf_sz(ctx); | adapter->rx_mbuf_sz = iflib_get_rx_mbuf_sz(ctx); | ||||
em_initialize_receive_unit(ctx); | em_initialize_receive_unit(ctx); | ||||
/* Use real VLAN Filter support? */ | /* Set up VLAN support and filter */ | ||||
if (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) { | |||||
if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) | |||||
/* Use real VLAN Filter support */ | |||||
em_setup_vlan_hw_support(adapter); | em_setup_vlan_hw_support(adapter); | ||||
else { | |||||
u32 ctrl; | |||||
ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); | |||||
ctrl |= E1000_CTRL_VME; | |||||
E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); | |||||
} | |||||
} else { | |||||
u32 ctrl; | |||||
ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); | |||||
ctrl &= ~E1000_CTRL_VME; | |||||
E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); | |||||
} | |||||
/* Don't lose promiscuous settings */ | /* Don't lose promiscuous settings */ | ||||
em_if_set_promisc(ctx, if_getflags(ifp)); | em_if_set_promisc(ctx, if_getflags(ifp)); | ||||
e1000_clear_hw_cntrs_base_generic(&adapter->hw); | e1000_clear_hw_cntrs_base_generic(&adapter->hw); | ||||
/* MSI-X configuration for 82574 */ | /* MSI-X configuration for 82574 */ | ||||
if (adapter->hw.mac.type == e1000_82574) { | if (adapter->hw.mac.type == e1000_82574) { | ||||
int tmp = E1000_READ_REG(&adapter->hw, E1000_CTRL_EXT); | int tmp = E1000_READ_REG(&adapter->hw, E1000_CTRL_EXT); | ||||
▲ Show 20 Lines • Show All 302 Lines • ▼ Show 20 Lines | else | ||||
mcnt = min(if_llmaddr_count(ifp), MAX_NUM_MULTICAST_ADDRESSES); | mcnt = min(if_llmaddr_count(ifp), MAX_NUM_MULTICAST_ADDRESSES); | ||||
if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) | if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) | ||||
reg_rctl &= (~E1000_RCTL_MPE); | reg_rctl &= (~E1000_RCTL_MPE); | ||||
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); | E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); | ||||
if (flags & IFF_PROMISC) { | if (flags & IFF_PROMISC) { | ||||
reg_rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); | reg_rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); | ||||
em_if_vlan_filter_disable(adapter); | |||||
/* Turn this on if you want to see bad packets */ | /* Turn this on if you want to see bad packets */ | ||||
if (em_debug_sbp) | if (em_debug_sbp) | ||||
reg_rctl |= E1000_RCTL_SBP; | reg_rctl |= E1000_RCTL_SBP; | ||||
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); | E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); | ||||
} else if (flags & IFF_ALLMULTI) { | } else { | ||||
if (flags & IFF_ALLMULTI) { | |||||
reg_rctl |= E1000_RCTL_MPE; | reg_rctl |= E1000_RCTL_MPE; | ||||
reg_rctl &= ~E1000_RCTL_UPE; | reg_rctl &= ~E1000_RCTL_UPE; | ||||
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); | E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); | ||||
} | } | ||||
if (em_if_vlan_filter_used(adapter)) | |||||
em_if_vlan_filter_enable(adapter); | |||||
} | |||||
return (0); | return (0); | ||||
} | } | ||||
static u_int | static u_int | ||||
em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int idx) | em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int idx) | ||||
{ | { | ||||
u8 *mta = arg; | u8 *mta = arg; | ||||
▲ Show 20 Lines • Show All 1,634 Lines • ▼ Show 20 Lines | if (if_getmtu(ifp) > ETHERMTU) { | ||||
rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX; | rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX; | ||||
} else if (adapter->rx_mbuf_sz > 4096) { | } else if (adapter->rx_mbuf_sz > 4096) { | ||||
srrctl |= 8192 >> E1000_SRRCTL_BSIZEPKT_SHIFT; | srrctl |= 8192 >> E1000_SRRCTL_BSIZEPKT_SHIFT; | ||||
rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX; | rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX; | ||||
} | } | ||||
psize = scctx->isc_max_frame_size; | psize = scctx->isc_max_frame_size; | ||||
/* are we on a vlan? */ | /* are we on a vlan? */ | ||||
if (ifp->if_vlantrunk != NULL) | if (ifp->if_vlantrunk != NULL) | ||||
psize += VLAN_TAG_SIZE; | psize += VLAN_TAG_SIZE; | ||||
markj: Is this right for large MTUs? isc_max_frame_size can be larger than the receive buffers… | |||||
Done Inline ActionsAhh I do see the issues, I'll fix this. kbowling: Ahh I do see the issues, I'll fix this. | |||||
if (adapter->vf_ifp) | |||||
e1000_rlpml_set_vf(hw, psize); | |||||
Done Inline Actionspszie is an undeclared identifier. This caused an abort during build. Changing it to psize allowed for a clean build. CI may throw errors during runs. jason_tubnor.net: pszie is an undeclared identifier. This caused an abort during build. Changing it to psize… | |||||
Done Inline ActionsThanks, yeah that hit in the commit to main :(. I MFCed this change to stable/12 and stable/13 with the typo correction squashed, so if you update you should get this fix and some other necessary ones for e1000. kbowling: Thanks, yeah that hit in the commit to main :(. I MFCed this change to stable/12 and stable/13… | |||||
else | |||||
E1000_WRITE_REG(hw, E1000_RLPML, psize); | E1000_WRITE_REG(hw, E1000_RLPML, psize); | ||||
} else { | } else { | ||||
srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT; | srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT; | ||||
rctl |= E1000_RCTL_SZ_2048; | |||||
} | } | ||||
/* | /* | ||||
* If TX flow control is disabled and there's >1 queue defined, | * If TX flow control is disabled and there's >1 queue defined, | ||||
* enable DROP. | * enable DROP. | ||||
* | * | ||||
* This drops frames rather than hanging the RX MAC for all queues. | * This drops frames rather than hanging the RX MAC for all queues. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct adapter *adapter = iflib_get_softc(ctx); | struct adapter *adapter = iflib_get_softc(ctx); | ||||
u32 index, bit; | u32 index, bit; | ||||
index = (vtag >> 5) & 0x7F; | index = (vtag >> 5) & 0x7F; | ||||
bit = vtag & 0x1F; | bit = vtag & 0x1F; | ||||
adapter->shadow_vfta[index] |= (1 << bit); | adapter->shadow_vfta[index] |= (1 << bit); | ||||
++adapter->num_vlans; | ++adapter->num_vlans; | ||||
em_if_vlan_filter_write(adapter); | |||||
} | } | ||||
static void | static void | ||||
em_if_vlan_unregister(if_ctx_t ctx, u16 vtag) | em_if_vlan_unregister(if_ctx_t ctx, u16 vtag) | ||||
{ | { | ||||
struct adapter *adapter = iflib_get_softc(ctx); | struct adapter *adapter = iflib_get_softc(ctx); | ||||
u32 index, bit; | u32 index, bit; | ||||
index = (vtag >> 5) & 0x7F; | index = (vtag >> 5) & 0x7F; | ||||
bit = vtag & 0x1F; | bit = vtag & 0x1F; | ||||
adapter->shadow_vfta[index] &= ~(1 << bit); | adapter->shadow_vfta[index] &= ~(1 << bit); | ||||
--adapter->num_vlans; | --adapter->num_vlans; | ||||
em_if_vlan_filter_write(adapter); | |||||
} | } | ||||
static bool | |||||
em_if_vlan_filter_capable(struct adapter *adapter) | |||||
{ | |||||
if_softc_ctx_t scctx = adapter->shared; | |||||
if ((scctx->isc_capenable & IFCAP_VLAN_HWFILTER) && | |||||
!em_disable_crc_stripping) | |||||
return (true); | |||||
return (false); | |||||
} | |||||
static bool | |||||
em_if_vlan_filter_used(struct adapter *adapter) | |||||
{ | |||||
if (!em_if_vlan_filter_capable(adapter)) | |||||
return (false); | |||||
Not Done Inline ActionsIndentation's off here. markj: Indentation's off here. | |||||
for (int i = 0; i < EM_VFTA_SIZE; i++) | |||||
if (adapter->shadow_vfta[i] != 0) { | |||||
return (true); | |||||
} | |||||
return (false); | |||||
} | |||||
static void | static void | ||||
em_if_vlan_filter_enable(struct adapter *adapter) | |||||
{ | |||||
struct e1000_hw *hw = &adapter->hw; | |||||
u32 reg; | |||||
reg = E1000_READ_REG(hw, E1000_RCTL); | |||||
reg &= ~E1000_RCTL_CFIEN; | |||||
reg |= E1000_RCTL_VFE; | |||||
E1000_WRITE_REG(hw, E1000_RCTL, reg); | |||||
} | |||||
static void | |||||
em_if_vlan_filter_disable(struct adapter *adapter) | |||||
{ | |||||
struct e1000_hw *hw = &adapter->hw; | |||||
u32 reg; | |||||
reg = E1000_READ_REG(hw, E1000_RCTL); | |||||
reg &= ~(E1000_RCTL_VFE | E1000_RCTL_CFIEN); | |||||
E1000_WRITE_REG(hw, E1000_RCTL, reg); | |||||
} | |||||
static void | |||||
em_if_vlan_filter_write(struct adapter *adapter) | |||||
{ | |||||
struct e1000_hw *hw = &adapter->hw; | |||||
if (adapter->vf_ifp) | |||||
return; | |||||
/* Disable interrupts for lem-class devices during the filter change */ | |||||
if (hw->mac.type < em_mac_min) | |||||
em_if_intr_disable(adapter->ctx); | |||||
for (int i = 0; i < EM_VFTA_SIZE; i++) | |||||
if (adapter->shadow_vfta[i] != 0) { | |||||
/* XXXKB: incomplete VF support, we return early above */ | |||||
if (adapter->vf_ifp) | |||||
e1000_vfta_set_vf(hw, adapter->shadow_vfta[i], TRUE); | |||||
else | |||||
e1000_write_vfta(hw, i, adapter->shadow_vfta[i]); | |||||
} | |||||
/* Re-enable interrupts for lem-class devices */ | |||||
if (hw->mac.type < em_mac_min) | |||||
em_if_intr_enable(adapter->ctx); | |||||
} | |||||
static void | |||||
em_setup_vlan_hw_support(struct adapter *adapter) | em_setup_vlan_hw_support(struct adapter *adapter) | ||||
{ | { | ||||
if_softc_ctx_t scctx = adapter->shared; | |||||
struct e1000_hw *hw = &adapter->hw; | struct e1000_hw *hw = &adapter->hw; | ||||
u32 reg; | u32 reg; | ||||
/* | /* XXXKB: Return early if we are a VF until VF decap and filter management | ||||
* We get here thru init_locked, meaning | * is ready and tested. | ||||
* a soft reset, this has already cleared | |||||
* the VFTA and other state, so if there | |||||
* have been no vlan's registered do nothing. | |||||
*/ | */ | ||||
if (adapter->num_vlans == 0) | if (adapter->vf_ifp) | ||||
return; | return; | ||||
if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && | |||||
!em_disable_crc_stripping) { | |||||
reg = E1000_READ_REG(hw, E1000_CTRL); | |||||
reg |= E1000_CTRL_VME; | |||||
E1000_WRITE_REG(hw, E1000_CTRL, reg); | |||||
} else { | |||||
reg = E1000_READ_REG(hw, E1000_CTRL); | |||||
reg &= ~E1000_CTRL_VME; | |||||
E1000_WRITE_REG(hw, E1000_CTRL, reg); | |||||
} | |||||
/* If we aren't doing HW filtering, we're done */ | |||||
if (!em_if_vlan_filter_capable(adapter)) { | |||||
em_if_vlan_filter_disable(adapter); | |||||
Done Inline ActionsWhen an interface is first brought up, I believe we'll have adapter->num_vlans == 0 and thus won't set CTRL.VME. This means that the NIC will discard VLAN-tagged packets - is that the expected behaviour when vlan(4) isn't in use? I guess it matches the behaviour we had before if VLAN_HWTAGGING is set, but I'm not sure what's correct here. markj: When an interface is first brought up, I believe we'll have `adapter->num_vlans == 0` and thus… | |||||
Done Inline ActionsOther platforms seem to set CTRL.VME unconditionally as long as HW Tagging capability is active (which we handle correctly lower in this patch). I guess we should match that. I think VME is "safe" to have off without VLANs, unexpected 802.1Q packets should come up into the software stack as long as they pass any other filters whether VME is on or off (7.4.3.2 in the I210 datasheet). I have a WIP to manage the VFE when in promiscuous mode so I'm leaning toward removing this condition now that you bring it up. I /think/ VFE is the one we need to be more careful with. Thoughts on this? kbowling: Other platforms seem to set CTRL.VME unconditionally as long as HW Tagging capability is active… | |||||
return; | |||||
} | |||||
/* | /* | ||||
* A soft reset zero's out the VFTA, so | * A soft reset zero's out the VFTA, so | ||||
* we need to repopulate it now. | * we need to repopulate it now. | ||||
*/ | */ | ||||
for (int i = 0; i < EM_VFTA_SIZE; i++) | em_if_vlan_filter_write(adapter); | ||||
if (adapter->shadow_vfta[i] != 0) | |||||
E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, | |||||
i, adapter->shadow_vfta[i]); | |||||
reg = E1000_READ_REG(hw, E1000_CTRL); | |||||
reg |= E1000_CTRL_VME; | |||||
E1000_WRITE_REG(hw, E1000_CTRL, reg); | |||||
/* Enable the Filter Table */ | /* Enable the Filter Table */ | ||||
Done Inline ActionsThis check is unreachable, we will return above if this is a VF. markj: This check is unreachable, we will return above if this is a VF. | |||||
Done Inline ActionsI copied this dead code just like it is over from the out of tree igb-2.5.18. I think the early return above was done because the rest of this filter management isn't ready for VFs. I was mulling over leaving this as a place holder if to try and implement more of the igb VF driver, or if that is just too much work with too little reward it can be nixed. What should we do with WIP/dead code versus the OOT driver? kbowling: I copied this dead code just like it is over from the out of tree igb-2.5.18. I think the… | |||||
Done Inline Actions@markj I've done a bit more research and there is evidence of people trying to use the igb vf driver https://bugs.freebsd.org/bugzilla/buglist.cgi?quicksearch=igb vf . Can I leave this in as a placeholder for some follow on work after I've made progress on some of the other basic functionality bugs people are having? kbowling: @markj I've done a bit more research and there is evidence of people trying to use the igb vf… | |||||
Done Inline ActionsOk, I would suggest adding a /* XXX incomplete VF support */ comment or so. markj: Ok, I would suggest adding a `/* XXX incomplete VF support */` comment or so. | |||||
reg = E1000_READ_REG(hw, E1000_RCTL); | em_if_vlan_filter_enable(adapter); | ||||
reg &= ~E1000_RCTL_CFIEN; | |||||
reg |= E1000_RCTL_VFE; | |||||
E1000_WRITE_REG(hw, E1000_RCTL, reg); | |||||
} | } | ||||
static void | static void | ||||
em_if_intr_enable(if_ctx_t ctx) | em_if_intr_enable(if_ctx_t ctx) | ||||
{ | { | ||||
struct adapter *adapter = iflib_get_softc(ctx); | struct adapter *adapter = iflib_get_softc(ctx); | ||||
struct e1000_hw *hw = &adapter->hw; | struct e1000_hw *hw = &adapter->hw; | ||||
u32 ims_mask = IMS_ENABLE_MASK; | u32 ims_mask = IMS_ENABLE_MASK; | ||||
if (adapter->intr_type == IFLIB_INTR_MSIX) { | if (adapter->intr_type == IFLIB_INTR_MSIX) { | ||||
E1000_WRITE_REG(hw, EM_EIAC, adapter->ims); | E1000_WRITE_REG(hw, EM_EIAC, adapter->ims); | ||||
ims_mask |= adapter->ims; | ims_mask |= adapter->ims; | ||||
} | } | ||||
E1000_WRITE_REG(hw, E1000_IMS, ims_mask); | E1000_WRITE_REG(hw, E1000_IMS, ims_mask); | ||||
E1000_WRITE_FLUSH(hw); | |||||
} | } | ||||
static void | static void | ||||
em_if_intr_disable(if_ctx_t ctx) | em_if_intr_disable(if_ctx_t ctx) | ||||
{ | { | ||||
struct adapter *adapter = iflib_get_softc(ctx); | struct adapter *adapter = iflib_get_softc(ctx); | ||||
struct e1000_hw *hw = &adapter->hw; | struct e1000_hw *hw = &adapter->hw; | ||||
if (adapter->intr_type == IFLIB_INTR_MSIX) | if (adapter->intr_type == IFLIB_INTR_MSIX) | ||||
E1000_WRITE_REG(hw, EM_EIAC, 0); | E1000_WRITE_REG(hw, EM_EIAC, 0); | ||||
E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); | E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); | ||||
E1000_WRITE_FLUSH(hw); | |||||
} | } | ||||
static void | static void | ||||
igb_if_intr_enable(if_ctx_t ctx) | igb_if_intr_enable(if_ctx_t ctx) | ||||
{ | { | ||||
struct adapter *adapter = iflib_get_softc(ctx); | struct adapter *adapter = iflib_get_softc(ctx); | ||||
struct e1000_hw *hw = &adapter->hw; | struct e1000_hw *hw = &adapter->hw; | ||||
u32 mask; | u32 mask; | ||||
▲ Show 20 Lines • Show All 589 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* @returns true if iflib needs to reinit the interface | * @returns true if iflib needs to reinit the interface | ||||
*/ | */ | ||||
static bool | static bool | ||||
em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) | em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) | ||||
{ | { | ||||
switch (event) { | switch (event) { | ||||
case IFLIB_RESTART_VLAN_CONFIG: | case IFLIB_RESTART_VLAN_CONFIG: | ||||
return (false); | |||||
Done Inline ActionsWhy this change? The out-of-tree driver appears to re-initialize the driver when registering or unregistering VLANs. markj: Why this change? The out-of-tree driver appears to re-initialize the driver when registering or… | |||||
Done Inline ActionsWe don't want to flap the link when doing this, it impacts the user experience. So far it looks like it was just a heavy hitting way to get the filter to reprogram but I think I've addressed it, I'll need to watch closely for unexpected change. kbowling: We don't want to flap the link when doing this, it impacts the user experience. So far it looks… | |||||
default: | default: | ||||
return (true); | return (true); | ||||
} | } | ||||
} | } | ||||
/* Export a single 32-bit register via a read-only sysctl. */ | /* Export a single 32-bit register via a read-only sysctl. */ | ||||
static int | static int | ||||
em_sysctl_reg_handler(SYSCTL_HANDLER_ARGS) | em_sysctl_reg_handler(SYSCTL_HANDLER_ARGS) | ||||
▲ Show 20 Lines • Show All 567 Lines • Show Last 20 Lines |
Is this right for large MTUs? isc_max_frame_size can be larger than the receive buffers allocated by iflib. I believe iflib will allocate at most 4KB for a contiguous buffer, based on iflib_fl_setup().
I see that we supposedly handle adapter->rx_mbuf_sz > 4096 here but I think it's effectively dead code, see iflib_get_mbuf_size_for().