From patchwork Fri Feb 18 09:30:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francois Romieu X-Patchwork-Id: 83549 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 33356B70A5 for ; Fri, 18 Feb 2011 20:34:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753613Ab1BRJd5 (ORCPT ); Fri, 18 Feb 2011 04:33:57 -0500 Received: from violet.fr.zoreil.com ([92.243.8.30]:36893 "EHLO violet.fr.zoreil.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752994Ab1BRJdz (ORCPT ); Fri, 18 Feb 2011 04:33:55 -0500 Received: from violet.fr.zoreil.com (localhost [127.0.0.1]) by violet.fr.zoreil.com (8.13.8/8.13.8) with ESMTP id p1I9U13c012113; Fri, 18 Feb 2011 10:30:01 +0100 Received: (from romieu@localhost) by violet.fr.zoreil.com (8.13.8/8.13.8/Submit) id p1I9U0bI012112; Fri, 18 Feb 2011 10:30:00 +0100 Date: Fri, 18 Feb 2011 10:30:00 +0100 From: Francois Romieu To: Seblu Cc: Eric Dumazet , lkml , netdev , Ivan Vecera Subject: Re: Mass udp flow reboot linux with RealTek RTL-8169 Gigabit Message-ID: <20110218093000.GA12106@electric-eye.fr.zoreil.com> References: <1297581470.2510.18.camel@edumazet-laptop> <20110213135600.GA11382@electric-eye.fr.zoreil.com> <20110213203417.GA11442@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i X-Organisation: Land of Sunshine Inc. Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Seblu : [...] > I've applyed your patch on 2.6.38-rc5. Host have rebooted 2mn after udp start. > After this reboot, host is still on after 2 hour under a 1Gbit/s udp flow. Thanks for testing. > I attached a dmesg output before reboot. Do you need anything else? Mostly : 1. .config 2. the size of the udp packets and the mtu As an option : 3. a few seconds of 'vmstat 1' from the host under test 4. an 'ethtool -s eth0' from the host under test 5. /proc/interrupts from the host under test 6. lspci -tv Can you apply the two attached patches on top of the previous ones and give it a try ? The debug should not be too verbose if things are stationary enough. Do you have a serial cable and a second computer at hand by chance (don't go for netconsole with the r8169 driver) ? diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 59ccf0c..712231f 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -4361,13 +4361,13 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, tp->cur_tx += frags + 1; - wmb(); - RTL_W8(TxPoll, NPQ); /* set polling bit */ + mmiowb(); + if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { netif_stop_queue(dev); - smp_rmb(); + smp_mb(); if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) netif_wake_queue(dev); } @@ -4468,10 +4468,14 @@ static void rtl8169_tx_interrupt(struct net_device *dev, if (tp->dirty_tx != dirty_tx) { tp->dirty_tx = dirty_tx; - smp_wmb(); - if (netif_queue_stopped(dev) && - (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { - netif_wake_queue(dev); + smp_mb(); + if (unlikely(netif_queue_stopped(dev) && + (TX_BUFFS_AVAIL(tp) >= (NUM_TX_DESC / 4)))) { + netif_tx_lock(dev); + if (netif_queue_stopped(dev) && + (TX_BUFFS_AVAIL(tp) >= (NUM_TX_DESC / 4))) + netif_wake_queue(dev); + netif_tx_unlock(dev); } /* * 8168 hack: TxPoll requests are lost when the Tx packets are