Commit 4e0effd9 authored by Kai-Heng Feng's avatar Kai-Heng Feng Committed by Jakub Kicinski

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 b6e0c419 ("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: b6e0c419 ("igb: Move DMA Coalescing init code to separate function.")
Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Link: https://lore.kernel.org/r/20220621221056.604304-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 85467f7d
...@@ -9901,11 +9901,10 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba) ...@@ -9901,11 +9901,10 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 dmac_thr; u32 dmac_thr;
u16 hwm; u16 hwm;
u32 reg;
if (hw->mac.type > e1000_82580) { if (hw->mac.type > e1000_82580) {
if (adapter->flags & IGB_FLAG_DMAC) { if (adapter->flags & IGB_FLAG_DMAC) {
u32 reg;
/* force threshold to 0. */ /* force threshold to 0. */
wr32(E1000_DMCTXTH, 0); wr32(E1000_DMCTXTH, 0);
...@@ -9938,7 +9937,6 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba) ...@@ -9938,7 +9937,6 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
/* Disable BMC-to-OS Watchdog Enable */ /* Disable BMC-to-OS Watchdog Enable */
if (hw->mac.type != e1000_i354) if (hw->mac.type != e1000_i354)
reg &= ~E1000_DMACR_DC_BMC2OSW_EN; reg &= ~E1000_DMACR_DC_BMC2OSW_EN;
wr32(E1000_DMACR, reg); wr32(E1000_DMACR, reg);
/* no lower threshold to disable /* no lower threshold to disable
...@@ -9955,12 +9953,12 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba) ...@@ -9955,12 +9953,12 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
*/ */
wr32(E1000_DMCTXTH, (IGB_MIN_TXPBSIZE - wr32(E1000_DMCTXTH, (IGB_MIN_TXPBSIZE -
(IGB_TX_BUF_4096 + adapter->max_frame_size)) >> 6); (IGB_TX_BUF_4096 + adapter->max_frame_size)) >> 6);
}
/* make low power state decision controlled if (hw->mac.type >= e1000_i210 ||
* by DMA coal (adapter->flags & IGB_FLAG_DMAC)) {
*/
reg = rd32(E1000_PCIEMISC); reg = rd32(E1000_PCIEMISC);
reg &= ~E1000_PCIEMISC_LX_DECISION; reg |= E1000_PCIEMISC_LX_DECISION;
wr32(E1000_PCIEMISC, reg); wr32(E1000_PCIEMISC, reg);
} /* endif adapter->dmac is not disabled */ } /* endif adapter->dmac is not disabled */
} else if (hw->mac.type == e1000_82580) { } else if (hw->mac.type == e1000_82580) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment