version 1.128.2.2, 2018/03/22 01:44:50 |
version 1.128.2.3, 2018/03/30 06:20:15 |
Line 173 static void ixgbe_media_status(struc |
|
Line 173 static void ixgbe_media_status(struc |
|
static int ixgbe_media_change(struct ifnet *); |
static int ixgbe_media_change(struct ifnet *); |
static int ixgbe_allocate_pci_resources(struct adapter *, |
static int ixgbe_allocate_pci_resources(struct adapter *, |
const struct pci_attach_args *); |
const struct pci_attach_args *); |
static void ixgbe_free_softint(struct adapter *); |
static void ixgbe_free_softint(struct adapter *); |
static void ixgbe_get_slot_info(struct adapter *); |
static void ixgbe_get_slot_info(struct adapter *); |
static int ixgbe_allocate_msix(struct adapter *, |
static int ixgbe_allocate_msix(struct adapter *, |
const struct pci_attach_args *); |
const struct pci_attach_args *); |
Line 1707 ixgbe_add_hw_stats(struct adapter *adapt |
|
Line 1707 ixgbe_add_hw_stats(struct adapter *adapt |
|
NULL, xname, "TSO errors"); |
NULL, xname, "TSO errors"); |
evcnt_attach_dynamic(&adapter->link_irq, EVCNT_TYPE_INTR, |
evcnt_attach_dynamic(&adapter->link_irq, EVCNT_TYPE_INTR, |
NULL, xname, "Link MSI-X IRQ Handled"); |
NULL, xname, "Link MSI-X IRQ Handled"); |
|
evcnt_attach_dynamic(&adapter->link_sicount, EVCNT_TYPE_INTR, |
|
NULL, xname, "Link softint"); |
|
evcnt_attach_dynamic(&adapter->mod_sicount, EVCNT_TYPE_INTR, |
|
NULL, xname, "module softint"); |
|
evcnt_attach_dynamic(&adapter->msf_sicount, EVCNT_TYPE_INTR, |
|
NULL, xname, "multimode softint"); |
|
evcnt_attach_dynamic(&adapter->phy_sicount, EVCNT_TYPE_INTR, |
|
NULL, xname, "external PHY softint"); |
|
|
for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { |
for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { |
#ifdef LRO |
#ifdef LRO |
Line 1984 ixgbe_clear_evcnt(struct adapter *adapte |
|
Line 1992 ixgbe_clear_evcnt(struct adapter *adapte |
|
adapter->tso_err.ev_count = 0; |
adapter->tso_err.ev_count = 0; |
adapter->watchdog_events.ev_count = 0; |
adapter->watchdog_events.ev_count = 0; |
adapter->link_irq.ev_count = 0; |
adapter->link_irq.ev_count = 0; |
|
adapter->link_sicount.ev_count = 0; |
|
adapter->mod_sicount.ev_count = 0; |
|
adapter->msf_sicount.ev_count = 0; |
|
adapter->phy_sicount.ev_count = 0; |
|
|
txr = adapter->tx_rings; |
txr = adapter->tx_rings; |
for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { |
for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { |
Line 2398 ixgbe_enable_queue(struct adapter *adapt |
|
Line 2410 ixgbe_enable_queue(struct adapter *adapt |
|
u64 queue = (u64)(1ULL << vector); |
u64 queue = (u64)(1ULL << vector); |
u32 mask; |
u32 mask; |
|
|
mutex_enter(&que->im_mtx); |
mutex_enter(&que->dc_mtx); |
if (que->im_nest > 0 && --que->im_nest > 0) |
if (que->disabled_count > 0 && --que->disabled_count > 0) |
goto out; |
goto out; |
|
|
if (hw->mac.type == ixgbe_mac_82598EB) { |
if (hw->mac.type == ixgbe_mac_82598EB) { |
Line 2414 ixgbe_enable_queue(struct adapter *adapt |
|
Line 2426 ixgbe_enable_queue(struct adapter *adapt |
|
IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(1), mask); |
IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(1), mask); |
} |
} |
out: |
out: |
mutex_exit(&que->im_mtx); |
mutex_exit(&que->dc_mtx); |
} /* ixgbe_enable_queue */ |
} /* ixgbe_enable_queue */ |
|
|
/************************************************************************ |
/************************************************************************ |
* ixgbe_disable_queue |
* ixgbe_disable_queue_internal |
************************************************************************/ |
************************************************************************/ |
static inline void |
static inline void |
ixgbe_disable_queue(struct adapter *adapter, u32 vector) |
ixgbe_disable_queue_internal(struct adapter *adapter, u32 vector, bool nestok) |
{ |
{ |
struct ixgbe_hw *hw = &adapter->hw; |
struct ixgbe_hw *hw = &adapter->hw; |
struct ix_queue *que = &adapter->queues[vector]; |
struct ix_queue *que = &adapter->queues[vector]; |
u64 queue = (u64)(1ULL << vector); |
u64 queue = (u64)(1ULL << vector); |
u32 mask; |
u32 mask; |
|
|
mutex_enter(&que->im_mtx); |
mutex_enter(&que->dc_mtx); |
if (que->im_nest++ > 0) |
|
goto out; |
if (que->disabled_count > 0) { |
|
if (nestok) |
|
que->disabled_count++; |
|
goto out; |
|
} |
|
que->disabled_count++; |
|
|
if (hw->mac.type == ixgbe_mac_82598EB) { |
if (hw->mac.type == ixgbe_mac_82598EB) { |
mask = (IXGBE_EIMS_RTX_QUEUE & queue); |
mask = (IXGBE_EIMS_RTX_QUEUE & queue); |
Line 2444 ixgbe_disable_queue(struct adapter *adap |
|
Line 2461 ixgbe_disable_queue(struct adapter *adap |
|
IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(1), mask); |
IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(1), mask); |
} |
} |
out: |
out: |
mutex_exit(&que->im_mtx); |
mutex_exit(&que->dc_mtx); |
|
} /* ixgbe_disable_queue_internal */ |
|
|
|
/************************************************************************ |
|
* ixgbe_disable_queue |
|
************************************************************************/ |
|
static inline void |
|
ixgbe_disable_queue(struct adapter *adapter, u32 vector) |
|
{ |
|
|
|
ixgbe_disable_queue_internal(adapter, vector, true); |
} /* ixgbe_disable_queue */ |
} /* ixgbe_disable_queue */ |
|
|
/************************************************************************ |
/************************************************************************ |
Line 3396 ixgbe_detach(device_t dev, int flags) |
|
Line 3423 ixgbe_detach(device_t dev, int flags) |
|
evcnt_detach(&adapter->watchdog_events); |
evcnt_detach(&adapter->watchdog_events); |
evcnt_detach(&adapter->tso_err); |
evcnt_detach(&adapter->tso_err); |
evcnt_detach(&adapter->link_irq); |
evcnt_detach(&adapter->link_irq); |
|
evcnt_detach(&adapter->link_sicount); |
|
evcnt_detach(&adapter->mod_sicount); |
|
evcnt_detach(&adapter->msf_sicount); |
|
evcnt_detach(&adapter->phy_sicount); |
|
|
txr = adapter->tx_rings; |
txr = adapter->tx_rings; |
for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { |
for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { |
Line 3495 ixgbe_detach(device_t dev, int flags) |
|
Line 3526 ixgbe_detach(device_t dev, int flags) |
|
ixgbe_free_receive_structures(adapter); |
ixgbe_free_receive_structures(adapter); |
for (int i = 0; i < adapter->num_queues; i++) { |
for (int i = 0; i < adapter->num_queues; i++) { |
struct ix_queue * que = &adapter->queues[i]; |
struct ix_queue * que = &adapter->queues[i]; |
mutex_destroy(&que->im_mtx); |
mutex_destroy(&que->dc_mtx); |
} |
} |
free(adapter->queues, M_DEVBUF); |
free(adapter->queues, M_DEVBUF); |
free(adapter->mta, M_DEVBUF); |
free(adapter->mta, M_DEVBUF); |
Line 3996 ixgbe_configure_ivars(struct adapter *ad |
|
Line 4027 ixgbe_configure_ivars(struct adapter *ad |
|
ixgbe_set_ivar(adapter, txr->me, que->msix, 1); |
ixgbe_set_ivar(adapter, txr->me, que->msix, 1); |
/* Set an Initial EITR value */ |
/* Set an Initial EITR value */ |
ixgbe_eitr_write(que, newitr); |
ixgbe_eitr_write(que, newitr); |
|
/* |
|
* To eliminate influence of the previous state. |
|
* At this point, Tx/Rx interrupt handler |
|
* (ixgbe_msix_que()) cannot be called, so both |
|
* IXGBE_TX_LOCK and IXGBE_RX_LOCK are not required. |
|
*/ |
|
que->eitr_setting = 0; |
} |
} |
|
|
/* For the Link interrupt */ |
/* For the Link interrupt */ |
Line 4272 ixgbe_local_timer1(void *arg) |
|
Line 4310 ixgbe_local_timer1(void *arg) |
|
else if (queues != 0) { /* Force an IRQ on queues with work */ |
else if (queues != 0) { /* Force an IRQ on queues with work */ |
que = adapter->queues; |
que = adapter->queues; |
for (i = 0; i < adapter->num_queues; i++, que++) { |
for (i = 0; i < adapter->num_queues; i++, que++) { |
mutex_enter(&que->im_mtx); |
mutex_enter(&que->dc_mtx); |
if (que->im_nest == 0) |
if (que->disabled_count == 0) |
ixgbe_rearm_queues(adapter, |
ixgbe_rearm_queues(adapter, |
queues & ((u64)1 << i)); |
queues & ((u64)1 << i)); |
mutex_exit(&que->im_mtx); |
mutex_exit(&que->dc_mtx); |
} |
} |
} |
} |
|
|
Line 4336 ixgbe_handle_mod(void *context) |
|
Line 4374 ixgbe_handle_mod(void *context) |
|
device_t dev = adapter->dev; |
device_t dev = adapter->dev; |
u32 err, cage_full = 0; |
u32 err, cage_full = 0; |
|
|
|
++adapter->mod_sicount.ev_count; |
if (adapter->hw.need_crosstalk_fix) { |
if (adapter->hw.need_crosstalk_fix) { |
switch (hw->mac.type) { |
switch (hw->mac.type) { |
case ixgbe_mac_82599EB: |
case ixgbe_mac_82599EB: |
Line 4383 ixgbe_handle_msf(void *context) |
|
Line 4422 ixgbe_handle_msf(void *context) |
|
u32 autoneg; |
u32 autoneg; |
bool negotiate; |
bool negotiate; |
|
|
|
++adapter->msf_sicount.ev_count; |
/* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */ |
/* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */ |
adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); |
adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); |
|
|
Line 4410 ixgbe_handle_phy(void *context) |
|
Line 4450 ixgbe_handle_phy(void *context) |
|
struct ixgbe_hw *hw = &adapter->hw; |
struct ixgbe_hw *hw = &adapter->hw; |
int error; |
int error; |
|
|
|
++adapter->phy_sicount.ev_count; |
error = hw->phy.ops.handle_lasi(hw); |
error = hw->phy.ops.handle_lasi(hw); |
if (error == IXGBE_ERR_OVERTEMP) |
if (error == IXGBE_ERR_OVERTEMP) |
device_printf(adapter->dev, |
device_printf(adapter->dev, |
Line 4490 ixgbe_update_link_status(struct adapter |
|
Line 4531 ixgbe_update_link_status(struct adapter |
|
|
|
if (adapter->link_up) { |
if (adapter->link_up) { |
if (adapter->link_active == FALSE) { |
if (adapter->link_active == FALSE) { |
|
/* |
|
* To eliminate influence of the previous state |
|
* in the same way as ixgbe_init_locked(). |
|
*/ |
|
struct ix_queue *que = adapter->queues; |
|
for (int i = 0; i < adapter->num_queues; i++, que++) |
|
que->eitr_setting = 0; |
|
|
if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL){ |
if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL){ |
/* |
/* |
* Discard count for both MAC Local Fault and |
* Discard count for both MAC Local Fault and |
Line 4663 ixgbe_enable_intr(struct adapter *adapte |
|
Line 4712 ixgbe_enable_intr(struct adapter *adapte |
|
} /* ixgbe_enable_intr */ |
} /* ixgbe_enable_intr */ |
|
|
/************************************************************************ |
/************************************************************************ |
* ixgbe_disable_intr |
* ixgbe_disable_intr_internal |
************************************************************************/ |
************************************************************************/ |
static void |
static void |
ixgbe_disable_intr(struct adapter *adapter) |
ixgbe_disable_intr_internal(struct adapter *adapter, bool nestok) |
{ |
{ |
struct ix_queue *que = adapter->queues; |
struct ix_queue *que = adapter->queues; |
|
|
Line 4677 ixgbe_disable_intr(struct adapter *adapt |
|
Line 4726 ixgbe_disable_intr(struct adapter *adapt |
|
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIAC, 0); |
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIAC, 0); |
|
|
for (int i = 0; i < adapter->num_queues; i++, que++) |
for (int i = 0; i < adapter->num_queues; i++, que++) |
ixgbe_disable_queue(adapter, que->msix); |
ixgbe_disable_queue_internal(adapter, que->msix, nestok); |
|
|
IXGBE_WRITE_FLUSH(&adapter->hw); |
IXGBE_WRITE_FLUSH(&adapter->hw); |
|
|
|
} /* ixgbe_do_disable_intr_internal */ |
|
|
|
/************************************************************************ |
|
* ixgbe_disable_intr |
|
************************************************************************/ |
|
static void |
|
ixgbe_disable_intr(struct adapter *adapter) |
|
{ |
|
|
|
ixgbe_disable_intr_internal(adapter, true); |
} /* ixgbe_disable_intr */ |
} /* ixgbe_disable_intr */ |
|
|
/************************************************************************ |
/************************************************************************ |
|
* ixgbe_ensure_disabled_intr |
|
************************************************************************/ |
|
void |
|
ixgbe_ensure_disabled_intr(struct adapter *adapter) |
|
{ |
|
|
|
ixgbe_disable_intr_internal(adapter, false); |
|
} /* ixgbe_ensure_disabled_intr */ |
|
|
|
/************************************************************************ |
* ixgbe_legacy_irq - Legacy Interrupt Service routine |
* ixgbe_legacy_irq - Legacy Interrupt Service routine |
************************************************************************/ |
************************************************************************/ |
static int |
static int |
Line 6341 ixgbe_handle_link(void *context) |
|
Line 6410 ixgbe_handle_link(void *context) |
|
struct ixgbe_hw *hw = &adapter->hw; |
struct ixgbe_hw *hw = &adapter->hw; |
|
|
IXGBE_CORE_LOCK(adapter); |
IXGBE_CORE_LOCK(adapter); |
|
++adapter->link_sicount.ev_count; |
ixgbe_check_link(hw, &adapter->link_speed, &adapter->link_up, 0); |
ixgbe_check_link(hw, &adapter->link_speed, &adapter->link_up, 0); |
ixgbe_update_link_status(adapter); |
ixgbe_update_link_status(adapter); |
|
|