Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1909349imm; Thu, 11 Oct 2018 01:41:20 -0700 (PDT) X-Google-Smtp-Source: ACcGV62vxDMY84TJqI74HnCGZgUHrPUgyT/QjaVdYhbpMVca9Y63JX1TpEnqxYiRz1HLxz4ZPFvC X-Received: by 2002:a63:6d83:: with SMTP id i125-v6mr559411pgc.215.1539247280736; Thu, 11 Oct 2018 01:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539247280; cv=none; d=google.com; s=arc-20160816; b=hU+3WlgloHHeCgu1J8SdD00EfLAjv7PHrXMs58EwGHsGcnKExTI6yrPRkPBnDyv1GJ RqvINCkBtd7PhBg8P24/0N8zvydAK+dFy9XQl+zo7HelAtwH4W1bg9bBPoi4vZFhf3kb C+e5CqW5mbyhY/rJuDH4549rqpRF+/sIi+I0A1haEvzJYi8DA0B5Bsy5SxU+HaRmvYd0 POPUKwD2PHAwECtOiUo3mlG3Gm/9kRzuVzyYHEKhQCP5nr/S12UiP7bhHl9CpPd6xz+z uOpk3Eg1vCRqghY18cK/xaZj4iJkxc7XhQqluqC2hQv4wLz+aDtePF/bFaFyswpXRImk A4Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=NKlhUW7lccWni3+Ehf5nmz/T1BQJupZvCVQZ/n7zgGM=; b=BOn7IpuVdQqFXdLWkVOejXRPD2tv1XExNXBAfvCxjUoXkATHEN2IfjSm5lO8IUpIle SN0IReBxjLE+gZifPxRBHB++J4+7VvQWUIcTxrCe2IrSY0hjWbs/nnsl69bL0QLeIiOx x3Dks9dWQj0vJJnvqy/gX7x1QTU2Z6G+VcWnAg+Km6dEh7NeEju/zGVVmFeaH/JAETRP HLtDXGZB+4nBc4FH+sWB8JeTu4jLnzEAM8V8/JUSmV6EdBJf5MMvF6ppd5t1KmJtMu+j 2LWAFjYmqTPUJtaOS/+eFg2H8nB7a3ltReWEnZwgmDmPQBHNCRpqVTuUEUWQnOBV0aqf QYrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=jL1NoV1j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5-v6si26280056pgw.184.2018.10.11.01.41.05; Thu, 11 Oct 2018 01:41:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=jL1NoV1j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727863AbeJKPug (ORCPT + 99 others); Thu, 11 Oct 2018 11:50:36 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35466 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726205AbeJKPug (ORCPT ); Thu, 11 Oct 2018 11:50:36 -0400 Received: by mail-wm1-f67.google.com with SMTP id e187-v6so8432027wmf.0 for ; Thu, 11 Oct 2018 01:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NKlhUW7lccWni3+Ehf5nmz/T1BQJupZvCVQZ/n7zgGM=; b=jL1NoV1j+rTx/JhwEl7SSxiCbtXvVfV+tnao6WOVqtW8dfECwWBFuCBsa+H22WCo7j KDbq/K2XUk8pKObHA8LPCnxXLVrPz15J/uiclEi/AqIaoEyfOecONxJWHUPZ7BaTYgDp HYO9LVQCeWndNVXwZtn2s5yzNUWaSQgeA5GO81FUP9a79/glKv5nRG0t8Q3A97TT7n92 hRdVvSGWn089cWmgJLIw1ojmlIUrBwA8j0clMdIrAlrUSgwdHXdCHFpO8k5rf9YwRMJh +I0fIje880sqHJIbG8pqPqrrk/2NZ0KxdM6WoQ1BbbwxjhVcVEDEbGIPGMTJbE8z2Yas tqNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NKlhUW7lccWni3+Ehf5nmz/T1BQJupZvCVQZ/n7zgGM=; b=WWK/BqMeoKXHrS3Zp79V5tVoYbDCuglKSUbXObwamsIqpefvvCZPu2ShgStyvVNQA2 9AAYDcuMDWFz+6zOr/o6BTPlCocYUCZvAy+XDrblmV2tbfRcOI8i3aBdvxpsi6jLDOhb fqBlqe9kbcGt8Gv8UsFcnCuGqGKs15GfZ8Z2tXG0qMOe0bAc7nBdLccm7eyVHjLQqmcH O80r5s8Q5d8ppIV7BEPuffudrjFMSFTVtxJV9ZB2bFOnynEzdlTS5QXpkQPgVdMrrOde 9dGLhSvpgU4kcIT71p7/cRmVYego4MtiG5D9B4iJzd08F/PcDlt/9WNIfotbBE2G5qs/ O5Ug== X-Gm-Message-State: ABuFfoiTQqKM/vpow9eQM3kWUzc/zQ0Zr74mpvoBO7M5+LOSBX5XY6+m pmyEgFclJK1uovYKSKRXfXxa886B X-Received: by 2002:a1c:a505:: with SMTP id o5-v6mr749413wme.53.1539246262168; Thu, 11 Oct 2018 01:24:22 -0700 (PDT) Received: from [192.168.0.20] ([94.1.125.110]) by smtp.googlemail.com with ESMTPSA id r16-v6sm32631448wrv.21.2018.10.11.01.24.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Oct 2018 01:24:21 -0700 (PDT) Subject: Re: R8169: Network lockups in 4.18.{8,9,10} (and 4.19 dev) To: "Maciej S. Szmigiero" Cc: Heiner Kallweit , "David S. Miller" , Azat Khuzhin , Greg Kroah-Hartman , Realtek linux nic maintainers , linux-kernel References: <54d8d7e9-a80d-dc2b-5628-22f9dc14e2ee@maciej.szmigiero.name> <535f42c7-6c3b-8e5a-49de-5dc975879b21@googlemail.com> <98680351-5123-761f-982a-726098da9716@gmail.com> <9980dcc1-f7fe-5de7-75be-99b1592c9206@googlemail.com> <6b1685ce-22ac-2c71-e1d4-b05748a7d977@googlemail.com> <7199b1e4-ce40-60ae-2a6a-ef7e95e563ea@googlemail.com> <0e206e6b-3d0c-de27-dedb-48c30e02649c@gmail.com> <9d99060a-db1d-7177-3041-e407b131548e@maciej.szmigiero.name> <0b490a74-c8b3-7206-33ba-d99be73c18fd@googlemail.com> From: Chris Clayton Message-ID: Date: Thu, 11 Oct 2018 09:24:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/2018 01:12, Maciej S. Szmigiero wrote: > On 11.10.2018 00:49, Chris Clayton wrote: >>> Now, knowing the "right" value you can experiment with what rtl_init_rxcfg() >>> writes (under the "default:" label for your NIC model). >>> >> >> This might be more interesting. Through a combination of viewing the output from pr_notice() and the output from >> "ethtool -d", I can see RxConfig with the following values >> >> During boot: 0x00028700 >> Before suspend: 0x0002870e >> During resume: 0x00024000 >> Post resume: 0x0002870e >> >> As I did with 4.18.10 early on in the process, I removed the call to rtl_init_rxcfg() from rtl_hw_start() and rebuilt, >> installed and rebooted. Now I see the following values: >> >> During boot: 0x00028700 >> Before suspend: 0x0002870e >> During resume: 0x00024000 >> Post resume: 0x0002400e >> > > Now we can finally see some difference... > Besides missing RX128_INT_EN (bit 15 or 0x8000) and RX_DMA_BURST > (bits 8-10 or 0x700) - that rtl_init_rxcfg() would normally set so this > is kind of expected - one can see that the working configuration > post-resume has bit 14 (or 0x4000) set, too. > > This bit is described in the driver as RX_MULTI_EN ("8111c only") and is > set by rtl_init_rxcfg() for example for RTL_GIGA_MAC_VER_35. > > RTL_GIGA_MAC_VER_35 is described in the driver as being in the same > family as your RTL_GIGA_MAC_VER_38, so can you please try the following > change: > --- r8169.c > +++ r8169.c > @@ -4271,6 +4271,7 @@ static void rtl_init_rxcfg(struct rtl816 > case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_24: > case RTL_GIGA_MAC_VER_34: > case RTL_GIGA_MAC_VER_35: > + case RTL_GIGA_MAC_VER_38: > RTL_W32(tp, RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST); > break; > case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_51: > > This will add RX_MULTI_EN also for your chip model (you need to add back > the call to rtl_init_rxcfg() to rtl_hw_start(), naturally). > That's done the trick. With the above change applied, my network runs running fine after a suspend/resume cycle and the ping times are back in the 14-15ms range. Chris > If this does not help then I would try another values in the above write: > 1) RTL_W32(tp, RxConfig, 0x00024000); > 2) RTL_W32(tp, RxConfig, 0x00004000); > 3) RTL_W32(tp, RxConfig, RX_DMA_BURST); > 4) RTL_W32(tp, RxConfig, RX128_INT_EN); > >> Chris > > Maciej >