Return to BSD News archive
Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!uunet!elroy.jpl.nasa.gov!ames!ictv!barry
From: barry@ictv.com (Barry Lustig)
Subject: Re: slow ethernet performance
Message-ID: <1992Aug23.232848.20755@ictv.com>
Sender: usenet@ictv.com
Organization: ICTV, Santa Clara, CA (408) 562-9200
References: <oudcs3g@sgi.sgi.com>
Date: Sun, 23 Aug 1992 23:28:48 GMT
Lines: 163
Here are some ttcp numbers for a 486 33Mhz clone with 64Kb cache and a
WD8013 Elite 16 ethernet card. I modified the if_we driver to support
16bit transfers into and out-of the boards shared memory (for the
8013). The changes to the driver are included at the end of this
message.
The driver mods increased performance by a factor of 2.
barry
NeXT
ttcp-t: socket
ttcp-t: connect
ttcp-t: buflen=8192, nbuf=2048, align=16384/+0, port=5001 tcp -> nefarious
ttcp-t: 16777216 bytes in 24.13 real seconds = 679.07 KB/sec +++
ttcp-t: 16777216 bytes in 11.58 CPU seconds = 1414.54 KB/cpu sec
ttcp-t: 2048 I/O calls, msec/call = 12.06, calls/sec = 84.88
ttcp-t: 0.0user 11.5sys 0:24real 48% 0i+0d 0maxrss 0+0pf 1157+1387csw
ttcp-t: buffer address 0x1c000
PC:
ttcp-r: buflen=8192, nbuf=2048, align=16384/+0, port=5001 tcp
ttcp-r: 16777216 bytes in 24.17 real seconds = 677.87 KB/sec +++
ttcp-r: 16777216 bytes in 22.38 CPU seconds = 732.08 KB/cpu sec
ttcp-r: 2667 I/O calls, msec/call = 9.28, calls/sec = 110.34
ttcp-r: 0.0user 22.3sys 0:24real 92% 0i+0d 0maxrss 0+0pf 598+225csw
ttcp-r: buffer address 0xc000
PC:
ttcp-t: socket
ttcp-t: connect
ttcp-t: buflen=8192, nbuf=2048, align=16384/+0, port=5001 tcp -> sinister
ttcp-t: 16777216 bytes in 31.62 real seconds = 518.15 KB/sec +++
ttcp-t: 16777216 bytes in 31.38 CPU seconds = 522.12 KB/cpu sec
ttcp-t: 2048 I/O calls, msec/call = 15.81, calls/sec = 64.77
ttcp-t: 0.0user 31.3sys 0:31real 99% 0i+0d 0maxrss 0+0pf 16+336csw
ttcp-t: buffer address 0x10000
NeXT:
ttcp-r: socket
ttcp-r: accept from 128.229.210.253
ttcp-r: buflen=8192, nbuf=2048, align=16384/+0, port=5001 tcp
ttcp-r: 16777216 bytes in 31.63 real seconds = 517.96 KB/sec +++
ttcp-r: 16777216 bytes in 14.82 CPU seconds = 1105.33 KB/cpu sec
ttcp-r: 16300 I/O calls, msec/call = 1.99, calls/sec = 515.31
ttcp-r: 0.3user 14.4sys 0:31real 46% 0i+0d 0maxrss 0+0pf 15907+488csw
ttcp-r: buffer address 0x1c000
===================================================================
Note: I haven't modified the transmit side of the driver to use
multiple transmit buffers. That will have to wait until a rainy day!
RCS file: RCS/if_we.c,v
retrieving revision 1.1
diff -c -r1.1 if_we.c
*** /tmp/,RCSt1001696 Sun Aug 23 16:54:02 1992
--- if_we.c Sun Aug 23 16:53:25 1992
***************
*** 136,141 ****
--- 136,142 ----
register int i;
register struct we_softc *sc = &we_softc[is->id_unit];
union we_mem_sel wem;
+ union we_laar laar;
u_char sum;
/* reset card to force it into a known state. */
***************
*** 145,150 ****
--- 146,159 ----
/* wait in the case this card is reading it's EEROM */
DELAY(5000);
+ #if defined(WD8013)
+ /* allow the NIC to access the shared RAM 16 bits at a time */
+
+ laar.addr_l19 = 1;
+ laar.lan_16_en = 1;
+ laar.mem_16_en = 1;
+ outb(is->id_iobase+5, laar.laar_byte); /* Write a 0xc1 */
+ #endif
/*
* Here we check the card ROM, if the checksum passes, and the
* type code and ethernet address check out, then we know we have
***************
*** 164,169 ****
--- 173,179 ----
return (0);
#endif
/*printf("type %x ", sc->we_type);*/
+
if (sc->we_type & WD_SOFTCONFIG) {
int iv = inb(is->id_iobase + 1) & 4 |
((inb(is->id_iobase+4) & 0x60) >> 5);
***************
*** 173,178 ****
--- 183,189 ----
outb(is->id_iobase+4, inb(is->id_iobase+4) | 0x80);
}
+
/*
* Setup card RAM area and i/o addresses
* Kernel Virtual to segment C0000-DFFFF?????
***************
*** 326,332 ****
--- 337,348 ----
wecmd.cs_sta = 0;
wecmd.cs_ps = 0;
outb(sc->we_io_nic_addr + WD_P0_COMMAND, wecmd.cs_byte);
+ #if defined(WD8013)
+ /* enable 16 bit access if 8013 card */
+ outb(sc->we_io_nic_addr + WD_P0_DCR, WD_D_CONFIG16);
+ #else
outb(sc->we_io_nic_addr + WD_P0_DCR, WD_D_CONFIG);
+ #endif
outb(sc->we_io_nic_addr + WD_P0_RBCR0, 0);
outb(sc->we_io_nic_addr + WD_P0_RBCR1, 0);
outb(sc->we_io_nic_addr + WD_P0_RCR, WD_R_MON);
===================================================================
RCS file: RCS/if_wereg.h,v
retrieving revision 1.1
diff -c -r1.1 if_wereg.h
*** /tmp/,RCSt1001696 Sun Aug 23 16:54:03 1992
--- if_wereg.h Sun Aug 23 16:53:30 1992
***************
*** 56,61 ****
--- 56,78 ----
};
/*
+ * LA Address Register (LAAR)
+ */
+ union we_laar {
+ struct lan_addr_reg {
+ u_char addr_l19_b:1, /* Address Line 19 for enabling */
+ /* 16 bit NIC access to shared RAM */
+ unused_b:5, /* unused (or unknown) bits */
+ lan_16_en_b:1, /* Enables 16bit shrd RAM for LAN */
+ mem_16_en_b:1; /* Enables 16bit shrd RAM for host */
+ } laar_decode;
+ #define addr_l19 laar_decode.addr_l19_b
+ #define lan_16_en laar_decode.lan_16_en_b
+ #define mem_16_en laar_decode.mem_16_en_b
+ u_char laar_byte; /* entire byte */
+ };
+
+ /*
* receive ring discriptor
*
* The National Semiconductor DS8390 Network interface controller uses
***************
*** 235,240 ****
--- 252,258 ----
#define WD_D_FT1 0x40 /* Fifo Threshold Select */
#define WD_D_RES 0x80 /* reserved... */
#define WD_D_CONFIG (WD_D_FT1|WD_D_BMS)
+ #define WD_D_CONFIG16 (WD_D_FT1|WD_D_BMS|WD_D_LAS|WD_D_WTS)
/*
* Configuration constants (interrupt mask register)
--