From patchwork Sat Jan 9 22:00:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 12008761 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE8E4C433DB for ; Sat, 9 Jan 2021 22:01:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5E7623AC0 for ; Sat, 9 Jan 2021 22:01:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbhAIWAs (ORCPT ); Sat, 9 Jan 2021 17:00:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726001AbhAIWAr (ORCPT ); Sat, 9 Jan 2021 17:00:47 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEAB8C061786 for ; Sat, 9 Jan 2021 14:00:06 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id g185so11443314wmf.3 for ; Sat, 09 Jan 2021 14:00:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XnRBXE2Uk4fUuCY80HK3W9/qzTDABtTxWxYyxmg/WxU=; b=qy4nqhfp4+67Mgqcb23YFSFCBgkr8xYJb2piP1lp0mQKiY0B7asu61FZY8oBHiY3Dk N7aRBVD3lg2T2ZSGyCbuGSvTQQc+0a3MOKCyvz+APLoQtha9k7s2L99KSV9e/52FVZ35 FcftjRxBQn3+TWbsLXl1plgbwxqGNSwd72CRX1Hmr+Ngvy+7g1XZ9CG6j6pYZO4unYj9 LGYd9LNVPsOFOl+7XJdQ9kZpeYSEvAe/d0gRC1Oz2gWurk12cPgVnwumiFkOblFzaZm/ DRPRGtGSTqWM/xqD7SOj1cRRV3gv9X9YoTedBSBCm7VFCCi0Ws0uvayxC9ivxkuJs9s+ 2kjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XnRBXE2Uk4fUuCY80HK3W9/qzTDABtTxWxYyxmg/WxU=; b=As2IaYybFsOFsiYLRQSuguY+z0JH8cH2EdAwZm/jX+tZYEzJ61J/OMyz9pUxPZfU4K Tm1h4ABQpkhgASFD9Xpam1I/LS9x7jTWeAHgyG8p+L0RmbYQ/KyxclehvZ4IHNgDvVqF 2/g0cWK0Pzu8mKE/vl3jvpTBxtvrJTwYVshsS5dgA3G7Ic63H98HvvOrMSD9EfIPWPxG zSTywWv8ryE2MLhDk3CdzbhibuArBKc7ZJnfGso+akYyuqA3ugLCbJ17m+mGKVAFFmae Aqe12sKIWAaxA4sJxfDW9fhqw/OCB/jo1THjAYCoLO5rHyWa5cgdJAUDbSCmBicZPhIL 8xbQ== X-Gm-Message-State: AOAM533u2QVgcoJdNhZmcezJJI/OwKW05+So97P5W57UTKhsqTYYtaTE GOU7ZExwnd6jYg9abzWCaRFEsgblmyo= X-Google-Smtp-Source: ABdhPJxvTtL2YvHVPupr69xhvmd5fD/Gg3zUmwUWA9L5jtKbhfF2aILtEXL2BxDpZc73EJ9gSSaKLA== X-Received: by 2002:a1c:9609:: with SMTP id y9mr8415509wmd.75.1610229605533; Sat, 09 Jan 2021 14:00:05 -0800 (PST) Received: from ?IPv6:2003:ea:8f06:5500:a584:5efe:3c65:46c1? (p200300ea8f065500a5845efe3c6546c1.dip0.t-ipconnect.de. [2003:ea:8f06:5500:a584:5efe:3c65:46c1]) by smtp.googlemail.com with ESMTPSA id x13sm19700096wrp.80.2021.01.09.14.00.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Jan 2021 14:00:04 -0800 (PST) Subject: [PATCH net-next 1/2] r8169: align RTL8168e jumbo pcie read request size with vendor driver From: Heiner Kallweit To: Jakub Kicinski , David Miller , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" References: <1dd337a0-ff5a-3fa0-91f5-45e86c0fce58@gmail.com> Message-ID: Date: Sat, 9 Jan 2021 23:00:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <1dd337a0-ff5a-3fa0-91f5-45e86c0fce58@gmail.com> Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Align behavior with r8168 vendor driver and don't reduce max read request size for RTL8168e in jumbo mode. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 74c8248ba..8336f1434 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2342,12 +2342,10 @@ static void rtl_jumbo_config(struct rtl8169_private *tp) r8168dp_hw_jumbo_disable(tp); break; case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_33: - if (jumbo) { - pcie_set_readrq(tp->pci_dev, 512); + if (jumbo) r8168e_hw_jumbo_enable(tp); - } else { + else r8168e_hw_jumbo_disable(tp); - } break; default: break; From patchwork Sat Jan 9 22:01:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 12008763 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD13CC433DB for ; Sat, 9 Jan 2021 22:02:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71F7123B00 for ; Sat, 9 Jan 2021 22:02:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726223AbhAIWCB (ORCPT ); Sat, 9 Jan 2021 17:02:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbhAIWCB (ORCPT ); Sat, 9 Jan 2021 17:02:01 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9778EC061786 for ; Sat, 9 Jan 2021 14:01:20 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id g185so11444696wmf.3 for ; Sat, 09 Jan 2021 14:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A58bqbte09j/S6kQElqfLXG75xD/nuBPe8OvUZ9+gnk=; b=uh1xxdmKLnSMP9DnKhQ/3irJDFbd2jhfmpr/wrkofMWTNwOup/n+YxRBQtXvQYc90N 8XIrBD9lb0Vv3f6WvKuKPrBjaC6qmQ8u1yGmC4yZxmcgSxeiD7hxZ6otUMJyHbAwDjFb L/yUQpeMaHxaUrAYUvu/DVf5i3tku1QkEq9OK9VsZGI0420WKAd3Eyqw7Mlj+1Wte9TD 1sOTw2WQpfHkQfYxJq2xT40zWqr6leJxF+coktcoQlZBAaHwDGyyZIMvB6QDDTCurpwf vYhesgm4qRo3zOZIUwMyKxpMER9OIa5yyzsvKJY8onYOHg/KaMUNc268PhMnP2kVAMFu xRSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A58bqbte09j/S6kQElqfLXG75xD/nuBPe8OvUZ9+gnk=; b=H6safMxgi99vOzbotedCA91TknObcIXs04xCZiTYNZQjnDKjhODCkabc6KaxYTWaNz wAvAA4/CCFtJ+ede2GGSWcqEDULti1UQF1RKk8RK1YK+n7QTT+Co0Mjj2Pu1jELcvNh0 vXGBn9cO2AfBVlW7YI8F+3V0nE8WO2Xv4Jl2eClmh7xtnepxP2wDCul4fa4PAZ1wQdeo KXRuc+ZR/fZjDQTRHCvzTUC2AH1uEsJCcC6et3LWwmH/rqY9uzeohHJW0HTzy1AL/9dG KgwVOE/N+YNurcsPQUHnqT7j+/QDpJROYtw+Fb/W6K0TeKcphrZJn2eTxoSi3Xux7CDI WOUw== X-Gm-Message-State: AOAM530VrLfF0ew53CTSTEB5F9E15a22/1ao1vTnbM2svxiSP5pEfZLj TmLrzy2QL+87FvPIt51tH4ufWNaaWe0= X-Google-Smtp-Source: ABdhPJymMdf7rMdt1dROr2NA/geIO09lMtvUMKh3da+9qi3K8hTQPr6J0iRRUFC6OfNrZYUo2b19qg== X-Received: by 2002:a05:600c:2306:: with SMTP id 6mr8584483wmo.53.1610229679054; Sat, 09 Jan 2021 14:01:19 -0800 (PST) Received: from ?IPv6:2003:ea:8f06:5500:a584:5efe:3c65:46c1? (p200300ea8f065500a5845efe3c6546c1.dip0.t-ipconnect.de. [2003:ea:8f06:5500:a584:5efe:3c65:46c1]) by smtp.googlemail.com with ESMTPSA id l16sm18610798wrx.5.2021.01.09.14.01.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Jan 2021 14:01:18 -0800 (PST) Subject: [PATCH net-next 2/2] r8169: tweak max read request size for newer chips also in jumbo mtu mode From: Heiner Kallweit To: Jakub Kicinski , David Miller , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" References: <1dd337a0-ff5a-3fa0-91f5-45e86c0fce58@gmail.com> Message-ID: <1b681298-33ff-8ff0-ffc8-aa8110d3d1fc@gmail.com> Date: Sat, 9 Jan 2021 23:01:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <1dd337a0-ff5a-3fa0-91f5-45e86c0fce58@gmail.com> Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org So far we don't increase the max read request size if we switch to jumbo mode before bringing up the interface for the first time. Let's change this. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 8336f1434..6e4c60185 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2315,13 +2315,14 @@ static void r8168b_1_hw_jumbo_disable(struct rtl8169_private *tp) static void rtl_jumbo_config(struct rtl8169_private *tp) { bool jumbo = tp->dev->mtu > ETH_DATA_LEN; + int readrq = 4096; rtl_unlock_config_regs(tp); switch (tp->mac_version) { case RTL_GIGA_MAC_VER_12: case RTL_GIGA_MAC_VER_17: if (jumbo) { - pcie_set_readrq(tp->pci_dev, 512); + readrq = 512; r8168b_1_hw_jumbo_enable(tp); } else { r8168b_1_hw_jumbo_disable(tp); @@ -2329,7 +2330,7 @@ static void rtl_jumbo_config(struct rtl8169_private *tp) break; case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_26: if (jumbo) { - pcie_set_readrq(tp->pci_dev, 512); + readrq = 512; r8168c_hw_jumbo_enable(tp); } else { r8168c_hw_jumbo_disable(tp); @@ -2352,8 +2353,8 @@ static void rtl_jumbo_config(struct rtl8169_private *tp) } rtl_lock_config_regs(tp); - if (!jumbo && pci_is_pcie(tp->pci_dev) && tp->supports_gmii) - pcie_set_readrq(tp->pci_dev, 4096); + if (pci_is_pcie(tp->pci_dev) && tp->supports_gmii) + pcie_set_readrq(tp->pci_dev, readrq); } DECLARE_RTL_COND(rtl_chipcmd_cond)