From owner-freebsd-net@FreeBSD.ORG Tue Jan 1 18:56:39 2008 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5536D16A420 for ; Tue, 1 Jan 2008 18:56:39 +0000 (UTC) (envelope-from root@lupin.parts-unknown.org) Received: from lupin.parts-unknown.org (lupin.cybernude.org [66.93.170.242]) by mx1.freebsd.org (Postfix) with SMTP id E33E113C4EA for ; Tue, 1 Jan 2008 18:56:38 +0000 (UTC) (envelope-from root@lupin.parts-unknown.org) Received: (qmail 30998 invoked by uid 0); 1 Jan 2008 18:38:41 -0000 Received: (qmail 12019 invoked from network); 1 Jan 2008 06:55:33 -0000 Received: from qmail by qscan (mail filter); 1 Jan 2008 06:55:33 +0000 Received: from mx2.freebsd.org (69.147.83.53) by lupin.parts-unknown.org with SMTP; 1 Jan 2008 06:55:33 -0000 Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 0FFBF5CCB2; Tue, 1 Jan 2008 06:54:45 +0000 (UTC) (envelope-from owner-freebsd-current@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id E8D1C16A52C; Tue, 1 Jan 2008 06:54:44 +0000 (UTC) (envelope-from owner-freebsd-current@freebsd.org) Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 103EA16A49C for ; Tue, 1 Jan 2008 06:54:39 +0000 (UTC) (envelope-from sepherosa@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 D8C5C13C468 for ; Tue, 1 Jan 2008 06:54:38 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so8580309waf.3 for ; Mon, 31 Dec 2007 22:54:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=UNDDGaNq+qK9j2H8tmJiDi2IH7+/nQ46F9cT4C9ccb4=; b=Jk0Ws1z+FtlBt29ovSqzpG4DMq75weAjSQganWgjBsAdl48QfqXZCeoNVj4g5jFySuSGrOIsslOX+USqb+3esYVRkcDwa7A9wXYI+sqW4fq0j8Bkikcltdno7OgUDVKKXGZI3N8l24f4aDizfWhJNrWvx6o4LlNvH4qbOV8qddA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rK/Xd2po2K91edq41HVBy5/fD+mT/cHtFD7wB/kWPcbGTITOtyXbkR4IgR/NEK9NWcX6TIi/bFAS35ZjJkA4vThBmmBOxnNkq1okSjoav8t/R/XtYWZIn1/f/pVblK2RIdakRmVLB2iea6chwuby8+MCrnz9X2XtCs/4fuC4Mj4= Received: by 10.142.215.5 with SMTP id n5mr3713133wfg.161.1199168867374; Mon, 31 Dec 2007 22:27:47 -0800 (PST) Received: by 10.142.162.20 with HTTP; Mon, 31 Dec 2007 22:27:47 -0800 (PST) Message-ID: Date: Tue, 1 Jan 2008 14:27:47 +0800 From: "Sepherosa Ziehau" To: "=?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?=" In-Reply-To: <86ir2hznnd.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <86ir2hznnd.fsf@ds4.des.no> X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-freebsd-current@freebsd.org Errors-To: owner-freebsd-current@freebsd.org Cc: kevlo@freebsd.org, sam@freebsd.org, current@freebsd.org, net@freebsd.org Subject: Re: if_ral regression X-BeenThere: freebsd-net@freebsd.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2008 18:56:39 -0000 On Dec 29, 2007 8:33 PM, Dag-Erling Sm=F8rgrav wrote: > I upgraded my router cum firewall cum access point (soekris net4801 with > a cheap third-party ralink-based wlan adapter) from RELENG_6 to HEAD and > noticed what seems to be a regression in if_ral. After a certain amount > of use (i.e. actually having a client connected to it and transferring > data), the connection falters, and eventually the client can no longer > see even see the access point in a scan. Restarting the interface on > the router (/etc/rc.d/netif restart ral0) fixes it. I now have a cron > job that does this every five minutes. I still get occasional outages, > but all I have to do is wait a few minutes for the cron job to kick in. > > Outages are clearly related to traffic; a sure-fire way to trigger one > is to start a backup job on my laptop (rsync to my file server). I will > lose the wlan connection repeatedly until I either stop trying or run > the script with a bandwidth limit. > > des@soe ~% uname -a > FreeBSD soe.des.no 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sat Dec 15 20:46:2= 9 UTC 2007 des@pwd.des.no:/usr/obj/usr/src/sys/soe i386 > des@soe ~% kldstat -v > Id Refs Address Size Name > 1 18 0xc0400000 33fdfc kernel (/boot/soe/kernel) > 2 1 0xc0740000 7690 if_sis.ko (/boot/soe/if_sis.ko) > 3 2 0xc0748000 1dbe0 miibus.ko (/boot/soe/miibus.ko) > 4 1 0xc0766000 18e28 if_ral.ko (/boot/soe/if_ral.ko) > 5 4 0xc077f000 2a95c wlan.ko (/boot/soe/wlan.ko) > 6 1 0xc07aa000 2cb0 wlan_acl.ko (/boot/soe/wlan_acl.ko) > 7 1 0xc07ad000 1924 wlan_scan_ap.ko (/boot/soe/wlan_scan_ap.ko) > 8 1 0xc107f000 6000 geom_md.ko (/boot/soe/geom_md.ko) > 9 1 0xc10f9000 2000 pflog.ko (/boot/soe/pflog.ko) > 10 1 0xc10fb000 2f000 pf.ko (/boot/soe/pf.ko) > 11 4 0xc118d000 a000 netgraph.ko (/boot/soe/netgraph.ko) > 12 1 0xc119c000 3000 ng_ether.ko (/boot/soe/ng_ether.ko) > 13 1 0xc11a8000 5000 ng_pppoe.ko (/boot/soe/ng_pppoe.ko) > 14 1 0xc11ad000 4000 ng_socket.ko (/boot/soe/ng_socket.ko) > des@soe ~% grep ral0 /var/run/dmesg.boot > ral0: mem 0xa0004000-0xa0005fff irq 11 at devi= ce 10.0 on pci0 I don't whether following thingies will fix your problem: 1) rt2560.c: rt2560_setup_tx_desc() Set RT2560_{TX,TX_CIPHER}_BUSY desc flag at the end of this function, instead of at the beginning of this function. The original way _may_ confuse hardware encryption/tx engine. 2) And the rt2560_bbp_read() is not correct, it should look like following: static uint8_t rt2560_bbp_read(struct rt2560_softc *sc, uint8_t reg) { =09uint32_t val; =09int ntries; =09for (ntries =3D 0; ntries < 100; ntries++) { =09=09if (!(RAL_READ(sc, RT2560_BBPCSR) & RT2560_BBP_BUSY)) =09=09=09break; =09=09DELAY(1); =09} =09if (ntries =3D=3D 100) { =09=09device_printf(sc->sc_dev, "could not read from BBP\n"); =09=09return 0; =09} =09val =3D RT2560_BBP_BUSY | reg << 8; =09RAL_WRITE(sc, RT2560_BBPCSR, val); =09for (ntries =3D 0; ntries < 100; ntries++) { =09=09val =3D RAL_READ(sc, RT2560_BBPCSR); =09=09if (!(val & RT2560_BBP_BUSY)) =09=09=09return val & 0xff; =09=09DELAY(1); =09} =09device_printf(sc->sc_dev, "could not read from BBP\n"); =09return 0; } 3) After above fix, rt2560_set_txantenna() and rt2560_set_rxantenna() should be called after rt2560_bbp_init(), since above two function touch BBP. NOTE: without above fix, you may burn your card. Even with these in place in dfly, I still have strange TX performance regression in sta mode (drop from 20Mb/s to 3Mb/s under very well condition) on certain hardwares after 20sec~30sec TCP_STREAM netperf testing; didn't have enough time to dig, however, all of the tested hardwares stayed connected during testing (I usually run netperf stream test for 12 hours or more). Best Regards, sephe --=20 Live Free or Die _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"