From patchwork Wed Aug 14 09:29:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 267008 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A36602C0100 for ; Wed, 14 Aug 2013 19:29:33 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751589Ab3HNJ32 (ORCPT ); Wed, 14 Aug 2013 05:29:28 -0400 Received: from merlin.infradead.org ([205.233.59.134]:48965 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751168Ab3HNJ30 (ORCPT ); Wed, 14 Aug 2013 05:29:26 -0400 Received: from dhcp-077-248-225-117.chello.nl ([77.248.225.117] helo=twins) by merlin.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9XOK-0002NJ-C9; Wed, 14 Aug 2013 09:29:22 +0000 Received: by twins (Postfix, from userid 1000) id A3B4580DF775; Wed, 14 Aug 2013 11:29:15 +0200 (CEST) Date: Wed, 14 Aug 2013 11:29:15 +0200 From: Peter Zijlstra To: Francois Romieu Cc: nic_swsd@realtek.com, netdev@vger.kernel.org Subject: Re: r8169 OOPSen in rtl_rx Message-ID: <20130814092915.GF24092@twins.programming.kicks-ass.net> References: <20130813094314.GW3008@twins.programming.kicks-ass.net> <20130813211534.GA5635@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130813211534.GA5635@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Aug 13, 2013 at 11:15:34PM +0200, Francois Romieu wrote: > Peter Zijlstra : > [...] > > I've got an AMD x86_64 machine with two realtek NICs: > > > > 01:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10) > > 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06) > > Which XID (see kernel dmesg) ? $ dmesg | grep -i xid [ 1.706427] r8169 0000:01:08.0 eth0: RTL8110s at 0xffffc9000063ac00, 00:0e:2e:87:8b:70, XID 04000000 IRQ 18 [ 1.717012] r8169 0000:03:00.0 eth1: RTL8168e/8111e at 0xffffc90000646000, a0:f3:c1:00:74:a3, XID 0c200000 IRQ 43 > > So all I've got to offer currently is a partial backtrace -- see > > attached image. > > (no attachment) Oh, duh.. > > Partial transcribe: > > > > ? rtl8169_try_rx_copy.isra.77 > > /me scratches head. > > You may check that pkt_size is > 0, <= ETH_FRAME_LEN (no jumbo ?) and > see if it helps. So eth0 runs at 1000Mb/s but has a MTU:1500, eth1 runs at 100Mb/s also MTU:1500. I'll try a kernel with the below. Hopefully the change in dumpstack_64.c will avoid printing the 'process' stack and give a little more useful information. Will let you know. Thanks --- arch/x86/kernel/dumpstack_64.c | 7 ++++--- drivers/net/ethernet/realtek/r8169.c | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index addb207..f76e98f 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c @@ -182,7 +182,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, stack = (unsigned long *) (irq_stack_end[-1]); irq_stack_end = NULL; ops->stack(data, "EOI"); - continue; + goto out; } } break; @@ -192,6 +192,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, * This handles the process stack: */ bp = ops->walk_stack(tinfo, stack, bp, ops, data, NULL, &graph); +out: put_cpu(); } EXPORT_SYMBOL(dump_trace); @@ -231,8 +232,8 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, pr_cont(" "); } } else { - if (((long) stack & (THREAD_SIZE-1)) == 0) - break; + if (((long) stack & (THREAD_SIZE-1)) == 0) + break; } if (i && ((i % STACKSLOTS_PER_LINE) == 0)) pr_cont("\n"); diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 393f961..76d1c18 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -6185,6 +6185,8 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget else pkt_size = status & 0x00003fff; + WARN_ON(!(pkt_size > 0 && pkt_size <= ETH_FRAME_LEN)); + /* * The driver does not support incoming fragmented * frames. They are seen as a symptom of over-mtu