PERFORCE change 61051 for review
Robert Watson
rwatson at FreeBSD.org
Sun Sep 5 09:41:40 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=61051
Change 61051 by rwatson at rwatson_tislabs on 2004/09/05 16:41:36
Integrate netperf_socket:
- Lots of KSE/scheduler cleanup foo.
- PREEMPTION now a kernel option.
- ucycom driver.
- More autofs.
- if_re locking and polling fixes, tagged mpsafe.
- pfind() returning PRS_NEW workaround removed from pseudofs.
- 4BSD now does IPI wakeups of idle cpus when there is work to do.
- Giant pushdown in VM for page zeroing, etc.
- ifi_epoch goes away again.
Netperf-related:
- sopoll() race likely corrected by expanding coverage of socket
buffer locks over test and set, not just set.
- AIO marked as requiring Giant over the network stack.
- ng_ksocket use of curthread/thread0 fixed.
- IPv6 raw ip socket rlock/runlock bug fix.
- KAME IPSEC trimmage of key_int_random and friends.
Affected files ...
.. //depot/projects/netperf_socket/sys/alpha/alpha/machdep.c#8 integrate
.. //depot/projects/netperf_socket/sys/alpha/include/param.h#5 integrate
.. //depot/projects/netperf_socket/sys/amd64/amd64/machdep.c#17 integrate
.. //depot/projects/netperf_socket/sys/amd64/include/param.h#5 integrate
.. //depot/projects/netperf_socket/sys/arm/sa11x0/assabet_machdep.c#3 integrate
.. //depot/projects/netperf_socket/sys/conf/NOTES#41 integrate
.. //depot/projects/netperf_socket/sys/conf/files#52 integrate
.. //depot/projects/netperf_socket/sys/conf/options#30 integrate
.. //depot/projects/netperf_socket/sys/ddb/db_ps.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/acpica/Osd/OsdDebug.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-all.c#18 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-all.h#12 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-chipset.c#20 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-lowlevel.c#17 integrate
.. //depot/projects/netperf_socket/sys/dev/ata/ata-pci.h#8 integrate
.. //depot/projects/netperf_socket/sys/dev/iir/iir.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/re/if_re.c#13 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/ucycom.c#1 branch
.. //depot/projects/netperf_socket/sys/dev/usb/umass.c#11 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/uplcom.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/usb_quirks.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/usbdevs#24 integrate
.. //depot/projects/netperf_socket/sys/dev/usb/uscanner.c#7 integrate
.. //depot/projects/netperf_socket/sys/fs/autofs/autofs.h#2 integrate
.. //depot/projects/netperf_socket/sys/fs/autofs/autofs_util.c#2 integrate
.. //depot/projects/netperf_socket/sys/fs/autofs/autofs_vfsops.c#2 integrate
.. //depot/projects/netperf_socket/sys/fs/autofs/autofs_vnops.c#2 integrate
.. //depot/projects/netperf_socket/sys/fs/pseudofs/pseudofs_vnops.c#5 integrate
.. //depot/projects/netperf_socket/sys/i386/i386/machdep.c#13 integrate
.. //depot/projects/netperf_socket/sys/i386/include/param.h#6 integrate
.. //depot/projects/netperf_socket/sys/ia64/conf/GENERIC#10 integrate
.. //depot/projects/netperf_socket/sys/ia64/ia64/machdep.c#11 integrate
.. //depot/projects/netperf_socket/sys/isofs/cd9660/cd9660_vnops.c#4 integrate
.. //depot/projects/netperf_socket/sys/kern/init_main.c#9 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_exec.c#15 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_exit.c#19 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_fork.c#18 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_intr.c#11 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_kse.c#14 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_mutex.c#12 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_proc.c#16 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_shutdown.c#16 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_switch.c#13 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_synch.c#17 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_thr.c#12 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_thread.c#26 integrate
.. //depot/projects/netperf_socket/sys/kern/sched_4bsd.c#15 integrate
.. //depot/projects/netperf_socket/sys/kern/sched_ule.c#21 integrate
.. //depot/projects/netperf_socket/sys/kern/subr_smp.c#12 integrate
.. //depot/projects/netperf_socket/sys/kern/sysv_shm.c#7 integrate
.. //depot/projects/netperf_socket/sys/kern/uipc_socket.c#40 integrate
.. //depot/projects/netperf_socket/sys/kern/vfs_aio.c#8 integrate
.. //depot/projects/netperf_socket/sys/modules/Makefile#20 integrate
.. //depot/projects/netperf_socket/sys/modules/cs/Makefile#3 integrate
.. //depot/projects/netperf_socket/sys/modules/fdc/Makefile#7 integrate
.. //depot/projects/netperf_socket/sys/modules/linprocfs/Makefile#3 integrate
.. //depot/projects/netperf_socket/sys/modules/msdosfs/Makefile#3 integrate
.. //depot/projects/netperf_socket/sys/modules/nfs4client/Makefile#3 integrate
.. //depot/projects/netperf_socket/sys/modules/nfsclient/Makefile#3 integrate
.. //depot/projects/netperf_socket/sys/modules/owi/Makefile#3 integrate
.. //depot/projects/netperf_socket/sys/modules/smbfs/Makefile#3 integrate
.. //depot/projects/netperf_socket/sys/modules/ucycom/Makefile#1 branch
.. //depot/projects/netperf_socket/sys/net/if.c#19 integrate
.. //depot/projects/netperf_socket/sys/net/if.h#8 integrate
.. //depot/projects/netperf_socket/sys/net/netisr.c#5 integrate
.. //depot/projects/netperf_socket/sys/netgraph/ng_ksocket.c#10 integrate
.. //depot/projects/netperf_socket/sys/netinet/ip_divert.c#14 integrate
.. //depot/projects/netperf_socket/sys/netinet/raw_ip.c#15 integrate
.. //depot/projects/netperf_socket/sys/netinet/tcp_output.c#11 integrate
.. //depot/projects/netperf_socket/sys/netinet/tcp_subr.c#20 integrate
.. //depot/projects/netperf_socket/sys/netinet/udp_usrreq.c#15 integrate
.. //depot/projects/netperf_socket/sys/netinet6/raw_ip6.c#8 integrate
.. //depot/projects/netperf_socket/sys/netkey/key.c#4 integrate
.. //depot/projects/netperf_socket/sys/pc98/conf/NOTES#17 integrate
.. //depot/projects/netperf_socket/sys/pc98/i386/machdep.c#11 integrate
.. //depot/projects/netperf_socket/sys/powerpc/powerpc/machdep.c#7 integrate
.. //depot/projects/netperf_socket/sys/sparc64/sparc64/machdep.c#8 integrate
.. //depot/projects/netperf_socket/sys/sys/proc.h#26 integrate
.. //depot/projects/netperf_socket/sys/sys/sched.h#7 integrate
.. //depot/projects/netperf_socket/sys/sys/smp.h#6 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_fault.c#10 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_glue.c#12 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_map.c#23 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_meter.c#4 integrate
.. //depot/projects/netperf_socket/sys/vm/vm_zeroidle.c#6 integrate
Differences ...
==== //depot/projects/netperf_socket/sys/alpha/alpha/machdep.c#8 (text+ko) ====
@@ -88,7 +88,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.222 2004/07/10 22:35:05 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.223 2004/09/05 02:09:51 julian Exp $");
#include "opt_compat.h"
#include "opt_ddb.h"
@@ -846,7 +846,7 @@
}
- proc_linkup(&proc0, &ksegrp0, &kse0, &thread0);
+ proc_linkup(&proc0, &ksegrp0, &thread0);
/*
* Init mapping for u page(s) for proc 0
*/
==== //depot/projects/netperf_socket/sys/alpha/include/param.h#5 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/alpha/include/param.h,v 1.35 2004/08/01 14:31:45 scottl Exp $ */
+/* $FreeBSD: src/sys/alpha/include/param.h,v 1.36 2004/09/02 18:59:14 scottl Exp $ */
/* From: NetBSD: param.h,v 1.20 1997/09/19 13:52:53 leo Exp */
/*
@@ -113,11 +113,6 @@
#define SSIZE 1 /* initial stack size/NBPG */
#define SINCR 1 /* increment of stack/NBPG */
-/* PREEMPTION exposes scheduler bugs that need to be fixed. */
-#if 0
-#define PREEMPTION
-#endif
-
#ifndef KSTACK_PAGES
#define KSTACK_PAGES 2 /* pages of kstack (with pcb) */
#endif
==== //depot/projects/netperf_socket/sys/amd64/amd64/machdep.c#17 (text+ko) ====
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.619 2004/08/24 00:16:43 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.620 2004/09/05 02:09:52 julian Exp $");
#include "opt_atalk.h"
#include "opt_atpic.h"
@@ -1116,7 +1116,7 @@
* This may be done better later if it gets more high level
* components in it. If so just link td->td_proc here.
*/
- proc_linkup(&proc0, &ksegrp0, &kse0, &thread0);
+ proc_linkup(&proc0, &ksegrp0, &thread0);
preload_metadata = (caddr_t)(uintptr_t)(modulep + KERNBASE);
preload_bootstrap_relocate(KERNBASE);
==== //depot/projects/netperf_socket/sys/amd64/include/param.h#5 (text+ko) ====
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)param.h 8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/amd64/include/param.h,v 1.13 2004/08/01 14:31:45 scottl Exp $
+ * $FreeBSD: src/sys/amd64/include/param.h,v 1.14 2004/09/02 18:59:14 scottl Exp $
*/
/*
@@ -119,11 +119,6 @@
#define NBPML4 (1ul<<PML4SHIFT)/* bytes/page map lev4 table */
#define PML4MASK (NBPML4-1)
-/* PREEMPTION exposes scheduler bugs that need to be fixed. */
-#if 0
-#define PREEMPTION
-#endif
-
#define IOPAGES 2 /* pages of i/o permission bitmap */
#ifndef KSTACK_PAGES
==== //depot/projects/netperf_socket/sys/arm/sa11x0/assabet_machdep.c#3 (text+ko) ====
@@ -47,7 +47,7 @@
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.2 2004/06/17 17:52:12 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.3 2004/09/05 02:09:52 julian Exp $");
#define _ARM32_BUS_DMA_PRIVATE
#include <sys/param.h>
@@ -370,7 +370,7 @@
/* Set stack for exception handlers */
- proc_linkup(&proc0, &ksegrp0, &kse0, &thread0);
+ proc_linkup(&proc0, &ksegrp0, &thread0);
proc0.p_uarea = (struct user *) proc0_uarea.pv_va;
thread0.td_kstack = kernelstack.pv_va;
thread0.td_pcb = (struct pcb *)
==== //depot/projects/netperf_socket/sys/conf/NOTES#41 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1271 2004/09/01 01:19:51 brooks Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1275 2004/09/03 06:32:11 ru Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -196,12 +196,16 @@
# SMP Debugging Options:
#
+# PREEMPTION allows the threads that are in the kernel to be preempted
+# by higher priority threads. It helps with interactivity and
+# allows interrupt threads to run sooner rather than waiting.
+# WARNING! Only tested on alpha, amd64, and i386.
# FULL_PREEMPTION instructs the kernel to preempt non-realtime kernel
# threads. It sole use is to expose race conditions and other
# bugs during development. Enabling this option will reduce
# performance and increase the frequency of kernel panics by
# design. If you aren't sure that you need it then you don't.
-# DON'T TURN THIS ON.
+# Relies on the PREEMPTION option. DON'T TURN THIS ON.
# MUTEX_DEBUG enables various extra assertions in the mutex code.
# SLEEPQUEUE_PROFILING enables rudimentary profiling of the hash table
# used to hold active sleep queues.
@@ -213,6 +217,7 @@
# a lock hierarchy violation occurs or if locks are held when going to
# sleep.
# WITNESS_SKIPSPIN disables the witness checks on spin mutexes.
+options PREEMPTION
options FULL_PREEMPTION
options MUTEX_DEBUG
options WITNESS
@@ -224,8 +229,8 @@
options MUTEX_PROFILING
# Set the number of buffers and the hash size. The hash size MUST be larger
# than the number of buffers. Hash size should be prime.
-options MPROF_BUFFERS="1536"
-options MPROF_HASH_SIZE="1543"
+options MPROF_BUFFERS="1536"
+options MPROF_HASH_SIZE="1543"
# Profiling for internal hash tables.
options SLEEPQUEUE_PROFILING
@@ -634,7 +639,7 @@
options IPFIREWALL_VERBOSE #enable logging to syslogd(8)
options IPFIREWALL_VERBOSE_LIMIT=100 #limit verbosity
options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default
-options IPFIREWALL_FORWARD #packet destination changes
+options IPFIREWALL_FORWARD #packet destination changes
options IPV6FIREWALL #firewall for IPv6
options IPV6FIREWALL_VERBOSE
options IPV6FIREWALL_VERBOSE_LIMIT=100
@@ -739,6 +744,7 @@
options NFSCLIENT #Network File System client
# The rest are optional:
+options AUTOFS #Auto File System
options CD9660 #ISO 9660 filesystem
options FDESCFS #File descriptor filesystem
options HPFS #OS/2 File system
@@ -1327,14 +1333,14 @@
options AHC_TMODE_ENABLE
# Compile in Aic7xxx Debugging code.
-options AHC_DEBUG
+options AHC_DEBUG
# Aic7xxx driver debugging options. See sys/dev/aic7xxx/aic7xxx.h
-options AHC_DEBUG_OPTS
+options AHC_DEBUG_OPTS
# Print register bitfields in debug output. Adds ~128k to driver
# See ahc(4).
-options AHC_REG_PRETTY_PRINT
+options AHC_REG_PRETTY_PRINT
# Compile in aic79xx debugging code.
options AHD_DEBUG
@@ -1346,7 +1352,7 @@
options AHD_REG_PRETTY_PRINT
# Bitmap of units to enable targetmode operations.
-options AHD_TMODE_ENABLE
+options AHD_TMODE_ENABLE
# The adw driver will attempt to use memory mapped I/O for all PCI
# controllers that have it configured only if this option is set.
@@ -2474,7 +2480,7 @@
options KSTACK_MAX_PAGES=32 # Maximum pages to give the kernel stack
# Adaptec Array Controller driver options
-options AAC_DEBUG # Debugging levels:
+options AAC_DEBUG # Debugging levels:
# 0 - quiet, only emit warnings
# 1 - noisy, emit major function
# points and things done
==== //depot/projects/netperf_socket/sys/conf/files#52 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.948 2004/08/30 23:03:56 peter Exp $
+# $FreeBSD: src/sys/conf/files,v 1.951 2004/09/05 09:43:47 des Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -800,6 +800,7 @@
dev/usb/ubsa.c optional ubsa ucom
dev/usb/ubser.c optional ubser
dev/usb/ucom.c optional ucom
+dev/usb/ucycom.c optional ucycom ucom
dev/usb/udbp.c optional udbp
dev/usb/ufm.c optional ufm
dev/usb/uftdi.c optional uftdi ucom
@@ -858,6 +859,9 @@
dev/zs/zs.c optional zs
dev/zs/zs_sbus.c optional zs fhc
dev/zs/zs_sbus.c optional zs sbus
+fs/autofs/autofs_vnops.c optional autofs
+fs/autofs/autofs_vfsops.c optional autofs
+fs/autofs/autofs_util.c optional autofs
fs/deadfs/dead_vnops.c standard
fs/devfs/devfs_devs.c standard
fs/devfs/devfs_rule.c standard
@@ -1083,7 +1087,6 @@
kern/kern_idle.c standard
kern/kern_intr.c standard
kern/kern_jail.c standard
-kern/kern_thr.c standard
kern/kern_kse.c standard
kern/kern_kthread.c standard
kern/kern_ktr.c optional ktr
@@ -1107,12 +1110,12 @@
kern/kern_shutdown.c standard
kern/kern_sig.c standard
kern/kern_subr.c standard
-kern/kern_switch.c standard
kern/kern_sx.c standard
kern/kern_synch.c standard
kern/kern_syscalls.c standard
kern/kern_sysctl.c standard
kern/kern_tc.c standard
+kern/kern_thr.c standard
kern/kern_thread.c standard
kern/kern_time.c standard
kern/kern_timeout.c standard
==== //depot/projects/netperf_socket/sys/conf/options#30 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.481 2004/09/01 01:19:52 brooks Exp $
+# $FreeBSD: src/sys/conf/options,v 1.483 2004/09/02 20:44:56 alfred Exp $
#
# On the handling of kernel options
#
@@ -66,7 +66,8 @@
CONSPEED opt_comconsole.h
CY_PCI_FASTINTR
DIRECTIO opt_directio.h
-FULL_PREEMPTION
+FULL_PREEMPTION opt_sched.h
+PREEMPTION opt_sched.h
GEOM_AES opt_geom.h
GEOM_APPLE opt_geom.h
GEOM_BDE opt_geom.h
@@ -160,6 +161,7 @@
# time, since the corresponding lkms cannot work if there are any static
# dependencies. Unusability is enforced by hiding the defines for the
# options in a never-included header.
+AUTOFS opt_dontuse.h
CD9660 opt_dontuse.h
CODA opt_dontuse.h
EXT2FS opt_dontuse.h
==== //depot/projects/netperf_socket/sys/ddb/db_ps.c#5 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ddb/db_ps.c,v 1.52 2004/07/10 23:47:19 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/ddb/db_ps.c,v 1.53 2004/09/05 02:09:52 julian Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -100,7 +100,7 @@
p->p_ucred != NULL ? p->p_ucred->cr_ruid : 0, pp->p_pid,
p->p_pgrp != NULL ? p->p_pgrp->pg_id : 0, p->p_flag,
state);
- if (p->p_flag & P_SA)
+ if (p->p_flag & P_HADTHREADS)
db_printf("(threaded) %s\n", p->p_comm);
FOREACH_THREAD_IN_PROC(p, td) {
dumpthread(p, td);
@@ -120,7 +120,7 @@
dumpthread(volatile struct proc *p, volatile struct thread *td)
{
- if (p->p_flag & P_SA)
+ if (p->p_flag & P_HADTHREADS)
db_printf( " thread %p ksegrp %p ", td, td->td_ksegrp);
if (TD_ON_SLEEPQ(td))
db_printf("[SLPQ %s %p]", td->td_wmesg, (void *)td->td_wchan);
@@ -159,9 +159,11 @@
default:
db_printf("[UNK: %#x]", td->td_state);
}
- if (p->p_flag & P_SA) {
+ if (p->p_flag & P_HADTHREADS) {
+#ifdef KEF_DIDRUN
if (td->td_kse)
db_printf("[kse %p]", td->td_kse);
+#endif
db_printf("\n");
} else
db_printf(" %s\n", p->p_comm);
==== //depot/projects/netperf_socket/sys/dev/acpica/Osd/OsdDebug.c#4 (text+ko) ====
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/acpica/Osd/OsdDebug.c,v 1.8 2004/07/10 20:56:43 marcel Exp $
+ * $FreeBSD: src/sys/dev/acpica/Osd/OsdDebug.c,v 1.9 2004/09/02 04:28:05 njl Exp $
*/
/*
@@ -73,8 +73,7 @@
AcpiOsSignal(UINT32 Function, void *Info)
{
ACPI_SIGNAL_FATAL_INFO *fatal;
- char *message;
-
+
switch (Function) {
case ACPI_SIGNAL_FATAL:
fatal = (ACPI_SIGNAL_FATAL_INFO *)Info;
@@ -82,10 +81,11 @@
fatal->Type, fatal->Code, fatal->Argument);
kdb_enter("AcpiOsSignal");
break;
-
+
case ACPI_SIGNAL_BREAKPOINT:
- message = (char *)Info;
- kdb_enter(message);
+#ifdef ACPI_DEBUG
+ kdb_enter((char *)Info);
+#endif
break;
default:
==== //depot/projects/netperf_socket/sys/dev/ata/ata-all.c#18 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.224 2004/08/27 14:48:32 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.225 2004/09/03 12:10:44 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -734,6 +734,15 @@
/*
* misc support functions
*/
+void
+ata_udelay(int interval)
+{
+ if (interval < (1000000/hz) || ata_delayed_attach)
+ DELAY(interval);
+ else
+ tsleep(&interval, PRIBIO, "ataslp", interval/(1000000/hz));
+}
+
static void
bswap(int8_t *buf, int len)
{
==== //depot/projects/netperf_socket/sys/dev/ata/ata-all.h#12 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.82 2004/08/27 14:48:32 sos Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.83 2004/09/03 12:10:44 sos Exp $
*/
/* ATA register defines */
@@ -390,6 +390,7 @@
int ata_detach(device_t dev);
int ata_suspend(device_t dev);
int ata_resume(device_t dev);
+void ata_udelay(int interval);
int ata_printf(struct ata_channel *ch, int device, const char *fmt, ...) __printflike(3, 4);
int ata_prtdev(struct ata_device *atadev, const char *fmt, ...) __printflike(2, 3);
void ata_set_name(struct ata_device *atadev, char *name, int lun);
==== //depot/projects/netperf_socket/sys/dev/ata/ata-chipset.c#20 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.84 2004/09/01 12:15:44 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.87 2004/09/03 12:10:44 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -493,7 +493,7 @@
if (ata_setup_interrupt(dev))
return ENXIO;
- /* set prefetch, postwrite */
+ /* disable/set prefetch, postwrite */
if (ctlr->chip->cfg2 & AMDBUG)
pci_write_config(dev, 0x41, pci_read_config(dev, 0x41, 1) & 0x0f, 1);
else
@@ -828,11 +828,11 @@
{ ATA_I82801DB, 0, 0, 0x00, ATA_UDMA5, "Intel ICH4" },
{ ATA_I82801DB_1, 0, 0, 0x00, ATA_UDMA5, "Intel ICH4" },
{ ATA_I82801EB, 0, 0, 0x00, ATA_UDMA5, "Intel ICH5" },
- { ATA_I82801EB_1, 0, 0, 0x00, ATA_SA150, "Intel ICH5" },
- { ATA_I82801EB_2, 0, 0, 0x00, ATA_SA150, "Intel ICH5" },
+ { ATA_I82801EB_S1,0, 0, 0x00, ATA_SA150, "Intel ICH5" },
+ { ATA_I82801EB_R1,0, 0, 0x00, ATA_SA150, "Intel ICH5" },
{ ATA_I6300ESB, 0, 0, 0x00, ATA_UDMA5, "Intel 6300ESB" },
- { ATA_I6300ESB_1, 0, 0, 0x00, ATA_SA150, "Intel 6300ESB" },
- { ATA_I6300ESB_2, 0, 0, 0x00, ATA_SA150, "Intel 6300ESB" },
+ { ATA_I6300ESB_S1,0, 0, 0x00, ATA_SA150, "Intel 6300ESB" },
+ { ATA_I6300ESB_R1,0, 0, 0x00, ATA_SA150, "Intel 6300ESB" },
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
@@ -926,9 +926,9 @@
pci_write_config(parent, 0x92, pci_read_config(parent, 0x92, 2) | mask, 2);
while (timeout--) {
- DELAY(10000);
+ ata_udelay(10000);
if ((pci_read_config(parent, 0x92, 2) & (mask << 4)) == (mask << 4)) {
- DELAY(10000);
+ ata_udelay(10000);
return;
}
}
@@ -1105,9 +1105,13 @@
struct ata_pci_controller *ctlr = device_get_softc(dev);
struct ata_chip_id *idx;
static struct ata_chip_id ids[] =
- {{ ATA_NFORCE1, 0, AMDNVIDIA, NVIDIA|AMDBUG, ATA_UDMA5, "nVidia nForce" },
- { ATA_NFORCE2, 0, AMDNVIDIA, NVIDIA|AMDBUG, ATA_UDMA6, "nVidia nForce2" },
- { ATA_NFORCE3, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3" },
+ {{ ATA_NFORCE1, 0, AMDNVIDIA, NVIDIA, ATA_UDMA5, "nVidia nForce" },
+ { ATA_NFORCE2, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce2" },
+ { ATA_NFORCE2_MCP, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce2 MCP" },
+ { ATA_NFORCE3, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3" },
+ { ATA_NFORCE3_PRO, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3 Pro" },
+ { ATA_NFORCE3_MCP, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce3 MCP" },
+ { ATA_NFORCE4, 0, AMDNVIDIA, NVIDIA, ATA_UDMA6, "nVidia nForce4" },
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
@@ -1129,11 +1133,8 @@
if (ata_setup_interrupt(dev))
return ENXIO;
- /* set prefetch, postwrite */
- if (ctlr->chip->cfg2 & AMDBUG)
- pci_write_config(dev, 0x51, pci_read_config(dev, 0x51, 1) & 0x0f, 1);
- else
- pci_write_config(dev, 0x51, pci_read_config(dev, 0x51, 1) | 0xf0, 1);
+ /* disable prefetch, postwrite */
+ pci_write_config(dev, 0x51, pci_read_config(dev, 0x51, 1) & 0x0f, 1);
ctlr->setmode = ata_via_family_setmode;
return 0;
@@ -1514,14 +1515,19 @@
ATA_OUTL(ctlr->r_res2, (atadev->channel->unit + 1) << 2, 0x00000001);
- if (command != ATA_READ_DMA && command != ATA_WRITE_DMA)
+ switch (command) {
+ default:
return ata_generic_command(atadev, command, lba, count, feature);
- if (command == ATA_READ_DMA)
+ case ATA_READ_DMA:
wordp[0] = htole32(0x04 | ((atadev->channel->unit+1)<<16) | (0x00<<24));
- if (command == ATA_WRITE_DMA)
+ break;
+
+ case ATA_WRITE_DMA:
wordp[0] = htole32(0x00 | ((atadev->channel->unit+1)<<16) | (0x00<<24));
- wordp[1] = atadev->channel->dma->mdmatab;
+ break;
+ }
+ wordp[1] = htole32(atadev->channel->dma->mdmatab);
wordp[2] = 0;
ata_promise_apkt((u_int8_t*)wordp, atadev, command, lba, count, feature);
@@ -2165,7 +2171,7 @@
ATA_IDX_OUTL(ch, ATA_BMDEVSPEC_1, 0x00000001);
DELAY(25000);
ATA_IDX_OUTL(ch, ATA_BMDEVSPEC_1, 0x00000000);
- tsleep(ch, PRIBIO, "siirst", hz);
+ ata_udelay(1000000);
}
static void
@@ -2373,7 +2379,7 @@
struct ata_pci_controller *ctlr = device_get_softc(dev);
struct ata_chip_id *idx;
static struct ata_chip_id ids[] =
- {{ ATA_SIS964_1,0x00, SISSATA, 0, ATA_SA150, "SiS 964" }, /* south */
+ {{ ATA_SIS964_S,0x00, SISSATA, 0, ATA_SA150, "SiS 964" }, /* south */
{ ATA_SIS964, 0x00, SIS133NEW, 0, ATA_UDMA6, "SiS 964" }, /* south */
{ ATA_SIS963, 0x00, SIS133NEW, 0, ATA_UDMA6, "SiS 963" }, /* south */
{ ATA_SIS962, 0x00, SIS133NEW, 0, ATA_UDMA6, "SiS 962" }, /* south */
==== //depot/projects/netperf_socket/sys/dev/ata/ata-lowlevel.c#17 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.46 2004/08/27 22:14:45 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.47 2004/09/03 12:10:44 sos Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -48,6 +48,7 @@
static void ata_generic_interrupt(void *);
static void ata_generic_reset(struct ata_channel *);
static int ata_wait(struct ata_device *, u_int8_t);
+/*static int ata_command(struct ata_device *, u_int8_t, u_int64_t, u_int16_t, u_int16_t);*/
static void ata_pio_read(struct ata_request *, int);
static void ata_pio_write(struct ata_request *, int);
@@ -585,9 +586,9 @@
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
DELAY(10);
ATA_IDX_OUTB(ch, ATA_ALTSTAT, ATA_A_IDS | ATA_A_RESET);
- DELAY(10000);
+ ata_udelay(10000);
ATA_IDX_OUTB(ch, ATA_ALTSTAT, ATA_A_IDS);
- DELAY(100000);
+ ata_udelay(100000);
ATA_IDX_INB(ch, ATA_ERROR);
/* wait for BUSY to go inactive */
@@ -656,7 +657,7 @@
if (stat1 == 0xff && timeout > 5)
mask &= ~0x02;
}
- DELAY(100000);
+ ata_udelay(100000);
}
if (bootverbose)
==== //depot/projects/netperf_socket/sys/dev/ata/ata-pci.h#8 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.32 2004/06/15 11:02:09 sos Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.33 2004/09/03 07:37:53 sos Exp $
*/
/* structure holding chipset config info */
@@ -117,11 +117,11 @@
#define ATA_I82801DB 0x24cb8086
#define ATA_I82801DB_1 0x24ca8086
#define ATA_I82801EB 0x24db8086
-#define ATA_I82801EB_1 0x24d18086
-#define ATA_I82801EB_2 0x24df8086
+#define ATA_I82801EB_S1 0x24d18086
+#define ATA_I82801EB_R1 0x24df8086
#define ATA_I6300ESB 0x25a28086
-#define ATA_I6300ESB_1 0x25a38086
-#define ATA_I6300ESB_2 0x25b08086
+#define ATA_I6300ESB_S1 0x25a38086
+#define ATA_I6300ESB_R1 0x25b08086
#define ATA_NATIONAL_ID 0x100b
#define ATA_SC1100 0x0502100b
@@ -129,7 +129,18 @@
#define ATA_NVIDIA_ID 0x10de
#define ATA_NFORCE1 0x01bc10de
#define ATA_NFORCE2 0x006510de
+#define ATA_NFORCE2_MCP 0x008510de
#define ATA_NFORCE3 0x00d510de
+#define ATA_NFORCE3_PRO 0x00e510de
+#define ATA_NFORCE3_PRO_S1 0x00e310de
+#define ATA_NFORCE3_PRO_S2 0x00ee10de
+#define ATA_NFORCE3_MCP 0x003510de
+#define ATA_NFORCE3_MCP_S1 0x003610de
+#define ATA_NFORCE3_MCP_S2 0x003e10de
+#define ATA_NFORCE4 0x005310de
+#define ATA_NFORCE4_S1 0x005410de
+#define ATA_NFORCE4_S2 0x005510de
+
#define ATA_PROMISE_ID 0x105a
#define ATA_PDC20246 0x4d33105a
@@ -220,7 +231,7 @@
#define ATA_SIS962 0x09621039
#define ATA_SIS963 0x09631039
#define ATA_SIS964 0x09641039
-#define ATA_SIS964_1 0x01801039
+#define ATA_SIS964_S 0x01801039
#define ATA_VIA_ID 0x1106
#define ATA_VIA82C571 0x05711106
==== //depot/projects/netperf_socket/sys/dev/iir/iir.c#3 (text+ko) ====
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/iir/iir.c,v 1.10 2004/05/19 17:46:34 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/iir/iir.c,v 1.11 2004/09/03 08:44:23 scottl Exp $");
#define _IIR_C_
@@ -874,13 +874,7 @@
}
splx(s);
} else {
- struct bus_dma_segment seg;
-
- /* Pointer to physical buffer */
- seg.ds_addr =
- (bus_addr_t)ccb->csio.data_ptr;
- seg.ds_len = ccb->csio.dxfer_len;
- gdtexecuteccb(gccb, &seg, 1, 0);
+ panic("iir: CAM_DATA_PHYS not supported");
}
} else {
struct bus_dma_segment *segs;
@@ -989,13 +983,7 @@
}
splx(s);
} else {
- struct bus_dma_segment seg;
-
- /* Pointer to physical buffer */
- seg.ds_addr =
- (bus_addr_t)ccb->csio.data_ptr;
- seg.ds_len = ccb->csio.dxfer_len;
- gdtexecuteccb(gccb, &seg, 1, 0);
+ panic("iir: CAM_DATA_PHYS not supported");
}
} else {
struct bus_dma_segment *segs;
==== //depot/projects/netperf_socket/sys/dev/re/if_re.c#13 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.29 2004/08/28 10:59:02 sanpei Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $");
/*
* RealTek 8139C+/8169/8169S/8110S PCI NIC driver
@@ -205,11 +205,18 @@
static int re_tx_list_init (struct rl_softc *);
static void re_rxeof (struct rl_softc *);
static void re_txeof (struct rl_softc *);
+#ifdef DEVICE_POLLING
+static void re_poll (struct ifnet *, enum poll_cmd, int);
+static void re_poll_locked (struct ifnet *, enum poll_cmd, int);
+#endif
static void re_intr (void *);
static void re_tick (void *);
+static void re_tick_locked (struct rl_softc *);
static void re_start (struct ifnet *);
+static void re_start_locked (struct ifnet *);
static int re_ioctl (struct ifnet *, u_long, caddr_t);
static void re_init (void *);
+static void re_init_locked (struct rl_softc *);
static void re_stop (struct rl_softc *);
static void re_watchdog (struct ifnet *);
static int re_suspend (device_t);
@@ -454,17 +461,14 @@
u_int16_t re8139_reg = 0;
sc = device_get_softc(dev);
- RL_LOCK(sc);
if (sc->rl_type == RL_8169) {
rval = re_gmii_readreg(dev, phy, reg);
- RL_UNLOCK(sc);
return (rval);
}
/* Pretend the internal PHY is only at address 0 */
if (phy) {
- RL_UNLOCK(sc);
return (0);
}
switch (reg) {
@@ -485,7 +489,6 @@
break;
case MII_PHYIDR1:
case MII_PHYIDR2:
- RL_UNLOCK(sc);
return (0);
/*
* Allow the rlphy driver to read the media status
@@ -495,15 +498,12 @@
*/
case RL_MEDIASTAT:
rval = CSR_READ_1(sc, RL_MEDIASTAT);
- RL_UNLOCK(sc);
return (rval);
default:
printf("re%d: bad phy register\n", sc->rl_unit);
- RL_UNLOCK(sc);
return (0);
}
rval = CSR_READ_2(sc, re8139_reg);
- RL_UNLOCK(sc);
return (rval);
}
@@ -517,19 +517,16 @@
int rval = 0;
sc = device_get_softc(dev);
- RL_LOCK(sc);
if (sc->rl_type == RL_8169) {
rval = re_gmii_writereg(dev, phy, reg, data);
- RL_UNLOCK(sc);
return (rval);
}
/* Pretend the internal PHY is only at address 0 */
- if (phy) {
- RL_UNLOCK(sc);
+ if (phy)
return (0);
- }
+
switch (reg) {
case MII_BMCR:
re8139_reg = RL_BMCR;
@@ -548,16 +545,13 @@
break;
case MII_PHYIDR1:
case MII_PHYIDR2:
- RL_UNLOCK(sc);
return (0);
break;
default:
printf("re%d: bad phy register\n", sc->rl_unit);
- RL_UNLOCK(sc);
return (0);
}
CSR_WRITE_2(sc, re8139_reg, data);
- RL_UNLOCK(sc);
return (0);
}
@@ -582,6 +576,8 @@
u_int32_t rxfilt;
int mcnt = 0;
+ RL_LOCK_ASSERT(sc);
+
ifp = &sc->arpcom.ac_if;
rxfilt = CSR_READ_4(sc, RL_RXCFG);
@@ -627,6 +623,8 @@
{
register int i;
+ RL_LOCK_ASSERT(sc);
+
CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RESET);
for (i = 0; i < RL_TIMEOUT; i++) {
@@ -675,11 +673,12 @@
u_int8_t src[] = { 0x00, 'w', 'o', 'r', 'l', 'd' };
/* Allocate a single mbuf */
-
MGETHDR(m0, M_DONTWAIT, MT_DATA);
if (m0 == NULL)
return (ENOBUFS);
+ RL_LOCK(sc);
+
/*
* Initialize the NIC in test mode. This sets the chip up
* so that it can send and receive frames, but performs the
@@ -691,10 +690,10 @@
ifp->if_flags |= IFF_PROMISC;
sc->rl_testmode = 1;
- re_init(sc);
+ re_init_locked(sc);
re_stop(sc);
DELAY(100000);
- re_init(sc);
+ re_init_locked(sc);
/* Put some data in the mbuf */
@@ -710,7 +709,9 @@
*/
CSR_WRITE_2(sc, RL_ISR, 0xFFFF);
+ RL_UNLOCK(sc);
IF_HANDOFF(&ifp->if_snd, m0, ifp);
+ RL_LOCK(sc);
m0 = NULL;
/* Wait for it to propagate through the chip */
@@ -789,6 +790,8 @@
if (m0 != NULL)
m_freem(m0);
+ RL_UNLOCK(sc);
+
return (error);
}
@@ -826,15 +829,9 @@
}
sc->rl_btag = rman_get_bustag(sc->rl_res);
sc->rl_bhandle = rman_get_bushandle(sc->rl_res);
- mtx_init(&sc->rl_mtx,
- device_get_nameunit(dev),
- MTX_NETWORK_LOCK, MTX_DEF);
- RL_LOCK(sc);
hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV;
bus_release_resource(dev, RL_RES,
RL_RID, sc->rl_res);
- RL_UNLOCK(sc);
- mtx_destroy(&sc->rl_mtx);
if (t->rl_basetype == hwrev) {
device_set_desc(dev, t->rl_name);
return (0);
@@ -1065,7 +1062,7 @@
unit = device_get_unit(dev);
mtx_init(&sc->rl_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
- MTX_DEF | MTX_RECURSE);
+ MTX_DEF);
/*
* Map control/status registers.
*/
@@ -1096,7 +1093,9 @@
}
/* Reset the adapter. */
+ RL_LOCK(sc);
re_reset(sc);
+ RL_UNLOCK(sc);
hw_rev = re_hwrevs;
hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV;
@@ -1221,13 +1220,11 @@
}
/* Hook interrupt last to avoid having to lock softc */
- error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET,
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list