From patchwork Wed Jun 17 20:51:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 217650 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=-8.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 0FC0AC433E0 for ; Wed, 17 Jun 2020 20:56:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1EA721556 for ; Wed, 17 Jun 2020 20:56:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hlHKcBqp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbgFQU4q (ORCPT ); Wed, 17 Jun 2020 16:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726758AbgFQU4q (ORCPT ); Wed, 17 Jun 2020 16:56:46 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AED94C06174E for ; Wed, 17 Jun 2020 13:56:45 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id b6so3815862wrs.11 for ; Wed, 17 Jun 2020 13:56:45 -0700 (PDT) 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=ODJBbeZcCQquLoXgh17IK5pd3cIH+B4P1lBpzq8f/YE=; b=hlHKcBqpJD1G3ikkD+HdvIXUTy1AYIIlbGP7QfACJ55ACoGIBuE1BWdlaWdxCHY8gk MmdBFCSPOTFn/TBHWNV4ghwSRAa3zRmP0weYMhypuZW7nZNwKwPrEJ57+3xjDGnOJXvm 0OXfOyWTQPDI87Qr4nLysay7WWuh90OwrOuvuImroJ93IrDOK3n9IaAH6dtAYIIAVg1v rCJNy8+YbeULzBpVEpEzfLbpesOY7UwE/eNct6BDT+PMnc93cM0G+LCPFaxLr3KtIF1K BGCPgJaJq2w6ylS1oC9m/lxTVpHgnfD5VyKpk7rFBoXiDIHElzzPUa+ej77n4xR5Ak9G daMA== 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=ODJBbeZcCQquLoXgh17IK5pd3cIH+B4P1lBpzq8f/YE=; b=AnXBNDsKvuIxHhdz5pookwED9TliyZ+3UGJoW5mR1KTdmOaaT3KVSUK3SwndC6UCzZ tm5Tme1sOQdfqFoPdXFb79Id1b1U2x51w4bLTPjIooV2rTAajEc7hTMVdyB2QKuvrMML NpF10b9ta8dcuxdAL9h2jTGWUgufZff1AYRRP5oiLLACxh6MynqceXIyM34tY4XaOeal gI+Y81Bsg4GRCXFA8f1xyc+rUzkQKKii+QwNKoYZoyvVzwRouwQ7sikRhc7wcGMAu4lV CtpCDwMaht7ilIhLxC+mFp8RoEULiX2D+ePfONo4RSZMYSa5IiUB1LAqMrJhvlGA/l2Z ypRA== X-Gm-Message-State: AOAM532mtunEF0yr/ULxJW/vWF//mA+xePn4OD37bQlYE3vCOm3HOd20 7YBNYdua/wmENAH21HjuyfBNdE16 X-Google-Smtp-Source: ABdhPJz2q19hiHyYEv+kAKBmaAchJP8jYawWm1RKLV/8Jx5Pd/qsVHBkbfcgw8neFYnkb9Uhoe2Bbg== X-Received: by 2002:adf:f450:: with SMTP id f16mr1055648wrp.307.1592427404131; Wed, 17 Jun 2020 13:56:44 -0700 (PDT) Received: from ?IPv6:2003:ea:8f23:5700:c06e:b26:fa7c:aab? (p200300ea8f235700c06e0b26fa7c0aab.dip0.t-ipconnect.de. [2003:ea:8f23:5700:c06e:b26:fa7c:aab]) by smtp.googlemail.com with ESMTPSA id q128sm969776wma.38.2020.06.17.13.56.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jun 2020 13:56:43 -0700 (PDT) Subject: [PATCH net-next 2/8] r8169: remove unused constant RsvdMask From: Heiner Kallweit To: Realtek linux nic maintainers , David Miller , Jakub Kicinski Cc: "netdev@vger.kernel.org" References: Message-ID: <64643297-cbef-e72e-5822-9c95fdc3aa9c@gmail.com> Date: Wed, 17 Jun 2020 22:51:46 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since 9d3679fe0f30 ("r8169: inline rtl8169_make_unusable_by_asic") this constant isn't used any longer, so remove it. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 7bb26fb07..4bc6c5529 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -529,8 +529,6 @@ enum rtl_rx_desc_bit { RxVlanTag = (1 << 16), /* VLAN tag available */ }; -#define RsvdMask 0x3fffc000 - #define RTL_GSO_MAX_SIZE_V1 32000 #define RTL_GSO_MAX_SEGS_V1 24 #define RTL_GSO_MAX_SIZE_V2 64000 From patchwork Wed Jun 17 20:54:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 217649 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=-8.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 4573CC433DF for ; Wed, 17 Jun 2020 20:56:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F1802098B for ; Wed, 17 Jun 2020 20:56:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F1QrE7lM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgFQU4w (ORCPT ); Wed, 17 Jun 2020 16:56:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726758AbgFQU4u (ORCPT ); Wed, 17 Jun 2020 16:56:50 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3E9FC061755 for ; Wed, 17 Jun 2020 13:56:48 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id e1so3843299wrt.5 for ; Wed, 17 Jun 2020 13:56:48 -0700 (PDT) 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=vYmfE6PX4DJYsHGd18sDMKqYyAIabImqTJD+c5+0RT8=; b=F1QrE7lMGGfokEKBUV5MeuaBzuF9lySShD7jaYITJqUuP5M+IWb6wgDAfT8xMY4pEh YtkU8x3TAvX/NLc9ooJ7uotGjRrAsEsMUJ5238znXeFEv/LM1FZlnbP2jC7NCzoueYyK lgiaEKar0DdjaQvUzoWmYFV/huaowhHsa4LLnyeuI0as3Xl1z2tavaCmN45RQlL2zZ6t FHfxfpew659jy5pTLBxfMuNYLMYX5JlRkRp37Wh8mhUNoQ2i8KTOJNcGh9CPW4SjjRYE WmwREO51eJf9PrkVSdYk4aLhQm6b3Umsfzz5yEmBl+c5yCLSwsA0nDMYpOgJVmfave83 SfDw== 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=vYmfE6PX4DJYsHGd18sDMKqYyAIabImqTJD+c5+0RT8=; b=ROTo0hnY1LcQKq2nieS1A9TfJq+L9UxgIqSh83fAD/vubmCrY4U3UqCGYE5Q0ZqOU6 FR2nqAzMyzTiNpH/S3Hgh70lVu4rtFkW+nlch25LgaoeG89chT3Fo8aPWcHVZk416/Ks igip1kXjJtd0IiOCSpS/RtkKXGJ2XbCuGhBAoNCcOuqxPmp7HziR9nSuAn1faHihhuVz N3lSdXwArOOWSMjr7C+kR1CLpTM/i7d/PO8LDLCv50Eb4SrkLPxIkGJn8jQPlpgevibD ++bYzafK7fYFrkwlNcjSSJQ75D7nS+m3GU7s9SPowCfMdYFj8UYiGU9Mf6UmY4VZmQpe 11MQ== X-Gm-Message-State: AOAM5303oMblE7mXheZwt8zVqpCkcLs9B/Wwuc3tra7HmBh0Y95tXuja rV9F6NIqyNPXK8EOPZS6LfC4TvrD X-Google-Smtp-Source: ABdhPJzeko5TovMMD2pWxwhCJFbdM3x4BVwF8gZFyeYqW4agPi/ZB0JNEvq6UjcwoI3/Fk0MiqXQeA== X-Received: by 2002:adf:97d3:: with SMTP id t19mr1177487wrb.116.1592427407226; Wed, 17 Jun 2020 13:56:47 -0700 (PDT) Received: from ?IPv6:2003:ea:8f23:5700:c06e:b26:fa7c:aab? (p200300ea8f235700c06e0b26fa7c0aab.dip0.t-ipconnect.de. [2003:ea:8f23:5700:c06e:b26:fa7c:aab]) by smtp.googlemail.com with ESMTPSA id o6sm899130wrp.3.2020.06.17.13.56.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jun 2020 13:56:46 -0700 (PDT) Subject: [PATCH net-next 5/8] r8169: move napi_disable call and rename rtl8169_hw_reset From: Heiner Kallweit To: Realtek linux nic maintainers , David Miller , Jakub Kicinski Cc: "netdev@vger.kernel.org" References: Message-ID: Date: Wed, 17 Jun 2020 22:54:18 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org rtl8169_hw_reset() meanwhile does more than a hw reset, therefore rename it to rtl8169_cleanup(). In addition move calling napi_disable() to this function. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 0d3e58ae1..afcdaace2 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -3926,8 +3926,10 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp) netdev_reset_queue(tp->dev); } -static void rtl8169_hw_reset(struct rtl8169_private *tp, bool going_down) +static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down) { + napi_disable(&tp->napi); + /* Give a racing hard_start_xmit a few cycles to complete. */ synchronize_net(); @@ -3970,10 +3972,9 @@ static void rtl_reset_work(struct rtl8169_private *tp) struct net_device *dev = tp->dev; int i; - napi_disable(&tp->napi); netif_stop_queue(dev); - rtl8169_hw_reset(tp, false); + rtl8169_cleanup(tp, false); for (i = 0; i < NUM_RX_DESC; i++) rtl8169_mark_to_asic(tp->RxDescArray + i); @@ -4636,9 +4637,8 @@ static void rtl8169_down(struct rtl8169_private *tp) bitmap_zero(tp->wk.flags, RTL_FLAG_MAX); phy_stop(tp->phydev); - napi_disable(&tp->napi); - rtl8169_hw_reset(tp, true); + rtl8169_cleanup(tp, true); rtl_pll_power_down(tp); From patchwork Wed Jun 17 20:54:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 217647 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=-8.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 50540C433E0 for ; Wed, 17 Jun 2020 20:57:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21AAC2098B for ; Wed, 17 Jun 2020 20:57:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XUaemYpP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727062AbgFQU47 (ORCPT ); Wed, 17 Jun 2020 16:56:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727039AbgFQU4u (ORCPT ); Wed, 17 Jun 2020 16:56:50 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE32FC0613ED for ; Wed, 17 Jun 2020 13:56:49 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id c71so3185605wmd.5 for ; Wed, 17 Jun 2020 13:56:49 -0700 (PDT) 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=C5DNTnXnkRtABG/Bftdda+H+IOHqLzkfj0xWc+xS8FM=; b=XUaemYpP4vDF+pFcDgC2S5vbpFKszZvJWz4nZQYr1/9pc0i7ubq48MZX12babvEa1P 0sjV7C5ee+DB63nlNLOKjCHuVCdwO4z3LI3U/LDS7YNd8zQXRnrArxQHfwUx3RhCGbej kPdzOKU/lb/VOvJz/dQ9GkJOdYNxEnzUg/V2zZ4Qlkh0wz9B94KupVpdRYFLgPt4wDZ0 y+eTll49Pt2ddNIv38Y61wMD4CUxZFmJo+SBcIICjDym6w17nS32xN5G6jhRf5fAHoZR IDYeK+/dqAmypxidHDmOPIfZLABcdn8Sh8vfMNzqsmDT/7zT3LldgvUNRr84EGLGqExQ p4kA== 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=C5DNTnXnkRtABG/Bftdda+H+IOHqLzkfj0xWc+xS8FM=; b=fTJCroJWMTYBpJuKRBL2k4lgenuPbRQR/ThRdXJfBUHfl9+DZ1HeveuQq+JgTYQRP5 HwsN1IvGbraj8m+tyv7KCCmlsMl4GjN6e3Urs3qYMz9TGlkAINFu7H0NWvrFIv/Erpav MPSbD0oFCFXY31fxLFiWXGcwZJVj9/FKHyxjuWbL/t5M9IMiGXXzxaRquhwwn+cQiyAs yXuqLGSCGSzbWuiHIpoYVaXkbl8ECFyTqa1tPoGFzp/KfmsW7fyeNNa2RyRc/kb6IPxq 2CTQITPRisI81BNczEm0sKRQEmYEp1Gmtafoc0bkagc9sFHdMmKd7ZOEHPuS41/4r55U a48w== X-Gm-Message-State: AOAM530vFhknq/WBlWYbsD6YKHgVYrpayMUqbXkMJDJg1/LQUYRQu4Y/ XM+pev7kHtI6eOwi5Of3vIxzP6UT X-Google-Smtp-Source: ABdhPJzt1GnogQcmbjMox2tGVGPyaSuCdELHp6ibSJmHtStqXwWwTXW2sxB2sfoyOlNMRWQWF+uriA== X-Received: by 2002:a1c:7505:: with SMTP id o5mr549806wmc.164.1592427408270; Wed, 17 Jun 2020 13:56:48 -0700 (PDT) Received: from ?IPv6:2003:ea:8f23:5700:c06e:b26:fa7c:aab? (p200300ea8f235700c06e0b26fa7c0aab.dip0.t-ipconnect.de. [2003:ea:8f23:5700:c06e:b26:fa7c:aab]) by smtp.googlemail.com with ESMTPSA id q13sm828851wrn.84.2020.06.17.13.56.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jun 2020 13:56:47 -0700 (PDT) Subject: [PATCH net-next 6/8] r8169: move updating counters to rtl8169_down From: Heiner Kallweit To: Realtek linux nic maintainers , David Miller , Jakub Kicinski Cc: "netdev@vger.kernel.org" References: Message-ID: Date: Wed, 17 Jun 2020 22:54:54 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Counters are updated whenever we go down, therefore move the call to rtl8169_down(). Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index afcdaace2..9f99b3f07 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4638,6 +4638,8 @@ static void rtl8169_down(struct rtl8169_private *tp) phy_stop(tp->phydev); + rtl8169_update_counters(tp); + rtl8169_cleanup(tp, true); rtl_pll_power_down(tp); @@ -4652,9 +4654,6 @@ static int rtl8169_close(struct net_device *dev) pm_runtime_get_sync(&pdev->dev); - /* Update counters before going down */ - rtl8169_update_counters(tp); - netif_stop_queue(dev); rtl8169_down(tp); rtl8169_rx_clear(tp); @@ -4875,9 +4874,6 @@ static int rtl8169_runtime_suspend(struct device *device) rtl8169_net_suspend(tp); - /* Update counters before going runtime suspend */ - rtl8169_update_counters(tp); - return 0; } From patchwork Wed Jun 17 20:56:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 217648 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=-8.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 3F248C433E2 for ; Wed, 17 Jun 2020 20:56:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C7822098B for ; Wed, 17 Jun 2020 20:56:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jFtWTOen" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726815AbgFQU4y (ORCPT ); Wed, 17 Jun 2020 16:56:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727051AbgFQU4x (ORCPT ); Wed, 17 Jun 2020 16:56:53 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C30D0C061755 for ; Wed, 17 Jun 2020 13:56:51 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id r7so3862942wro.1 for ; Wed, 17 Jun 2020 13:56:51 -0700 (PDT) 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=e2uEbfhiW8TczOATnDb4CRx8CnIR8PSnuYhqZA/V3hA=; b=jFtWTOent+BW8GEwNFKoJ+J1/hJos2l8WrYD4ikGwt/0sqHIwkjnvERUDs9U4ph3eC 0EZmvlj4sKS6sksPA/7DZs/p7IL6S2+pSlh2WrU6r/+6u1mhxXBMpWSZ/Dff5l6LKp9T vo1ZI6HEiNc99lWX+8+FkDSG2MD37wsAssc/Ang3deivzUtSn1Kz/eNgxm2+uoAoyA26 ic0+XorXdR33VjsjRHZgUxkbLvIRFLEtbRe6NgRZ+zBzkKBjFzwrnY5pRxNSZSwxiKHm CNivOwvDf5w+c5oJF2Ylcl7ZLc6Ebuqy6zB0vdOdDyc/rRp1s663KaPf+MY73v1d2X+K jjbg== 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=e2uEbfhiW8TczOATnDb4CRx8CnIR8PSnuYhqZA/V3hA=; b=AAP0Xurvn5mZXyYiu6uVssQIKtvnPm+LxXbTzZbkgsTW8Vd9SZ4CVDw/m4cBDjF0OS L1wv0BlyahYCwJ2hfdZhOXkXKGcnXX7ZGAkbAHSpmF20lfPCvfVsdFMf50jphSxe8UvK RMUngA0pEpCYw2n7aXyt/155v321yFruRH5OS6VYqohoAA3swuMxGeb44jzp6W549eN4 R4kYrDtZTGOirCaTw2tH9BvkT76ysVcqxisES7a1hO6KIoiE8HyFC6ciQbv7rWEz+R9J lvL5/JHLj/CjwjyZ2vM7JwM/uqTSn9zgaekzbgP50sGgsvTFkCbHEAHN1RVlWTls0waK KFlw== X-Gm-Message-State: AOAM5329AeYxACVFBygSlbSIO8Ul4msY7Xw+x1U/x4lBbYsQ9vwtTsBr KzBi8kPGl+rVdRsPUHiwtCM09YHe X-Google-Smtp-Source: ABdhPJwFoBCF8lclBsSqptikOdFDHIcm4KRmmy3lvi+Dt9Zo1TVhs8GbKdv3fMmRy6H7sYoEkKIOMA== X-Received: by 2002:a5d:40d2:: with SMTP id b18mr1045860wrq.131.1592427410237; Wed, 17 Jun 2020 13:56:50 -0700 (PDT) Received: from ?IPv6:2003:ea:8f23:5700:c06e:b26:fa7c:aab? (p200300ea8f235700c06e0b26fa7c0aab.dip0.t-ipconnect.de. [2003:ea:8f23:5700:c06e:b26:fa7c:aab]) by smtp.googlemail.com with ESMTPSA id v66sm1065833wme.13.2020.06.17.13.56.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jun 2020 13:56:49 -0700 (PDT) Subject: [PATCH net-next 8/8] r8169: allow setting irq coalescing if link is down From: Heiner Kallweit To: Realtek linux nic maintainers , David Miller , Jakub Kicinski Cc: "netdev@vger.kernel.org" References: Message-ID: Date: Wed, 17 Jun 2020 22:56:27 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org So far we can not configure irq coalescing when link is down. Allow the user to do this, and assume that he wants to configure irq coalescing for highest speed. Otherwise the irq rate is low enough anyway. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index d55bf2cd2..a3c4187d9 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -1731,16 +1731,16 @@ struct rtl_coalesce_info { #define COALESCE_DELAY(d) { (d), 8 * (d), 16 * (d), 32 * (d) } static const struct rtl_coalesce_info rtl_coalesce_info_8169[] = { - { SPEED_10, COALESCE_DELAY(40960) }, - { SPEED_100, COALESCE_DELAY(2560) }, { SPEED_1000, COALESCE_DELAY(320) }, + { SPEED_100, COALESCE_DELAY(2560) }, + { SPEED_10, COALESCE_DELAY(40960) }, { 0 }, }; static const struct rtl_coalesce_info rtl_coalesce_info_8168_8136[] = { - { SPEED_10, COALESCE_DELAY(40960) }, - { SPEED_100, COALESCE_DELAY(2560) }, { SPEED_1000, COALESCE_DELAY(5000) }, + { SPEED_100, COALESCE_DELAY(2560) }, + { SPEED_10, COALESCE_DELAY(40960) }, { 0 }, }; #undef COALESCE_DELAY @@ -1756,6 +1756,10 @@ rtl_coalesce_info(struct rtl8169_private *tp) else ci = rtl_coalesce_info_8168_8136; + /* if speed is unknown assume highest one */ + if (tp->phydev->speed == SPEED_UNKNOWN) + return ci; + for (; ci->speed; ci++) { if (tp->phydev->speed == ci->speed) return ci;