NetBSD Problem Report #18372

Received: (qmail 16483 invoked by uid 605); 22 Sep 2002 05:37:37 -0000
Message-Id: <20020922053736.4A02A11122@narn.netbsd.org>
Date: Sat, 21 Sep 2002 22:37:36 -0700 (PDT)
From: murray@river-styx.org
Sender: gnats-bugs-owner@netbsd.org
Reply-To: murray@river-styx.org
To: gnats-bugs@gnats.netbsd.org
Subject: Throughput enhancement to pcmcia xi driver
X-Send-Pr-Version: www-1.0

>Number:         18372
>Category:       kern
>Synopsis:       Throughput enhancement to pcmcia xi driver
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 22 05:38:00 +0000 2002
>Closed-Date:    Sun Sep 22 10:14:55 +0000 2002
>Last-Modified:  Wed Oct 02 02:58:00 +0000 2002
>Originator:     Murray Armfield
>Release:        NetBSD-1.6
>Organization:
>Environment:
NetBSD tensor 1.6 NetBSD 1.6 (TENSOR) #3: Sun Sep 22 15:21:53 EST 2002     admin@tensor:/usr/src/sys/arch/i386/compile/TENSOR i386
>Description:
The receive throughtput of my xircom RE-100 is not as good as the send throughput. Demonstrated many times with ftp.
Had a look at FreeBSD code and briefy noticed a couple of things on the interrupt code of the driver. Made changes to my NetBSD-1.6 if_xi.c file and receive throughput has roughly doubled.:-)

I hope my patch below is readable.
>How-To-Repeat:
Try ftp sending and receiving big files with and without the patch. Works great for me.
>Fix:
$NetBSD$

--- if_xi.c.orig        Sun Sep 22 15:14:14 2002
+++ if_xi.c
@@ -834,13 +834,15 @@ xi_intr(arg)
        PAGE(sc, 40);
        rx_status =
            bus_space_read_1(sc->sc_bst, sc->sc_bsh, sc->sc_offset + RXST0);
+       bus_space_write_1(sc->sc_bst, sc->sc_bsh, sc->sc_offset + RXST0,
+           ~rx_status & 0xff);
        tx_status =
            bus_space_read_1(sc->sc_bst, sc->sc_bsh, sc->sc_offset + TXST0);
-
-       /*
-        * XXX Linux writes to RXST0 and TXST* here.  My CE2 works just fine
-        * without it, and I can't see an obvious reason for it.
-        */
+       tx_status |=
+           bus_space_read_1(sc->sc_bst, sc->sc_bsh, sc->sc_offset + TXST1) << 8;
+       bus_space_write_1(sc->sc_bst, sc->sc_bsh, sc->sc_offset + TXST0,0);
+       bus_space_write_1(sc->sc_bst, sc->sc_bsh, sc->sc_offset + TXST1,0);
+       /* My Xircom RE-100 works heaps better with the above writes. */

        PAGE(sc, 0);
        while (esr & FULL_PKT_RCV) {
@@ -885,6 +887,7 @@ xi_intr(arg)

        /* Check for rx overrun. */
        if (rx_status & RX_OVERRUN) {
+               ifp->if_ierrors++;
                bus_space_write_1(sc->sc_bst, sc->sc_bsh, sc->sc_offset + CR,
                    CLR_RX_OVERRUN);
                DPRINTF(XID_INTR, ("xi: overrun cleared\n"));
>Release-Note:
>Audit-Trail:

From: Martin Husemann <martin@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/18372 CVS commit: syssrc/sys/dev/pcmcia
Date: Sun, 22 Sep 2002 13:13:33 +0300 (EEST)

 Module Name:	syssrc
 Committed By:	martin
 Date:		Sun Sep 22 10:13:33 UTC 2002

 Modified Files:
 	syssrc/sys/dev/pcmcia: if_xi.c

 Log Message:
 Apply a patch from Murray Armfield in PR kern/18372: bring in some changes
 from FreeBSD to improve receive performance.


 To generate a diff of this commit:
 cvs rdiff -r1.22 -r1.23 syssrc/sys/dev/pcmcia/if_xi.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed 
State-Changed-By: martin 
State-Changed-When: Sun Sep 22 03:14:25 PDT 2002 
State-Changed-Why:  
Patch applied, thanks! 

From: Luke Mewburn <lukem@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/18372 CVS commit: [netbsd-1-6] syssrc/sys/dev/pcmcia
Date: Wed,  2 Oct 2002 05:56:59 +0300 (EEST)

 Module Name:	syssrc
 Committed By:	lukem
 Date:		Wed Oct  2 02:56:58 UTC 2002

 Modified Files:
 	syssrc/sys/dev/pcmcia [netbsd-1-6]: if_xi.c

 Log Message:
 Pull up revision 1.23 (requested by martin in ticket #891):
 Apply a patch from Murray Armfield in PR kern/18372: bring in some changes
 from FreeBSD to improve receive performance.


 To generate a diff of this commit:
 cvs rdiff -r1.21 -r1.21.4.1 syssrc/sys/dev/pcmcia/if_xi.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.