From owner-freebsd-current@FreeBSD.ORG Tue Sep 2 02:44:56 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 34E4C16A4BF for ; Tue, 2 Sep 2003 02:44:56 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17EA543FDD for ; Tue, 2 Sep 2003 02:44:55 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h829iqi8044517 for ; Tue, 2 Sep 2003 11:44:52 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: current@freebsd.org From: Poul-Henning Kamp Date: Tue, 02 Sep 2003 11:44:52 +0200 Message-ID: <44516.1062495892@critter.freebsd.dk> Subject: TESTERS: if_sis patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2003 09:44:56 -0000 Please try out this patch if you have a "sis" based network card. It sets a 400usec interrupt holdoff, and this seems to have a profound impact on network performance. The patch is relative to FreeBSD-current but probably applies on 5.0, 5.1 and even 4.x as well. In my tests, using a soekris 4801 computer I have found: fetch(1)'ing a ftp:// file from a server on the local segment is 43.2% +/-0.7% faster (from around 385 to 640 kBps). FTP of the same file is 10.6% +/-1.2% faster (from 3.11 to 3.44 MB/sec) Checking out src/sbin from a NFS mounted CVSROOT was 17.0% +/-1.0% faster. Poul-Henning PS: I don't know why fetch(1) is so slow compared to ftp(1) ? Index: if_sis.c =================================================================== RCS file: /home/ncvs/src/sys/pci/if_sis.c,v retrieving revision 1.82 diff -u -r1.82 if_sis.c --- if_sis.c 22 Aug 2003 07:13:21 -0000 1.82 +++ if_sis.c 2 Sep 2003 09:09:03 -0000 @@ -107,7 +107,7 @@ static struct sis_type sis_devs[] = { { SIS_VENDORID, SIS_DEVICEID_900, "SiS 900 10/100BaseTX" }, { SIS_VENDORID, SIS_DEVICEID_7016, "SiS 7016 10/100BaseTX" }, - { NS_VENDORID, NS_DEVICEID_DP83815, "NatSemi DP83815 10/100BaseTX" }, + { NS_VENDORID, NS_DEVICEID_DP83815, "NatSemi DP83815/6 10/100BaseTX" }, { 0, 0, NULL } }; @@ -2030,6 +2030,15 @@ * Cancel pending I/O and free all RX/TX buffers. */ sis_stop(sc); + + if (sc->sis_type == SIS_TYPE_83815) { + /* + * Hold off interrupts for 400usec. + * This number is emperically found on a Soekris 4801 + */ + printf("IHR=%x\n", CSR_READ_4(sc, NS_IHR)); + CSR_WRITE_4(sc, NS_IHR, 0x100 | 4); + } mii = device_get_softc(sc->sis_miibus); Index: if_sisreg.h =================================================================== RCS file: /home/ncvs/src/sys/pci/if_sisreg.h,v retrieving revision 1.22 diff -u -r1.22 if_sisreg.h --- if_sisreg.h 22 Jul 2003 01:35:09 -0000 1.22 +++ if_sisreg.h 2 Sep 2003 09:09:03 -0000 @@ -75,6 +75,7 @@ #define SIS_GPIO 0xB8 /* NS DP83815 registers */ +#define NS_IHR 0x1C #define NS_CLKRUN 0x3C #define NS_BMCR 0x80 #define NS_BMSR 0x84 -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.