Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2004 17:12:24 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 50945 for review
Message-ID:  <200404130012.i3D0COBW099493@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=50945

Change 50945 by rwatson@rwatson_paprika on 2004/04/12 17:12:14

	Integrate netperf_socket:
	
	sx device driver.
	if_nge, if_re, if_sis have user configurable polling.
	More cardbus allocation mayhem.
	Mutex fix for /dev/random.
	specfs Giant warning on poll() fixed.
	vm_page_wire() replaced with vm_page_hold() in execve().
	procstopevent() lock order fix.
	Old VFS sysctls under BURN_BRIDGES.
	if_omcasts also billed for broadcasts.
	NFS server no longer exports negative free space.

Affected files ...

.. //depot/projects/netperf_socket/sys/conf/NOTES#13 integrate
.. //depot/projects/netperf_socket/sys/conf/files#16 integrate
.. //depot/projects/netperf_socket/sys/conf/options#9 integrate
.. //depot/projects/netperf_socket/sys/dev/acpica/acpi_thermal.c#8 integrate
.. //depot/projects/netperf_socket/sys/dev/cardbus/cardbus_cis.c#3 integrate
.. //depot/projects/netperf_socket/sys/dev/em/if_em.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/nge/if_nge.c#7 integrate
.. //depot/projects/netperf_socket/sys/dev/pccard/pccard_cis.c#2 integrate
.. //depot/projects/netperf_socket/sys/dev/pccbb/pccbb.c#5 integrate
.. //depot/projects/netperf_socket/sys/dev/random/randomdev.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/re/if_re.c#4 integrate
.. //depot/projects/netperf_socket/sys/dev/sx/cd1865.h#1 branch
.. //depot/projects/netperf_socket/sys/dev/sx/sx.c#1 branch
.. //depot/projects/netperf_socket/sys/dev/sx/sx.h#1 branch
.. //depot/projects/netperf_socket/sys/dev/sx/sx_pci.c#1 branch
.. //depot/projects/netperf_socket/sys/dev/sx/sx_util.c#1 branch
.. //depot/projects/netperf_socket/sys/dev/sx/sx_util.h#1 branch
.. //depot/projects/netperf_socket/sys/dev/sx/sxvar.h#1 branch
.. //depot/projects/netperf_socket/sys/fs/specfs/spec_vnops.c#5 integrate
.. //depot/projects/netperf_socket/sys/i386/conf/NOTES#15 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_exec.c#7 integrate
.. //depot/projects/netperf_socket/sys/kern/kern_sig.c#7 integrate
.. //depot/projects/netperf_socket/sys/kern/subr_rman.c#2 integrate
.. //depot/projects/netperf_socket/sys/kern/vfs_subr.c#7 integrate
.. //depot/projects/netperf_socket/sys/net/if_var.h#7 integrate
.. //depot/projects/netperf_socket/sys/net/route.c#5 integrate
.. //depot/projects/netperf_socket/sys/net/rtsock.c#3 integrate
.. //depot/projects/netperf_socket/sys/nfsserver/nfs_serv.c#4 integrate
.. //depot/projects/netperf_socket/sys/pci/if_sis.c#5 integrate
.. //depot/projects/netperf_socket/sys/sys/mount.h#7 integrate
.. //depot/projects/netperf_socket/sys/sys/param.h#8 integrate

Differences ...

==== //depot/projects/netperf_socket/sys/conf/NOTES#13 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1212 2004/04/02 18:50:56 vkashyap Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1214 2004/04/12 02:36:51 imp Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #

==== //depot/projects/netperf_socket/sys/conf/files#16 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.884 2004/04/10 19:43:15 marcel Exp $
+# $FreeBSD: src/sys/conf/files,v 1.885 2004/04/11 20:01:18 imp Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -719,6 +719,10 @@
 dev/stg/tmc18c30_pccard.c	optional stg pccard
 dev/stg/tmc18c30_pci.c	optional stg pci
 dev/stg/tmc18c30_isa.c	optional stg isa
+dev/sx/sx.c		optional sx
+dev/sx/sx_util.c	optional sx
+#dev/sx/sx_isa.c		optional sx isa
+dev/sx/sx_pci.c		optional sx pci
 dev/sym/sym_hipd.c	optional sym					\
 	dependency	"$S/dev/sym/sym_{conf,defs}.h"
 dev/syscons/blank/blank_saver.c	optional blank_saver

