Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Apr 2006 21:28:04 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 96015 for review
Message-ID:  <200604242128.k3OLS4vu038660@repoman.freebsd.org>

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

Change 96015 by marcel@marcel_nfs on 2006/04/24 21:27:06

	IFC @96013

Affected files ...

.. //depot/projects/uart/alpha/conf/GENERIC#13 integrate
.. //depot/projects/uart/amd64/amd64/mp_machdep.c#13 integrate
.. //depot/projects/uart/amd64/conf/GENERIC#17 integrate
.. //depot/projects/uart/i386/conf/GENERIC#16 integrate
.. //depot/projects/uart/i386/i386/mp_machdep.c#21 integrate
.. //depot/projects/uart/kern/serdev_if.m#7 integrate
.. //depot/projects/uart/kern/uipc_usrreq.c#13 integrate
.. //depot/projects/uart/netinet/tcp_usrreq.c#13 integrate
.. //depot/projects/uart/sparc64/conf/GENERIC#18 integrate

Differences ...

==== //depot/projects/uart/alpha/conf/GENERIC#13 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.192 2006/01/10 09:19:07 phk Exp $
+# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.193 2006/04/24 08:44:33 delphij Exp $
 
 cpu		EV4
 cpu		EV5
@@ -70,8 +70,6 @@
 options 	SYSVMSG			# SYSV-style message queues
 options 	SYSVSEM			# SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
-options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
-					# output.  Adds ~128k to driver.
 options 	ADAPTIVE_GIANT		# Giant mutex is adaptive.
 
 # Debugging for use in -current
@@ -106,6 +104,8 @@
 
 # SCSI Controllers
 device		ahc		# AHA2940 and onboard AIC7xxx devices
+options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
+					# output.  Adds ~128k to driver.
 device		isp		# Qlogic family
 device		ispfw		# Firmware module for Qlogic host adapters
 device		mpt		# LSI-Logic MPT-Fusion

==== //depot/projects/uart/amd64/amd64/mp_machdep.c#13 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.271 2006/03/18 19:32:46 ups Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.272 2006/04/24 21:17:01 cperciva Exp $");
 
 #include "opt_cpu.h"
 #include "opt_kstack_pages.h"
