Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixgbe/if_ix.c
Show First 20 Lines • Show All 444 Lines • ▼ Show 20 Lines | for (i = 0, que = adapter->tx_queues; i < ntxqsets; i++, que++) { | ||||
} | } | ||||
for (j = 0; j < scctx->isc_ntxd[0]; j++) | for (j = 0; j < scctx->isc_ntxd[0]; j++) | ||||
txr->tx_rsq[j] = QIDX_INVALID; | txr->tx_rsq[j] = QIDX_INVALID; | ||||
/* get the virtual and physical address of the hardware queues */ | /* get the virtual and physical address of the hardware queues */ | ||||
txr->tail = IXGBE_TDT(txr->me); | txr->tail = IXGBE_TDT(txr->me); | ||||
txr->tx_base = (union ixgbe_adv_tx_desc *)vaddrs[i]; | txr->tx_base = (union ixgbe_adv_tx_desc *)vaddrs[i]; | ||||
txr->tx_paddr = paddrs[i]; | txr->tx_paddr = paddrs[i]; | ||||
txr->packets = 0; | |||||
txr->bytes = 0; | txr->bytes = 0; | ||||
txr->total_packets = 0; | txr->total_packets = 0; | ||||
/* Set the rate at which we sample packets */ | /* Set the rate at which we sample packets */ | ||||
if (adapter->feat_en & IXGBE_FEATURE_FDIR) | if (adapter->feat_en & IXGBE_FEATURE_FDIR) | ||||
txr->atr_sample = atr_sample_rate; | txr->atr_sample = atr_sample_rate; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,647 Lines • ▼ Show 20 Lines | for (int i = 0; i < adapter->num_rx_queues; i++, rx_que++) | ||||
iflib_irq_free(ctx, &rx_que->que_irq); | iflib_irq_free(ctx, &rx_que->que_irq); | ||||
return (error); | return (error); | ||||
} /* ixgbe_if_msix_intr_assign */ | } /* ixgbe_if_msix_intr_assign */ | ||||
static inline void | static inline void | ||||
ixgbe_perform_aim(struct adapter *adapter, struct ix_rx_queue *que) | ixgbe_perform_aim(struct adapter *adapter, struct ix_rx_queue *que) | ||||
{ | { | ||||
uint32_t newitr = 0; | struct ix_tx_queue *txq = &adapter->tx_queues[que->msix]; | ||||
stallamr_netapp.com: I would refrain using que->msix as queue array index. This may not work when SR-IOV is enabled. | |||||
kbowlingAuthorUnsubmitted Not Done Inline ActionsOk I will think a bit harder on this, thanks for the feedback. kbowling: Ok I will think a bit harder on this, thanks for the feedback. | |||||
struct tx_ring *txr = &txq->txr; | |||||
struct rx_ring *rxr = &que->rxr; | struct rx_ring *rxr = &que->rxr; | ||||
uint32_t newitr = 0; | |||||
/* | /* | ||||
* Do Adaptive Interrupt Moderation: | * Do Adaptive Interrupt Moderation: | ||||
* - Write out last calculated setting | * - Write out last calculated setting | ||||
* - Calculate based on average size over | * - Calculate based on average size over | ||||
* the last interval. | * the last interval. | ||||
*/ | */ | ||||
if (que->eitr_setting) { | if (que->eitr_setting) { | ||||
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix), | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix), | ||||
que->eitr_setting); | que->eitr_setting); | ||||
} | } | ||||
que->eitr_setting = 0; | que->eitr_setting = 0; | ||||
/* Idle, do nothing */ | /* Idle, do nothing */ | ||||
if (rxr->bytes == 0) { | if ((txr->bytes == 0) && (rxr->bytes == 0)) { | ||||
return; | return; | ||||
} | } | ||||
if ((txr->bytes) && (txr->packets)) | |||||
Not Done Inline ActionsLooking at ixgbe_isc_txd_encap(), it seems txr->packets never gets adjusted. markj: Looking at ixgbe_isc_txd_encap(), it seems `txr->packets` never gets adjusted. | |||||
Not Done Inline ActionsThat is true. Thanks for bringing in Tx too. We need to make the change in ixgbe_isc_txd_encap() to include txr->packets = txr->total_packets; stallamr_netapp.com: That is true. Thanks for bringing in Tx too. We need to make the change in ixgbe_isc_txd_encap… | |||||
newitr = txr->bytes / txr->packets; | |||||
if ((rxr->bytes) && (rxr->packets)) { | if ((rxr->bytes) && (rxr->packets)) { | ||||
newitr = (rxr->bytes / rxr->packets); | newitr = max(newitr, rxr->bytes / rxr->packets); | ||||
} | } | ||||
newitr += 24; /* account for hardware frame, crc */ | newitr += 24; /* account for hardware frame, crc */ | ||||
/* set an upper boundary */ | /* set an upper boundary */ | ||||
newitr = min(newitr, 3000); | newitr = min(newitr, 3000); | ||||
/* Be nice to the mid range */ | /* Be nice to the mid range */ | ||||
if ((newitr > 300) && (newitr < 1200)) { | if ((newitr > 300) && (newitr < 1200)) { | ||||
newitr = (newitr / 3); | newitr = (newitr / 3); | ||||
} else { | } else { | ||||
newitr = (newitr / 2); | newitr = (newitr / 2); | ||||
} | } | ||||
if (adapter->hw.mac.type == ixgbe_mac_82598EB) { | if (adapter->hw.mac.type == ixgbe_mac_82598EB) { | ||||
newitr |= newitr << 16; | newitr |= newitr << 16; | ||||
} else { | } else { | ||||
newitr |= IXGBE_EITR_CNT_WDIS; | newitr |= IXGBE_EITR_CNT_WDIS; | ||||
} | } | ||||
/* save for next interrupt */ | /* save for next interrupt */ | ||||
que->eitr_setting = newitr; | que->eitr_setting = newitr; | ||||
/* Reset state */ | /* Reset state */ | ||||
txr->bytes = 0; | |||||
txr->packets = 0; | |||||
rxr->bytes = 0; | rxr->bytes = 0; | ||||
rxr->packets = 0; | rxr->packets = 0; | ||||
return; | |||||
} | } | ||||
/********************************************************************* | /********************************************************************* | ||||
* ixgbe_msix_que - MSI-X Queue Interrupt Service routine | * ixgbe_msix_que - MSI-X Queue Interrupt Service routine | ||||
**********************************************************************/ | **********************************************************************/ | ||||
static int | static int | ||||
ixgbe_msix_que(void *arg) | ixgbe_msix_que(void *arg) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 2,504 Lines • Show Last 20 Lines |
I would refrain using que->msix as queue array index. This may not work when SR-IOV is enabled.
Ideally we would want to use "txr.me" . But with Rx and Tx queue separation, I think we may have to introduce a new "index" variable to explicitly capture corresponding TxQ index for a given RxQ.