Skip to content

Commit 4e0effd

Browse files
khfengkuba-moo
authored andcommitted
igb: Make DMA faster when CPU is active on the PCIe link
Intel I210 on some Intel Alder Lake platforms can only achieve ~750Mbps Tx speed via iperf. The RR2DCDELAY shows around 0x2xxx DMA delay, which will be significantly lower when 1) ASPM is disabled or 2) SoC package c-state stays above PC3. When the RR2DCDELAY is around 0x1xxx the Tx speed can reach to ~950Mbps. According to the I210 datasheet "8.26.1 PCIe Misc. Register - PCIEMISC", "DMA Idle Indication" doesn't seem to tie to DMA coalesce anymore, so set it to 1b for "DMA is considered idle when there is no Rx or Tx AND when there are no TLPs indicating that CPU is active detected on the PCIe link (such as the host executes CSR or Configuration register read or write operation)" and performing Tx should also fall under "active CPU on PCIe link" case. In addition to that, commit b6e0c41 ("igb: Move DMA Coalescing init code to separate function.") seems to wrongly changed from enabling E1000_PCIEMISC_LX_DECISION to disabling it, also fix that. Fixes: b6e0c41 ("igb: Move DMA Coalescing init code to separate function.") Signed-off-by: Kai-Heng Feng <[email protected]> Tested-by: Gurucharan <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 85467f7 commit 4e0effd

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9901,11 +9901,10 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
99019901
struct e1000_hw *hw = &adapter->hw;
99029902
u32 dmac_thr;
99039903
u16 hwm;
9904+
u32 reg;
99049905

99059906
if (hw->mac.type > e1000_82580) {
99069907
if (adapter->flags & IGB_FLAG_DMAC) {
9907-
u32 reg;
9908-
99099908
/* force threshold to 0. */
99109909
wr32(E1000_DMCTXTH, 0);
99119910

@@ -9938,7 +9937,6 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
99389937
/* Disable BMC-to-OS Watchdog Enable */
99399938
if (hw->mac.type != e1000_i354)
99409939
reg &= ~E1000_DMACR_DC_BMC2OSW_EN;
9941-
99429940
wr32(E1000_DMACR, reg);
99439941

99449942
/* no lower threshold to disable
@@ -9955,12 +9953,12 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
99559953
*/
99569954
wr32(E1000_DMCTXTH, (IGB_MIN_TXPBSIZE -
99579955
(IGB_TX_BUF_4096 + adapter->max_frame_size)) >> 6);
9956+
}
99589957

9959-
/* make low power state decision controlled
9960-
* by DMA coal
9961-
*/
9958+
if (hw->mac.type >= e1000_i210 ||
9959+
(adapter->flags & IGB_FLAG_DMAC)) {
99629960
reg = rd32(E1000_PCIEMISC);
9963-
reg &= ~E1000_PCIEMISC_LX_DECISION;
9961+
reg |= E1000_PCIEMISC_LX_DECISION;
99649962
wr32(E1000_PCIEMISC, reg);
99659963
} /* endif adapter->dmac is not disabled */
99669964
} else if (hw->mac.type == e1000_82580) {

0 commit comments

Comments
 (0)