@@ -385,8 +385,8 @@
 		 * are available, use them.
 		 */
 		if (cpu_high >= 4) {
-			/* Ask the processor about up to 32 caches. */
-			for (i = 0; i < 32; i++) {
+			/* Ask the processor about the L1 cache. */
+			for (i = 0; i < 1; i++) {
 				cpuid_count(4, i, p);
 				threads_per_cache = ((p[0] & 0x3ffc000) >> 14) + 1;
 				if (hyperthreading_cpus < threads_per_cache)

==== //depot/projects/uart/amd64/conf/GENERIC#17 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.452 2006/04/10 20:04:22 ps Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.453 2006/04/24 08:44:33 delphij Exp $
 
 cpu		HAMMER
 ident		GENERIC
@@ -57,10 +57,6 @@
 options 	SYSVSEM			# SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
-options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
-					# output.  Adds ~128k to driver.
-options 	AHD_REG_PRETTY_PRINT	# Print register bitfields in debug
-					# output.  Adds ~215k to driver.
 options 	ADAPTIVE_GIANT		# Giant mutex is adaptive.
 options 	STOP_NMI		# Stop CPUS using NMI instead of IPI
 
@@ -98,7 +94,11 @@
 
 # SCSI Controllers
 device		ahc		# AHA2940 and onboard AIC7xxx devices
+options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
+					# output.  Adds ~128k to driver.
 device		ahd		# AHA39320/29320 and onboard AIC79xx devices
+options 	AHD_REG_PRETTY_PRINT	# Print register bitfields in debug
+					# output.  Adds ~215k to driver.
 device		amd		# AMD 53C974 (Tekram DC-390(T))
 device		isp		# Qlogic family
 #device 	ispfw		# Firmware for QLogic HBAs- normally a module

==== //depot/projects/uart/i386/conf/GENERIC#16 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.441 2006/04/10 20:04:22 ps Exp $
+# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.442 2006/04/24 08:44:34 delphij Exp $
 
 cpu		I486_CPU
 cpu		I586_CPU
@@ -57,10 +57,6 @@
 options 	SYSVSEM			# SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
-options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
-					# output.  Adds ~128k to driver.
-options 	AHD_REG_PRETTY_PRINT	# Print register bitfields in debug
-					# output.  Adds ~215k to driver.
 options 	ADAPTIVE_GIANT		# Giant mutex is adaptive.
 options 	STOP_NMI		# Stop CPUS using NMI instead of IPI
 
@@ -96,7 +92,11 @@
 # SCSI Controllers
 device		ahb		# EISA AHA1742 family
 device		ahc		# AHA2940 and onboard AIC7xxx devices
+options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
+					# output.  Adds ~128k to driver.
 device		ahd		# AHA39320/29320 and onboard AIC79xx devices
+options 	AHD_REG_PRETTY_PRINT	# Print register bitfields in debug
+					# output.  Adds ~215k to driver.
 device		amd		# AMD 53C974 (Tekram DC-390(T))
 device		isp		# Qlogic family
 #device 	ispfw		# Firmware for QLogic HBAs- normally a module

==== //depot/projects/uart/i386/i386/mp_machdep.c#21 (text+ko) ====

@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.264 2006/03/09 16:38:52 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.265 2006/04/24 21:17:01 cperciva Exp $");
 
 #include "opt_apic.h"
 #include "opt_cpu.h"
@@ -434,8 +434,8 @@
 		 * are available, use them.
 		 */
 		if (cpu_high >= 4) {
-			/* Ask the processor about up to 32 caches. */
-			for (i = 0; i < 32; i++) {
+			/* Ask the processor about the L1 cache. */
+			for (i = 0; i < 1; i++) {
 				cpuid_count(4, i, p);
 				threads_per_cache = ((p[0] & 0x3ffc000) >> 14) + 1;
 				if (hyperthreading_cpus < threads_per_cache)

==== //depot/projects/uart/kern/serdev_if.m#7 (text+ko) ====

@@ -23,7 +23,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/sys/kern/serdev_if.m,v 1.1 2006/03/30 18:33:22 marcel Exp $
+# $FreeBSD: src/sys/kern/serdev_if.m,v 1.2 2006/04/23 22:12:39 marcel Exp $
 #
 
 #include <sys/bus.h>

==== //depot/projects/uart/kern/uipc_usrreq.c#13 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.166 2006/04/21 09:25:39 ps Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.167 2006/04/24 19:09:33 maxim Exp $");
 
 #include "opt_mac.h"
 
@@ -950,6 +950,8 @@
 		memcpy(&unp->unp_peercred, &unp2->unp_peercred,
 		    sizeof(unp->unp_peercred));
 		unp->unp_flags |= UNP_HAVEPC;
+		if (unp2->unp_flags & UNP_WANTCRED)
+			unp3->unp_flags |= UNP_WANTCRED;
 #ifdef MAC
 		SOCK_LOCK(so);
 		mac_set_socket_peer_from_socket(so, so3);

==== //depot/projects/uart/netinet/tcp_usrreq.c#13 (text+ko) ====

@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  *
  *	From: @(#)tcp_usrreq.c	8.2 (Berkeley) 1/3/94
- * $FreeBSD: src/sys/netinet/tcp_usrreq.c,v 1.135 2006/04/03 12:43:56 rwatson Exp $
+ * $FreeBSD: src/sys/netinet/tcp_usrreq.c,v 1.136 2006/04/24 08:20:02 rwatson Exp $
  */
 
 #include "opt_inet.h"
@@ -139,46 +139,27 @@
 }
 
 /*
- * pru_detach() detaches the TCP protocol from the socket.
- * If the protocol state is non-embryonic, then can't
- * do this directly: have to initiate a pru_disconnect(),
- * which may finish later; embryonic TCB's can just
- * be discarded here.
+ * tcp_detach() releases any protocol state that can be reasonably released
+ * when a socket shutdown is requested, and is a shared code path for
+ * tcp_usr_detach() and tcp_usr_abort(), the two socket close entry points.
+ *
+ * Accepts pcbinfo, inpcb locked, will unlock the inpcb (if needed) on
+ * return.
  */
 static void
-tcp_usr_detach(struct socket *so)
+tcp_detach(struct socket *so, struct inpcb *inp)
 {
-	struct inpcb *inp;
 	struct tcpcb *tp;
 #ifdef INET6
 	int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != 0;
 #endif
-	TCPDEBUG0;
 
-	inp = sotoinpcb(so);
-	KASSERT(inp != NULL, ("tcp_usr_detach: inp == NULL"));
-	INP_INFO_WLOCK(&tcbinfo);
-	INP_LOCK(inp);
-	KASSERT(inp->inp_socket != NULL,
-	    ("tcp_usr_detach: inp_socket == NULL"));
-	TCPDEBUG1();
+	INP_INFO_WLOCK_ASSERT(&tcbinfo);
+	INP_LOCK_ASSERT(inp);
 
-	/*
-	 * First, if we still have full TCP state, and we're not dropped,
-	 * initiate a disconnect.
-	 */
-	if (!(inp->inp_vflag & INP_TIMEWAIT) &&
-	    !(inp->inp_vflag & INP_DROPPED)) {
-		tp = intotcpcb(inp);
-		tcp_disconnect(tp);
-	}
+	KASSERT(so->so_pcb == inp, ("tcp_detach: so_pcb != inp"));
+	KASSERT(inp->inp_socket == so, ("tcp_detach: inp_socket != so"));
 
-	/*
-	 * Second, release any protocol state that we can reasonably release.
-	 * Note that the call to tcp_disconnect() may actually have changed
-	 * the TCP state, so we have to re-evaluate INP_TIMEWAIT and
-	 * INP_DROPPED.
-	 */
 	if (inp->inp_vflag & INP_TIMEWAIT) {
 		if (inp->inp_vflag & INP_DROPPED) {
 			/*
@@ -248,6 +229,40 @@
 			INP_UNLOCK(inp);
 		}
 	}
+}
+
+/*
+ * pru_detach() detaches the TCP protocol from the socket.
+ * If the protocol state is non-embryonic, then can't
+ * do this directly: have to initiate a pru_disconnect(),
+ * which may finish later; embryonic TCB's can just
+ * be discarded here.
+ */
+static void
+tcp_usr_detach(struct socket *so)
+{
+	struct inpcb *inp;
+	struct tcpcb *tp;
+	TCPDEBUG0;
+
+	inp = sotoinpcb(so);
+	KASSERT(inp != NULL, ("tcp_usr_detach: inp == NULL"));
+	INP_INFO_WLOCK(&tcbinfo);
+	INP_LOCK(inp);
+	KASSERT(inp->inp_socket != NULL,
+	    ("tcp_usr_detach: inp_socket == NULL"));
+	TCPDEBUG1();
+
+	/*
+	 * First, if we still have full TCP state, and we're not dropped,
+	 * initiate a disconnect.
+	 */
+	if (!(inp->inp_vflag & INP_TIMEWAIT) &&
+	    !(inp->inp_vflag & INP_DROPPED)) {
+		tp = intotcpcb(inp);
+		tcp_disconnect(tp);
+	}
+	tcp_detach(so, inp);
 	tp = NULL;
 	TCPDEBUG2(PRU_DETACH);
 	INP_INFO_WUNLOCK(&tcbinfo);
@@ -916,41 +931,38 @@
 
 /*
  * Abort the TCP.
+ *
+ * First, drop the connection.  Then collect state if possible.
  */
 static void
 tcp_usr_abort(struct socket *so)
 {
-#if 0
 	struct inpcb *inp;
 	struct tcpcb *tp;
-#endif
+	TCPDEBUG0;
 
-	/*
-	 * XXXRW: This is not really quite the same, as we want to tcp_drop()
-	 * rather than tcp_disconnect(), I think, but for now I'll avoid
-	 * replicating all the tear-down logic here.
-	 */
-	tcp_usr_detach(so);
+	inp = sotoinpcb(so);
+	KASSERT(inp != NULL, ("tcp_usr_abort: inp == NULL"));
 
-#if 0
-	TCPDEBUG0;
 	INP_INFO_WLOCK(&tcbinfo);
-	inp = sotoinpcb(so);
 	INP_LOCK(inp);
+	KASSERT(inp->inp_socket != NULL,
+	    ("tcp_usr_abort: inp_socket == NULL"));
+	TCPDEBUG1();
+
 	/*
-	 * Do we need to handle timewait here?  Aborted connections should
-	 * never generate a FIN?
+	 * First, if we still have full TCP state, and we're not dropped,
+	 * drop.
 	 */
-	KASSERT((inp->inp_vflag & INP_TIMEWAIT) == 0,
-	    ("tcp_usr_abort: timewait"));
-	tp = intotcpcb(inp);
-	TCPDEBUG1();
-	tp = tcp_drop(tp, ECONNABORTED);
-		TCPDEBUG2(PRU_ABORT);
-	if (tp != NULL)
-		INP_UNLOCK(inp);
+	if (!(inp->inp_vflag & INP_TIMEWAIT) &&
+	    !(inp->inp_vflag & INP_DROPPED)) {
+		tp = intotcpcb(inp);
+		tcp_drop(tp, ECONNABORTED);
+	}
+	tcp_detach(so, inp);
+	tp = NULL;
+	TCPDEBUG2(PRU_DETACH);
 	INP_INFO_WUNLOCK(&tcbinfo);
-#endif
 }
 
 /*

==== //depot/projects/uart/sparc64/conf/GENERIC#18 (text+ko) ====

@@ -18,7 +18,7 @@
 #
 # For hardware specific information check HARDWARE.TXT
 #
-# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.106 2006/03/30 18:40:25 marcel Exp $
+# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.107 2006/04/24 08:44:34 delphij Exp $
 
 cpu		SUN4U
 ident		GENERIC
@@ -58,8 +58,6 @@
 options 	SYSVMSG			# SYSV-style message queues
 options 	SYSVSEM			# SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
-options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
-					# output.  Adds ~128k to driver.
 options 	ADAPTIVE_GIANT		# Giant mutex is adaptive.
 
 # Debugging for use in -current
@@ -97,6 +95,8 @@
 
 # SCSI Controllers
 device		ahc		# AHA2940 and onboard AIC7xxx devices
+options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug
+					# output.  Adds ~128k to driver.
 device		isp		# Qlogic family
 device		ispfw		# Firmware module for Qlogic host adapters
 #device		mpt		# LSI-Logic MPT-Fusion (not yet)



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