==== //depot/projects/netperf_socket/sys/conf/options#9 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.439 2004/04/06 19:12:24 jhb Exp $
+# $FreeBSD: src/sys/conf/options,v 1.440 2004/04/11 20:01:18 imp Exp $
 #
 #        On the handling of kernel options
 #
@@ -430,6 +430,7 @@
 NPX_DEBUG		opt_debug_npx.h
 NETATALKDEBUG		opt_atalk.h
 SI_DEBUG		opt_debug_si.h
+SX_DEBUG		opt_debug_sx.h
 
 # Fb options
 FB_DEBUG		opt_fb.h

==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_thermal.c#8 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.42 2004/04/09 18:14:32 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.43 2004/04/12 05:04:47 njl Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -551,9 +551,7 @@
 static void
 acpi_tz_switch_cooler_off(ACPI_OBJECT *obj, void *arg)
 {
-    struct acpi_tz_softc	*sc = (struct acpi_tz_softc *)arg;
     ACPI_HANDLE			cooler;
-    ACPI_STATUS			status;
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
@@ -567,12 +565,7 @@
 
     ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to turn %s off\n",
 		     acpi_name(cooler)));
-    status = acpi_pwr_switch_consumer(cooler, ACPI_STATE_D3);
-    if (ACPI_FAILURE(status)) {
-	ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
-		    "failed to deactivate %s - %s\n", acpi_name(cooler),
-		    AcpiFormatException(status));
-    }
+    acpi_pwr_switch_consumer(cooler, ACPI_STATE_D3);
 
     return_VOID;
 }

==== //depot/projects/netperf_socket/sys/dev/cardbus/cardbus_cis.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus_cis.c,v 1.45 2004/03/17 17:50:29 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus_cis.c,v 1.46 2004/04/11 19:22:25 imp Exp $");
 
 /*
  * CIS Handling for the Cardbus Bus
@@ -374,6 +374,25 @@
 		if (reg & TPL_BAR_REG_PREFETCHABLE)
 			dinfo->mprefetchable |= BARBIT(bar);
 #if 0
+		/*
+		 * XXX: It appears from a careful reading of the spec
+		 * that we're not supposed to honor this when the bridge
+		 * is not on the main system bus.  PCI spec doesn't appear
+		 * to allow for memory ranges not listed in the bridge's
+		 * decode range to be decoded.  The PC Card spec seems to
+		 * indicate that this should only be done on x86 based
+		 * machines, which seems to imply that on non-x86 machines
+		 * the adddresses can be anywhere.  This further implies that
+		 * since the hardware can do it on non-x86 machines, it should
+		 * be able to do it on x86 machines.  Therefore, we can and
+		 * should ignore this hint.  Furthermore, the PC Card spec
+		 * recommends always allocating memory above 1MB, contradicting
+		 * the other part of the PC Card spec.
+		 *
+		 * NetBSD ignores this bit, but it also ignores the
+		 * prefetchable bit too, so that's not an indication of
+		 * correctness.
+		 */
 		if (reg & TPL_BAR_REG_BELOW1MB)
 			dinfo->mbelow1mb |= BARBIT(bar);
 #endif

==== //depot/projects/netperf_socket/sys/dev/em/if_em.c#4 (text+ko) ====

@@ -31,7 +31,7 @@
 
 ***************************************************************************/
 
-/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.38 2004/03/17 17:50:31 njl Exp $*/
+/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.39 2004/04/11 21:01:12 ru Exp $*/
 
 #include <dev/em/if_em.h>
 
@@ -727,11 +727,10 @@
 	case SIOCSIFCAP:
 		IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFCAP (Set Capabilities)");
 		mask = ifr->ifr_reqcap ^ ifp->if_capenable;
+		if (mask & IFCAP_POLLING)
+			ifp->if_capenable ^= IFCAP_POLLING;
 		if (mask & IFCAP_HWCSUM) {
-			if (IFCAP_HWCSUM & ifp->if_capenable)
-				ifp->if_capenable &= ~IFCAP_HWCSUM;
-			else
-				ifp->if_capenable |= IFCAP_HWCSUM;
+			ifp->if_capenable ^= IFCAP_HWCSUM;
 			if (ifp->if_flags & IFF_RUNNING)
 				em_init(adapter);
 		}
@@ -888,6 +887,10 @@
 
 	mtx_assert(&adapter->mtx, MA_OWNED);
 
+	if (!(ifp->if_capenable & IFCAP_POLLING)) {
+		ether_poll_deregister(ifp);
+		cmd = POLL_DEREGISTER;
+	}
         if (cmd == POLL_DEREGISTER) {       /* final call, enable interrupts */
                 em_enable_intr(adapter);
                 return;
@@ -945,7 +948,8 @@
                 return;
 	}
 
