Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2902104iog; Mon, 27 Jun 2022 05:25:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t3toxyNYeCUaLdy2AQZZXLz8IPu1hb/jTCfmQkyo3fM5ZlbHeLiJgakKSOJwYmhjqPUhyJ X-Received: by 2002:a05:6402:11d1:b0:435:d76d:f985 with SMTP id j17-20020a05640211d100b00435d76df985mr15904515edw.8.1656332714398; Mon, 27 Jun 2022 05:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656332714; cv=none; d=google.com; s=arc-20160816; b=jQvLumT4OKaG0yK7oDlQ+UTTdKQJSbn1m35CNMNv/NikUWxYkE4f1/fRtEAbx0bBuA VyhdqmjppxEr9BV1wKHEzj1F3nc/VUNWlBy1QBMwT2aRvgs1SiwzdyC2A1JIsyRTCKE/ UPIjo2a4YWUl4QtC9uyYIJlTzy83jXeT3LOpeu/pcmj7Mh0EnEbHgBJkdt1tv4nqQHeJ SfMvOEEajKnyHHTCDDRpNUCPlTP6A/NHhUAEDxTrUTwIc4tETLF1I1gbtXpip9g8tF0L 0idvcILsW7o2V1VoXh/8oVGvk+/2LPhWeAUH+9/52ebCtopuaACJWB46dh74KjDGaqT5 TibA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xe8/kk6hymOuS3fwFka3Bl4sUYg4Vt3gXJnwJYyuhtI=; b=pVMbF6Z0A4JSiALJEokTqaD1g0ioolokatoYLaVeBi45Hy37Jw0Enzce1kSr6pw+eh Kf0oUkitdKB6oG5BnxVVXWJwR5uAwZPzNtpBdSXzrIKclIvHfQ1atbHqUcSRJ1daxzah tw8/tn5+SrNKOXOBMaADufMFmrD2SqXCjVTjNr+stYYPI8VSvaKvFfCbY1+Vmbngrl6D i2i9di5OVGiPlePW9MjvxDGDvFT/J//AMskZKteISOuFecgD8BNBNSFto1RwAE1uyi0p 8Wn5RiqAfHyGCL+WEkkufMFdjmXoWkv1bmCU3H2RAkSw0P6a/RhTsU+LBUfHB2smJE8Q zoXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KgvYPU7m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7-20020a170906654700b00722ea534186si10676514ejn.248.2022.06.27.05.24.49; Mon, 27 Jun 2022 05:25:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KgvYPU7m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234979AbiF0LZo (ORCPT + 99 others); Mon, 27 Jun 2022 07:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234809AbiF0LZP (ORCPT ); Mon, 27 Jun 2022 07:25:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 578A3656D; Mon, 27 Jun 2022 04:25:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1D4B8B8112E; Mon, 27 Jun 2022 11:25:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6215DC3411D; Mon, 27 Jun 2022 11:25:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329100; bh=CKac3KZZhJcn3Q67KLTPnJl3UxDqru+VaQrAyE0IhHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KgvYPU7mj/JU4mtpImVma/OuvNpm0km0RS/U/MlyiW5gqVM7hRcXSDtZOswLdiykB ylJJEgS6/cqxARcO0zhjlJ5iY0lZwLpArHGwoTL+m9nuIgeRgSWzH/ccO9kQRkXf6f yuogTLl6i2SBwGQ6w2QaL5SrCAMbkQqt6t4i3tcc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , Tony Nguyen , Jakub Kicinski , Sasha Levin , Gurucharan Subject: [PATCH 5.10 051/102] igb: Make DMA faster when CPU is active on the PCIe link Date: Mon, 27 Jun 2022 13:21:02 +0200 Message-Id: <20220627111934.986653452@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai-Heng Feng [ Upstream commit 4e0effd9007ea0be31f7488611eb3824b4541554 ] 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 b6e0c419f040 ("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: b6e0c419f040 ("igb: Move DMA Coalescing init code to separate function.") Signed-off-by: Kai-Heng Feng Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220621221056.604304-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igb/igb_main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 758e468e677a..4e51f4bb58ff 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -9829,11 +9829,10 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba) struct e1000_hw *hw = &adapter->hw; u32 dmac_thr; u16 hwm; + u32 reg; if (hw->mac.type > e1000_82580) { if (adapter->flags & IGB_FLAG_DMAC) { - u32 reg; - /* force threshold to 0. */ wr32(E1000_DMCTXTH, 0); @@ -9866,7 +9865,6 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba) /* Disable BMC-to-OS Watchdog Enable */ if (hw->mac.type != e1000_i354) reg &= ~E1000_DMACR_DC_BMC2OSW_EN; - wr32(E1000_DMACR, reg); /* no lower threshold to disable @@ -9883,12 +9881,12 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba) */ wr32(E1000_DMCTXTH, (IGB_MIN_TXPBSIZE - (IGB_TX_BUF_4096 + adapter->max_frame_size)) >> 6); + } - /* make low power state decision controlled - * by DMA coal - */ + if (hw->mac.type >= e1000_i210 || + (adapter->flags & IGB_FLAG_DMAC)) { reg = rd32(E1000_PCIEMISC); - reg &= ~E1000_PCIEMISC_LX_DECISION; + reg |= E1000_PCIEMISC_LX_DECISION; wr32(E1000_PCIEMISC, reg); } /* endif adapter->dmac is not disabled */ } else if (hw->mac.type == e1000_82580) { -- 2.35.1