From owner-freebsd-stable@FreeBSD.ORG Mon Mar 31 05:22:32 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84A411065670 for ; Mon, 31 Mar 2008 05:22:32 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by mx1.freebsd.org (Postfix) with ESMTP id 52D188FC19 for ; Mon, 31 Mar 2008 05:22:32 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so1776520waf.3 for ; Sun, 30 Mar 2008 22:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; bh=3lFgeOpH7IP4+M+qJyqmQKRgfYrI1sXSVi5Pm3smb30=; b=jDnan+X1QNRNt4axGtMaM00XpCzkOJvK03NvyBrpHQ/hAa9IxKVEWFn73KvUPxcX+5sv20MhP3L3BfQn0walJccRWv7nL8o1moEUjoOCdmScQ70SeZcAj7etzdtdgdLN5rMKSull9vBt8YokyQlKJi/VIs4mVAoZDKVlAB6ztXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=UJjLEVlGjqkyeYwUvY2B/0z7JMAVVAdbJQP2l5GLTBthE2tkvDhHDaiIFIgYzLDQcBYrudSOvN+UWLvag2iBr88o89zJdJvX9HBy4UdwwTI7EwCAuKTvlcYjTWDNBtLjsS3pFqQqnp3+uBVENh+1NWyf69levw8W9mf+tv1b9yg= Received: by 10.115.75.1 with SMTP id c1mr9249294wal.84.1206940951855; Sun, 30 Mar 2008 22:22:31 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id y11sm8167751pod.9.2008.03.30.22.22.28 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 30 Mar 2008 22:22:29 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id m2V5MPDf011043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 31 Mar 2008 14:22:25 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id m2V5MNf6011042; Mon, 31 Mar 2008 14:22:23 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Mon, 31 Mar 2008 14:22:23 +0900 From: Pyun YongHyeon To: =?euc-kr?B?rK6s2qznrNGs2qzdIKysrNqs4azR?= Message-ID: <20080331052223.GF9900@cdnetworks.co.kr> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2/5bycvrmDh4d1IB" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: freebsd-stable@freebsd.org Subject: Re: rl driver error? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2008 05:22:32 -0000 --2/5bycvrmDh4d1IB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Mar 30, 2008 at 10:56:18PM +0400, wrote: > I have got system with rl and re cards. This system functiones as gateway, rl - internet re - > intranet. Periodically I have > ping: sendto: No buffer space available > on rl card! > on logs I have > Mar 30 22:23:02 xxxxxxx kernel: rl0: watchdog timeout > Mar 30 22:23:32 xxxxxxx last message repeated 6 times > This could be improved by reboting the system, that very bad, as it network gateway! > Some ideas? > > System FreeBSD 7.0 , compiled from RELENG_7_0_0 Please try attached patch and let me know how it goes. -- Regards, Pyun YongHyeon --2/5bycvrmDh4d1IB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rl.patch2" --- sys/pci/if_rl.c.orig 2008-03-03 13:15:08.000000000 +0900 +++ sys/pci/if_rl.c 2008-03-31 14:16:02.000000000 +0900 @@ -1117,17 +1117,19 @@ * datasheet makes absolutely no mention of this and * RealTek should be shot for this. */ - if ((uint16_t)(rxstat >> 16) == RL_RXSTAT_UNFINISHED) + total_len = rxstat >> 16; + if (total_len == RL_RXSTAT_UNFINISHED) break; - if (!(rxstat & RL_RXSTAT_RXOK)) { + if (!(rxstat & RL_RXSTAT_RXOK) || + total_len < ETHER_MIN_LEN || + total_len > ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) { ifp->if_ierrors++; rl_init_locked(sc); return; } /* No errors; receive the packet. */ - total_len = rxstat >> 16; rx_bytes += total_len + 4; /* @@ -1244,8 +1246,6 @@ if (RL_LAST_TXMBUF(sc) == NULL) sc->rl_watchdog_timer = 0; - else if (sc->rl_watchdog_timer == 0) - sc->rl_watchdog_timer = 5; } static void @@ -1326,27 +1326,32 @@ goto done_locked; #endif - for (;;) { - status = CSR_READ_2(sc, RL_ISR); + status = CSR_READ_2(sc, RL_ISR); + if (status == 0 || status == 0xffff || (status & RL_INTRS) == 0) + goto done_locked; + + /* Disable interrupts. */ + CSR_WRITE_2(sc, RL_IMR, 0); + + for (; (status & RL_INTRS) != 0;) { /* If the card has gone away, the read returns 0xffff. */ if (status == 0xffff) break; - if (status != 0) - CSR_WRITE_2(sc, RL_ISR, status); - if ((status & RL_INTRS) == 0) - break; - if (status & RL_ISR_RX_OK) + CSR_WRITE_2(sc, RL_ISR, status); + if ((status & (RL_ISR_RX_OK | RL_ISR_RX_ERR)) != 0) rl_rxeof(sc); - if (status & RL_ISR_RX_ERR) - rl_rxeof(sc); - if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR)) + if ((status & (RL_ISR_TX_OK | RL_ISR_TX_ERR)) != 0) rl_txeof(sc); if (status & RL_ISR_SYSTEM_ERR) { rl_reset(sc); rl_init_locked(sc); } + status = CSR_READ_2(sc, RL_ISR); } + /* Enable interrupts. */ + CSR_WRITE_2(sc, RL_IMR, RL_INTRS); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) rl_start_locked(ifp); --2/5bycvrmDh4d1IB--