Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Mar 1999 11:54:49 +1000
From:      Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Cc:        jeremyp@gsmx07.alcatel.com.au
Subject:   kern/10535: Very poor ethernet performance with tx driver
Message-ID:  <99Mar11.114259est.40394@border.alcanet.com.au>

next in thread | raw e-mail | index | archive | help

>Number:         10535
>Category:       kern
>Synopsis:       Very poor ethernet performance with tx driver
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 10 18:00:00 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Peter Jeremy
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Alcatel Australia Limited
>Environment:

	PII-266 with SMB EtherPower II 10/100 (SMC9432TX) on 10baseT
	network, running -current from cvs-cur 5133.  Compiled with
	system gcc -O.

>Description:

	After upgrading from a very late 3.0-current, the ethernet
	performance dropped from ~line speed to ~38KBps, with >>90%
	system time, when doing large transfers.  Transfers via lo0
	were unaffected.

	Building a profiling kernel revealed that all the time was
	spent in if_tx.c:epic_read_phy_register().  This code has
	been recently changed (1.21 99/03/09) to increase the timeout
	loops from 0x1000 to 0x100000.  Disassembling the code showed
	that the actual physical register test had been pulled out of
	the for loop.

>How-To-Repeat:

	[sr]cp /kernel remote_host:/dev/null
	whilst running vmstat (or similar).

>Fix:
	
Index: pci/if_txvar.h
===================================================================
RCS file: /home/CVSROOT/./src/sys/pci/if_txvar.h,v
retrieving revision 1.1
diff -u -r1.1 if_txvar.h
--- if_txvar.h	1998/11/01 07:44:33	1.1
+++ if_txvar.h	1999/03/11 01:08:01
@@ -370,17 +370,17 @@
 	inb( (sc)->iobase + (u_int32_t)(reg) )
 #else
 #define CSR_WRITE_1(sc,reg,val) 					\
-	((*(u_int8_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int8_t)(val))
+	((*(volatile u_int8_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int8_t)(val))
 #define CSR_WRITE_2(sc,reg,val) 					\
-	((*(u_int16_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int16_t)(val))
+	((*(volatile u_int16_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int16_t)(val))
 #define CSR_WRITE_4(sc,reg,val) 					\
-	((*(u_int32_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int32_t)(val))
+	((*(volatile u_int32_t*)((sc)->csr + (u_int32_t)(reg))) = (u_int32_t)(val))
 #define CSR_READ_1(sc,reg) 						\
-	(*(u_int8_t*)((sc)->csr + (u_int32_t)(reg)))
+	(*(volatile u_int8_t*)((sc)->csr + (u_int32_t)(reg)))
 #define CSR_READ_2(sc,reg) 						\
-	(*(u_int16_t*)((sc)->csr + (u_int32_t)(reg)))
+	(*(volatile u_int16_t*)((sc)->csr + (u_int32_t)(reg)))
 #define CSR_READ_4(sc,reg) 						\
-	(*(u_int32_t*)((sc)->csr + (u_int32_t)(reg)))
+	(*(volatile u_int32_t*)((sc)->csr + (u_int32_t)(reg)))
 #endif
 #else /* __OpenBSD__ */
 #define EPIC_FORMAT	"%s"

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Mar11.114259est.40394>