Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2908257iog; Mon, 27 Jun 2022 05:33:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sUuec5p+LSMGdilHjvYORoNO7TCxQhXoGrrqRePWRNa+Uv80yxgaDluZheI7kiGA1rypXQ X-Received: by 2002:a63:8f13:0:b0:40c:f042:13a8 with SMTP id n19-20020a638f13000000b0040cf04213a8mr12901097pgd.619.1656333184414; Mon, 27 Jun 2022 05:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333184; cv=none; d=google.com; s=arc-20160816; b=MjM04Yqzfn+RcS0iTO32F7Vpl0amMCg9msi98v/s/XDC7q1C+Hd+IlTVRHSnfoXvVs fRcY3zeUYmFkoul93HaQoOPN3g/K7HarTxywd6W0w/wLyUOpQ9o285D/k1si1K2VjaG3 kavqFVFET1IJo7fCNS2LYb4BRN1UKZ3R9ad31lYnzpiHrpOao6qwjVkZ96F88sVz2kPD Mi6o/DW4Ac4RwDYqj5rwxLInvJP7wbfL96G7Tn7LvazIs4lLRZzIjos3YzCEkS+WB8jY WtUK466cKhcJ34iR8/nXZo8gY+XICLAbuen2f5riUlB58V7S6ebvgwACY+Y+hya0I0cF VBEg== 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=Yzfg00HIF9U6Ic7aQlLMWIBkvXQkFNlv8mplspo2Bvs=; b=oNi+lxJEZ0ZZb0Tp4790/XawBdKuT4iwSAHQ4GrypGa35Vr+I/yRxNy/DairljGj5o lzL3vsQkmXO4fF4iX2U8eIw0ZXNeLrAGmRYIavbXzBvZf4Siru4ohd/+6RjuSP6sKx5L LXpINvXnj+rUzCoBjMKjKz2qR8MaAcXXys2XVHQlENPwcFMdjb2Jf0gDlm2iWQ4Kogan hJ38AIgRWl6+WTPiMZ/imeCXXZ+cvoE++fKzX9MJ3HbrTo+oSYSg6wtUBuULhm1/9yLa 1yw0wWykh4F9/JIPavtUjvBuYJ15f5hCmNYpvU7ePyE8D3AnMZ0vPK+iBEsQOTvuKQSc fRJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ccOwSlYi; 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 t8-20020aa79468000000b0051b8e733ccbsi13304096pfq.175.2022.06.27.05.32.51; Mon, 27 Jun 2022 05:33:04 -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=ccOwSlYi; 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 S239531AbiF0L5t (ORCPT + 99 others); Mon, 27 Jun 2022 07:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238398AbiF0LvA (ORCPT ); Mon, 27 Jun 2022 07:51:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEAE9273C; Mon, 27 Jun 2022 04:44:14 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 6DFC761240; Mon, 27 Jun 2022 11:44:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 746E3C3411D; Mon, 27 Jun 2022 11:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330253; bh=GiDzQmzabrQ7JJBQ5zVwfXS6sNu4+TFRzJb4EEqmDdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ccOwSlYidX8TaecCo8a+FRF3eBuQXd0wZ6SWFVJDCfHEoTvr5hTa5BO291NFt5WdX v9hZAtT5phqcLg2L3EbTQwcIS0lzszi7GSuHXOLDVFHV+E982Cy+XpkXCfa+0ek6z+ 0Srv30z9eC/MSmZg4hDEz+I8gwD77mCPC+h/insg= 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.18 095/181] igb: Make DMA faster when CPU is active on the PCIe link Date: Mon, 27 Jun 2022 13:21:08 +0200 Message-Id: <20220627111947.312659465@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@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 1c26bec7d6fa..c5f04c40284b 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -9901,11 +9901,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); @@ -9938,7 +9937,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 @@ -9955,12 +9953,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