-        if (ether_poll_register(em_poll, ifp)) {
+	if ((ifp->if_capenable & IFCAP_POLLING) &&
+	    ether_poll_register(em_poll, ifp)) {
                 em_disable_intr(adapter);
                 em_poll_locked(ifp, 0, 1);
 		EM_UNLOCK(adapter);
@@ -1864,6 +1868,10 @@
         ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
 #endif
 
+#ifdef DEVICE_POLLING
+	ifp->if_capabilities |= IFCAP_POLLING;
+	ifp->if_capenable |= IFCAP_POLLING;
+#endif
 
 	/* 
 	 * Specify the media types supported by this adapter and register

==== //depot/projects/netperf_socket/sys/dev/nge/if_nge.c#7 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/nge/if_nge.c,v 1.57 2004/04/11 18:28:14 ru Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/nge/if_nge.c,v 1.58 2004/04/11 19:25:56 ru Exp $");
 
 /*
  * National Semiconductor DP83820/DP83821 gigabit ethernet driver
@@ -948,6 +948,9 @@
 	ifp->if_snd.ifq_maxlen = NGE_TX_LIST_CNT - 1;
 	ifp->if_hwassist = NGE_CSUM_FEATURES;
 	ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING;
+#ifdef DEVICE_POLLING
+	ifp->if_capabilities |= IFCAP_POLLING;
+#endif
 	ifp->if_capenable = ifp->if_capabilities;
 
 	/*
@@ -1523,6 +1526,10 @@
 {
 	struct  nge_softc *sc = ifp->if_softc;
 
+	if (!(ifp->if_capenable & IFCAP_POLLING)) {
+		ether_poll_deregister(ifp);
+		cmd = POLL_DEREGISTER;
+	}
 	if (cmd == POLL_DEREGISTER) {	/* final call, enable interrupts */
 		CSR_WRITE_4(sc, NGE_IER, 1);
 		return;
@@ -1575,7 +1582,8 @@
 #ifdef DEVICE_POLLING
 	if (ifp->if_flags & IFF_POLLING)
 		return;
-	if (ether_poll_register(nge_poll, ifp)) { /* ok, disable interrupts */
+	if ((ifp->if_capenable & IFCAP_POLLING) &&
+	    ether_poll_register(nge_poll, ifp)) { /* ok, disable interrupts */
 		CSR_WRITE_4(sc, NGE_IER, 0);
 		nge_poll(ifp, 0, 1);
 		return;
@@ -2156,6 +2164,9 @@
 					      command);
 		}
 		break;
+	case SIOCSIFCAP:
+		ifp->if_capenable = ifr->ifr_reqcap;
+		break;
 	default:
 		error = ether_ioctl(ifp, command, data);
 		break;

==== //depot/projects/netperf_socket/sys/dev/pccard/pccard_cis.c#2 (text+ko) ====

@@ -1,5 +1,5 @@
 /* $NetBSD: pcmcia_cis.c,v 1.17 2000/02/10 09:01:52 chopps Exp $ */
-/* $FreeBSD: src/sys/dev/pccard/pccard_cis.c,v 1.27 2003/10/07 03:33:53 imp Exp $ */
+/* $FreeBSD: src/sys/dev/pccard/pccard_cis.c,v 1.28 2004/04/12 20:56:34 imp Exp $ */
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -60,7 +60,7 @@
 #define	DEVPRINTF(arg)
 #endif
 
-#define	PCCARD_CIS_SIZE		1024
+#define	PCCARD_CIS_SIZE		4096
 
 struct cis_state {
 	int	count;
@@ -96,6 +96,7 @@
 
 	state.pf = NULL;
 
+	tsleep(&state, 0, "pccard", hz);
 	if (pccard_scan_cis(sc->dev, pccard_parse_cis_tuple,
 	    &state) == -1)
 		state.card->error++;
@@ -126,9 +127,15 @@
 
 	/* allocate some memory */
 
+	/*
+	 * Some reports from the field suggest that a 64k memory boundary
+	 * helps card CIS being able to be read.  Try it here and see what
+	 * the results actually are.  I'm not sure I understand why this
+	 * would make cards work better, but it is easy enough to test.
+	 */
 	rid = 0;
-	res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 
-	    PCCARD_CIS_SIZE, RF_ACTIVE);
+	res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0,
+	    PCCARD_CIS_SIZE, RF_ACTIVE | rman_make_alignment_flags(64*1024));
 	if (res == NULL) {
 		device_printf(dev, "can't alloc memory to read attributes\n");
 		return -1;

==== //depot/projects/netperf_socket/sys/dev/pccbb/pccbb.c#5 (text+ko) ====

@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pccbb/pccbb.c,v 1.106 2004/04/06 22:50:50 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pccbb/pccbb.c,v 1.107 2004/04/12 21:04:54 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1123,7 +1123,6 @@
 	 */
 	sockevent = cbb_get(sc, CBB_SOCKET_EVENT);
 	if (sockevent != 0) {
-		DPRINTF(("CBB EVENT 0x%x\n", sockevent));
 		/* ack the interrupt */
 		cbb_setb(sc, CBB_SOCKET_EVENT, sockevent);
 
@@ -1145,7 +1144,6 @@
 			cbb_setb(sc, CBB_SOCKET_MASK, CBB_SOCKET_MASK_CD);
 			sc->flags &= ~CBB_CARD_OK;
 			cbb_disable_func_intr(sc);
-			DPRINTF(("Waking up thread\n"));
 			cv_signal(&sc->cv);
 			mtx_unlock(&sc->mtx);
 		}
@@ -1768,6 +1766,7 @@
 {
 	struct resource *res = NULL;
 	struct cbb_softc *sc = device_get_softc(brdev);
+	int align;
 	int tmp;
 
 	switch (type) {
@@ -1776,8 +1775,20 @@
 			start = cbb_start_mem;
 		if (end < start)
 			end = start;
-		flags = (flags & ~RF_ALIGNMENT_MASK) |
-		    rman_make_alignment_flags(CBB_MEMALIGN);
+		if (count < CBB_MEMALIGN)
+			align = CBB_MEMALIGN;
+		else
+			align = count;
+		if (align > (1 << RF_ALIGNMENT(flags)))
+			flags = (flags & ~RF_ALIGNMENT_MASK) | 
+			    rman_make_alignment_flags(align);
+		if (count < CBB_MEMALIGN)
+			align = CBB_MEMALIGN;
+		else
+			align = count;
+		if (align > (1 << RF_ALIGNMENT(flags)))
+			flags = (flags & ~RF_ALIGNMENT_MASK) | 
+			    rman_make_alignment_flags(align);
 		break;
 	case SYS_RES_IOPORT:
 		if (start < cbb_start_16_io)

==== //depot/projects/netperf_socket/sys/dev/random/randomdev.c#4 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/random/randomdev.c,v 1.49 2004/04/09 15:47:09 markm Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/random/randomdev.c,v 1.50 2004/04/12 09:13:24 markm Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -103,25 +103,28 @@
 {
 	int c, error = 0;
 
+	mtx_lock(&random_systat.lock);
+
 	/* Blocking logic */
 	while (!random_systat.seeded && !error) {
 		if (flag & IO_NDELAY)
 			error = EWOULDBLOCK;
 		else
-			error = tsleep(&random_systat,
+			error = msleep(&random_systat, &random_systat.lock,
 			    PUSER | PCATCH, "block", 0);
 	}
 
 	/* The actual read */
 	if (!error) {
-		mtx_lock(&random_systat.lock);
 		while (uio->uio_resid > 0 && !error) {
 			c = MIN(uio->uio_resid, PAGE_SIZE);
 			c = (*random_systat.read)(random_buf, c);
 			error = uiomove(random_buf, c, uio);
 		}
-		mtx_unlock(&random_systat.lock);
 	}
+
+	mtx_unlock(&random_systat.lock);
+
 	return (error);
 }
 

==== //depot/projects/netperf_socket/sys/dev/re/if_re.c#4 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.19 2004/03/17 17:50:40 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $");
 
 /*
  * RealTek 8139C+/8169/8169S/8110S PCI NIC driver
@@ -1256,6 +1256,9 @@
 	ifp->if_start = re_start;
 	ifp->if_hwassist = RE_CSUM_FEATURES;
 	ifp->if_capabilities |= IFCAP_HWCSUM|IFCAP_VLAN_HWTAGGING;
+#ifdef DEVICE_POLLING
+	ifp->if_capabilities |= IFCAP_POLLING;
+#endif
 	ifp->if_watchdog = re_watchdog;
 	ifp->if_init = re_init;
 	if (sc->rl_type == RL_8169)
@@ -1766,6 +1769,10 @@
 	struct rl_softc *sc = ifp->if_softc;
 
 	RL_LOCK(sc);
+	if (!(ifp->if_capenable & IFCAP_POLLING)) {
+		ether_poll_deregister(ifp);
+		cmd = POLL_DEREGISTER;
+	}
 	if (cmd == POLL_DEREGISTER) { /* final call, enable interrupts */
 		CSR_WRITE_2(sc, RL_IMR, RL_INTRS_CPLUS);
 		goto done;
@@ -1826,7 +1833,8 @@
 #ifdef DEVICE_POLLING
 	if  (ifp->if_flags & IFF_POLLING)
 		goto done;
-	if (ether_poll_register(re_poll, ifp)) { /* ok, disable interrupts */
+	if ((ifp->if_capenable & IFCAP_POLLING) &&
+	    ether_poll_register(re_poll, ifp)) { /* ok, disable interrupts */
 		CSR_WRITE_2(sc, RL_IMR, 0x0000);
 		re_poll(ifp, 0, 1);
 		goto done;

==== //depot/projects/netperf_socket/sys/fs/specfs/spec_vnops.c#5 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)spec_vnops.c	8.14 (Berkeley) 5/21/95
- * $FreeBSD: src/sys/fs/specfs/spec_vnops.c,v 1.220 2004/04/07 20:46:02 imp Exp $
+ * $FreeBSD: src/sys/fs/specfs/spec_vnops.c,v 1.221 2004/04/12 21:52:52 phk Exp $
  */
 
 #include <sys/param.h>
@@ -382,9 +382,9 @@
 	    ("spec_poll() on un-referenced dev_t (%s)", devtoname(dev)));
 	cdevsw_ref(dsw);
 	if (!(dsw->d_flags & D_NEEDGIANT)) {
-		DROP_GIANT();
+		/* XXX: not yet DROP_GIANT(); */
 		error = dsw->d_poll(dev, ap->a_events, ap->a_td);
-		PICKUP_GIANT();
+		/* XXX: not yet PICKUP_GIANT(); */
 	} else
 		error = dsw->d_poll(dev, ap->a_events, ap->a_td);
 	cdevsw_rel(dsw);

==== //depot/projects/netperf_socket/sys/i386/conf/NOTES#15 (text+ko) ====

@@ -4,7 +4,7 @@
 # This file contains machine dependent kernel configuration notes.  For
 # machine independent notes, look in /sys/conf/NOTES.
 #
-# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1150 2004/04/05 19:31:18 bde Exp $
+# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1151 2004/04/12 02:36:51 imp Exp $
 #
 
 #
@@ -931,6 +931,10 @@
 #
 #---------------------------------------------------------------------------
 
+# sx device is i386 (and pc98?) only at the moment.
+device		sx
+options 	SX_DEBUG
+
 #
 # Set the number of PV entries per process.  Increasing this can
 # stop panics related to heavy use of shared memory.  However, that can

==== //depot/projects/netperf_socket/sys/kern/kern_exec.c#7 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.241 2004/04/01 00:10:44 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.242 2004/04/11 19:57:11 alc Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_mac.h"
@@ -795,7 +795,7 @@
 		}
 	}
 	vm_page_lock_queues();
-	vm_page_wire(ma[0]);
+	vm_page_hold(ma[0]);
 	vm_page_wakeup(ma[0]);
 	vm_page_unlock_queues();
 	VM_OBJECT_UNLOCK(object);
@@ -814,7 +814,7 @@
 	if (imgp->firstpage != NULL) {
 		pmap_qremove((vm_offset_t)imgp->image_header, 1);
 		vm_page_lock_queues();
-		vm_page_unwire(imgp->firstpage, 1);
+		vm_page_unhold(imgp->firstpage);
 		vm_page_unlock_queues();
 		imgp->firstpage = NULL;
 	}

==== //depot/projects/netperf_socket/sys/kern/kern_sig.c#7 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.275 2004/04/05 21:03:35 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.276 2004/04/12 15:56:05 cperciva Exp $");
 
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -2020,8 +2020,8 @@
 	PROC_LOCK(p->p_pptr);
 	psignal(p->p_pptr, SIGCHLD);
 	PROC_UNLOCK(p->p_pptr);
+	stop(p);
 	mtx_lock_spin(&sched_lock);
-	stop(p);	/* uses schedlock too eventually */
 	thread_suspend_one(td);
 	PROC_UNLOCK(p);
 	DROP_GIANT();
@@ -2216,8 +2216,7 @@
 /*
  * Put the argument process into the stopped state and notify the parent
  * via wakeup.  Signals are handled elsewhere.  The process must not be
- * on the run queue.  Must be called with the proc p locked and the scheduler
- * lock held.
+ * on the run queue.  Must be called with the proc p locked.
  */
 static void
 stop(struct proc *p)

==== //depot/projects/netperf_socket/sys/kern/subr_rman.c#2 (text+ko) ====

@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/subr_rman.c,v 1.31 2003/06/11 00:56:57 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/subr_rman.c,v 1.32 2004/04/12 23:02:21 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -234,7 +234,7 @@
 				rstart += bound - (rstart & ~bmask);
 		} while ((rstart & amask) != 0 && rstart < end &&
 		    rstart < s->r_end);
-		rend = ulmin(s->r_end, ulmax(rstart + count, end));
+		rend = ulmin(s->r_end, ulmax(rstart + count - 1, end));
 		if (rstart > rend) {
 			DPRINTF(("adjusted start exceeds end\n"));
 			continue;
@@ -334,7 +334,7 @@
 		if ((s->r_flags & flags) != flags)
 			continue;
 		rstart = ulmax(s->r_start, start);
-		rend = ulmin(s->r_end, ulmax(start + count, end));
+		rend = ulmin(s->r_end, ulmax(start + count - 1, end));
 		if (s->r_start >= start && s->r_end <= end
 		    && (s->r_end - s->r_start + 1) == count &&
 		    (s->r_start & amask) == 0 &&

==== //depot/projects/netperf_socket/sys/kern/vfs_subr.c#7 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_subr.c,v 1.489 2004/04/05 21:03:37 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_subr.c,v 1.490 2004/04/11 21:09:22 mux Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mac.h"
@@ -2763,6 +2763,9 @@
 	xvfsp->vfc_next = NULL;
 }
 
+/*
+ * Top level filesystem related information gathering.
+ */
 static int
 sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS)
 {
@@ -2794,9 +2797,7 @@
 SYSCTL_PROC(_vfs, OID_AUTO, conflist, CTLFLAG_RD, NULL, 0, sysctl_vfs_conflist,
     "S,xvfsconf", "List of all configured filesystems");
 
-/*
- * Top level filesystem related information gathering.
- */
+#ifndef BURN_BRIDGES
 static int	sysctl_ovfs_conf(SYSCTL_HANDLER_ARGS);
 
 static int
@@ -2861,6 +2862,7 @@
 }
 
 #endif /* 1 || COMPAT_PRELITE2 */
+#endif /* !BURN_BRIDGES */
 
 #define KINFO_VNODESLOP		10
 #ifdef notyet

==== //depot/projects/netperf_socket/sys/net/if_var.h#7 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	From: @(#)if.h	8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/net/if_var.h,v 1.68 2004/04/11 16:35:53 rwatson Exp $
+ * $FreeBSD: src/sys/net/if_var.h,v 1.69 2004/04/12 14:59:25 ru Exp $
  */
 
 #ifndef	_NET_IF_VAR_H_
@@ -313,7 +313,7 @@
 	}
 	if (ifp != NULL) {
 		ifp->if_obytes += m->m_pkthdr.len + adjust;
-		if (m->m_flags & M_MCAST)
+		if (m->m_flags & (M_BCAST|M_MCAST))
 			ifp->if_omcasts++;
 		active = ifp->if_flags & IFF_OACTIVE;
 	}

==== //depot/projects/netperf_socket/sys/net/route.c#5 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)route.c	8.3.1.1 (Berkeley) 2/23/95
- * $FreeBSD: src/sys/net/route.c,v 1.95 2004/04/07 20:46:12 imp Exp $
+ * $FreeBSD: src/sys/net/route.c,v 1.96 2004/04/12 20:24:30 luigi Exp $
  */
 
 #include "opt_inet.h"
@@ -1148,16 +1148,12 @@
 int
 rtinit(struct ifaddr *ifa, int cmd, int flags)
 {
-	register struct rtentry *rt;
-	register struct sockaddr *dst;
-	register struct sockaddr *deldst;
+	struct sockaddr *dst;
 	struct sockaddr *netmask;
 	struct mbuf *m = 0;
-	struct rtentry *nrt = 0;
-	struct radix_node_head *rnh;
-	struct radix_node *rn;
+	struct rtentry *rt = 0;
+	struct rt_addrinfo info;
 	int error;
-	struct rt_addrinfo info;
 
 	if (flags & RTF_HOST) {
 		dst = ifa->ifa_dstaddr;
@@ -1172,6 +1168,10 @@
 	 * be confusing at best and possibly worse.
 	 */
 	if (cmd == RTM_DELETE) {
+		struct sockaddr *deldst;
+		struct radix_node_head *rnh;
+		struct radix_node *rn;
+
 		/*
 		 * It's a delete, so it should already exist..
 		 * If it's a net, mask off the host bits
@@ -1213,8 +1213,8 @@
 	info.rti_info[RTAX_DST] = dst;
 	info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr;
 	info.rti_info[RTAX_NETMASK] = netmask;
-	error = rtrequest1(cmd, &info, &nrt);
-	if (error == 0 && (rt = nrt) != NULL) {
+	error = rtrequest1(cmd, &info, &rt);
+	if (error == 0 && rt != NULL) {
 		/*
 		 * notify any listening routing agents of the change
 		 */

==== //depot/projects/netperf_socket/sys/net/rtsock.c#3 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)rtsock.c	8.7 (Berkeley) 10/12/95
- * $FreeBSD: src/sys/net/rtsock.c,v 1.98 2004/04/07 20:46:12 imp Exp $
+ * $FreeBSD: src/sys/net/rtsock.c,v 1.99 2004/04/12 20:26:01 luigi Exp $
  */
 
 #include <sys/param.h>
@@ -1080,8 +1080,8 @@
 	int	*name = (int *)arg1;
 	u_int	namelen = arg2;
 	struct radix_node_head *rnh;
-	int	i, s, error = EINVAL;
-	u_char  af;
+	int	i, lim, s, error = EINVAL;
+	u_char	af;
 	struct	walkarg w;
 
 	name ++;
@@ -1103,25 +1103,19 @@
 
 	case NET_RT_DUMP:
 	case NET_RT_FLAGS:
-		if (af != 0) {
-			if ((rnh = rt_tables[af]) != NULL) {
+		if (af == 0) {			/* dump all tables */
+			i = 1;
+			lim = AF_MAX;
+		} else				/* dump only one table */
+			i = lim = af;
+		for (error = 0; error == 0 && i <= lim; i++)
+			if ((rnh = rt_tables[i]) != NULL) {
 				/* RADIX_NODE_HEAD_LOCK(rnh); */
 			    	error = rnh->rnh_walktree(rnh,
 				    sysctl_dumpentry, &w);/* could sleep XXX */
 				/* RADIX_NODE_HEAD_UNLOCK(rnh); */
-			} else
+			} else if (af != 0)
 				error = EAFNOSUPPORT;
-		} else {
-			for (i = 1; i <= AF_MAX; i++)
-				if ((rnh = rt_tables[i]) != NULL) {
-					/* RADIX_NODE_HEAD_LOCK(rnh); */
-					error = rnh->rnh_walktree(rnh,
-					    sysctl_dumpentry, &w);
-					/* RADIX_NODE_HEAD_UNLOCK(rnh); */
-					if (error)
-						break;
-				}
-		}
 		break;
 
 	case NET_RT_IFLIST:

==== //depot/projects/netperf_socket/sys/nfsserver/nfs_serv.c#4 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/nfsserver/nfs_serv.c,v 1.139 2004/04/07 04:59:57 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/nfsserver/nfs_serv.c,v 1.140 2004/04/12 13:02:21 mux Exp $");
 
 /*
  * nfs version 2 and 3 server calls to vnode ops
@@ -3808,7 +3808,16 @@
 		tval = (u_quad_t)sf->f_bfree;
 		tval *= (u_quad_t)sf->f_bsize;
 		txdr_hyper(tval, &sfp->sf_fbytes);
-		tval = (u_quad_t)sf->f_bavail;
+		/*
+		 * Don't send negative values for available space,
+		 * since this field is unsigned in the NFS protocol.
+		 * Otherwise, the client would see absurdly high
+		 * numbers for free space.
+		 */
+		if (sf->f_bavail < 0)
+			tval = 0;
+		else
+			tval = (u_quad_t)sf->f_bavail;
 		tval *= (u_quad_t)sf->f_bsize;
 		txdr_hyper(tval, &sfp->sf_abytes);
 		sfp->sf_tfiles.nfsuquad[0] = 0;
@@ -3823,7 +3832,10 @@
 		sfp->sf_bsize = txdr_unsigned(sf->f_bsize);
 		sfp->sf_blocks = txdr_unsigned(sf->f_blocks);
 		sfp->sf_bfree = txdr_unsigned(sf->f_bfree);
-		sfp->sf_bavail = txdr_unsigned(sf->f_bavail);
+		if (sf->f_bavail < 0)
+			sfp->sf_bavail = 0;
+		else
+			sfp->sf_bavail = txdr_unsigned(sf->f_bavail);
 	}
 nfsmout:
 	if (vp)

==== //depot/projects/netperf_socket/sys/pci/if_sis.c#5 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_sis.c,v 1.96 2004/03/17 17:50:53 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_sis.c,v 1.97 2004/04/11 20:34:08 ru Exp $");
 
 /*
  * SiS 900/SiS 7016 fast ethernet PCI NIC driver. Datasheets are
@@ -1391,6 +1391,11 @@
 	ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
 	ifp->if_capabilities |= IFCAP_VLAN_MTU;
 
+#ifdef DEVICE_POLLING
+	ifp->if_capabilities |= IFCAP_POLLING;
+#endif
+	ifp->if_capenable = ifp->if_capabilities;
+
 	/* Hook interrupt last to avoid having to lock softc */
 	error = bus_setup_intr(dev, sc->sis_irq, INTR_TYPE_NET | INTR_MPSAFE,
 	    sis_intr, sc, &sc->sis_intrhand);
@@ -1773,6 +1778,10 @@
 	struct	sis_softc *sc = ifp->if_softc;
 
 	SIS_LOCK(sc);
+	if (!(ifp->if_capenable & IFCAP_POLLING)) {
+		ether_poll_deregister(ifp);
+		cmd = POLL_DEREGISTER;
+	}
 	if (cmd == POLL_DEREGISTER) { /* final call, enable interrupts */
 		CSR_WRITE_4(sc, SIS_IER, 1);
 		goto done;
@@ -1829,7 +1838,8 @@
 #ifdef DEVICE_POLLING
 	if (ifp->if_flags & IFF_POLLING)
 		goto done;
-	if (ether_poll_register(sis_poll, ifp)) { /* ok, disable interrupts */
+	if ((ifp->if_capenable & IFCAP_POLLING) &&
+	    ether_poll_register(sis_poll, ifp)) { /* ok, disable interrupts */
 		CSR_WRITE_4(sc, SIS_IER, 0);
 		goto done;
 	}
@@ -2329,6 +2339,9 @@
 		error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
 		SIS_UNLOCK(sc);
 		break;
+	case SIOCSIFCAP:
+		ifp->if_capenable = ifr->ifr_reqcap;
+		break;
 	default:
 		error = ether_ioctl(ifp, command, data);
 		break;

==== //depot/projects/netperf_socket/sys/sys/mount.h#7 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)mount.h	8.21 (Berkeley) 5/20/95
- * $FreeBSD: src/sys/sys/mount.h,v 1.159 2004/04/07 04:19:49 imp Exp $
+ * $FreeBSD: src/sys/sys/mount.h,v 1.161 2004/04/11 21:36:31 mux Exp $
  */
 
 #ifndef _SYS_MOUNT_H_
@@ -353,6 +353,7 @@
 	struct	vfsconf *vfc_next;	/* next in list */
 };
 
+#ifndef BURN_BRIDGES
 struct ovfsconf {
 	void	*vfc_vfsops;
 	char	vfc_name[32];
@@ -360,6 +361,7 @@
 	int	vfc_refcount;
 	int	vfc_flags;
 };
+#endif
 
 /*
  * NB: these flags refer to IMPLEMENTATION properties, not properties of
@@ -553,13 +555,7 @@
 int	unmount(const char *, int);
 
 /* C library stuff */
-void	endvfsent(void);
 int	getvfsbyname(const char *, struct xvfsconf *);
-struct	ovfsconf *getvfsbytype(int);
-struct	ovfsconf *getvfsent(void);
-void	setvfsent(int);
-int	vfsisloadable(const char *);
-int	vfsload(const char *);
 __END_DECLS
 
 #endif /* _KERNEL */

==== //depot/projects/netperf_socket/sys/sys/param.h#8 (text+ko) ====

@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)param.h	8.3 (Berkeley) 4/4/95
- * $FreeBSD: src/sys/sys/param.h,v 1.189 2004/04/07 04:19:49 imp Exp $
+ * $FreeBSD: src/sys/sys/param.h,v 1.190 2004/04/11 21:57:07 mux Exp $
  */
 
 #ifndef _SYS_PARAM_H_
@@ -55,7 +55,7 @@
  * scheme is:  <major><two digit minor><0 if release branch, otherwise 1>xx
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 502110	/* Master, propagated to newvers */
+#define __FreeBSD_version 502111	/* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include <sys/types.h>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404130012.i3D0COBW099493>