Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Nov 2003 12:53:59 -0800 (PST)
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 43004 for review
Message-ID:  <200311242053.hAOKrxo0029612@repoman.freebsd.org>

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

Change 43004 by sam@sam_ebb on 2003/11/24 12:53:14

	split the "inp" mutex class into separate classes for
	each of divert, raw, tcp, udp, raw6, and udp6 sockets
	to avoid spurious witness complaints

Affected files ...

.. //depot/projects/netperf/sys/netinet/in_pcb.c#20 edit
.. //depot/projects/netperf/sys/netinet/in_pcb.h#16 edit
.. //depot/projects/netperf/sys/netinet/ip_divert.c#17 edit
.. //depot/projects/netperf/sys/netinet/raw_ip.c#13 edit
.. //depot/projects/netperf/sys/netinet/tcp_usrreq.c#8 edit
.. //depot/projects/netperf/sys/netinet/udp_usrreq.c#14 edit
.. //depot/projects/netperf/sys/netinet6/raw_ip6.c#11 edit
.. //depot/projects/netperf/sys/netinet6/udp6_usrreq.c#7 edit

Differences ...

==== //depot/projects/netperf/sys/netinet/in_pcb.c#20 (text+ko) ====

@@ -157,10 +157,11 @@
  * Allocate a PCB and associate it with the socket.
  */
 int
-in_pcballoc(so, pcbinfo, td)
+in_pcballoc(so, pcbinfo, td, type)
 	struct socket *so;
 	struct inpcbinfo *pcbinfo;
 	struct thread *td;
+	const char *type;
 {
 	register struct inpcb *inp;
 	int error;
@@ -198,7 +199,7 @@
 	LIST_INSERT_HEAD(pcbinfo->listhead, inp, inp_list);
 	pcbinfo->ipi_count++;
 	so->so_pcb = (caddr_t)inp;
-	INP_LOCK_INIT(inp, "inp");
+	INP_LOCK_INIT(inp, "inp", type);
 #ifdef INET6
 	if (ip6_auto_flowlabel)
 		inp->inp_flags |= IN6P_AUTOFLOWLABEL;

==== //depot/projects/netperf/sys/netinet/in_pcb.h#16 (text+ko) ====

@@ -242,8 +242,8 @@
  *     this code is shared by both IPv4 and IPv6 and IPv6 is
  *     not properly locked.
  */
-#define INP_LOCK_INIT(inp, d) \
-	mtx_init(&(inp)->inp_mtx, (d), NULL, MTX_DEF | MTX_RECURSE | MTX_DUPOK)
+#define INP_LOCK_INIT(inp, d, t) \
+	mtx_init(&(inp)->inp_mtx, (d), (t), MTX_DEF | MTX_RECURSE | MTX_DUPOK)
 #define INP_LOCK_DESTROY(inp)	mtx_destroy(&(inp)->inp_mtx)
 #define INP_LOCK(inp)		mtx_lock(&(inp)->inp_mtx)
 #define INP_UNLOCK(inp)		mtx_unlock(&(inp)->inp_mtx)
@@ -337,7 +337,8 @@
 extern int	ipport_hilastauto;
 
 void	in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *);
-int	in_pcballoc(struct socket *, struct inpcbinfo *, struct thread *);
+int	in_pcballoc(struct socket *, struct inpcbinfo *, struct thread *,
+	    const char *);
 int	in_pcbbind(struct inpcb *, struct sockaddr *, struct thread *);
 int	in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *,
 	    u_short *, struct thread *);

==== //depot/projects/netperf/sys/netinet/ip_divert.c#17 (text+ko) ====

@@ -393,7 +393,7 @@
 		INP_INFO_WUNLOCK(&divcbinfo);
 		return error;
 	}
-	error = in_pcballoc(so, &divcbinfo, td);
+	error = in_pcballoc(so, &divcbinfo, td, "divinp");
 	if (error) {
 		INP_INFO_WUNLOCK(&divcbinfo);
 		return error;

==== //depot/projects/netperf/sys/netinet/raw_ip.c#13 (text+ko) ====

@@ -541,7 +541,7 @@
 		INP_INFO_WUNLOCK(&ripcbinfo);
 		return error;
 	}
-	error = in_pcballoc(so, &ripcbinfo, td);
+	error = in_pcballoc(so, &ripcbinfo, td, "rawinp");
 	if (error) {
 		INP_INFO_WUNLOCK(&ripcbinfo);
 		return error;

==== //depot/projects/netperf/sys/netinet/tcp_usrreq.c#8 (text+ko) ====

@@ -1175,7 +1175,7 @@
 		if (error)
 			return (error);
 	}
-	error = in_pcballoc(so, &tcbinfo, td);
+	error = in_pcballoc(so, &tcbinfo, td, "tcpinp");
 	if (error)
 		return (error);
 	inp = sotoinpcb(so);

==== //depot/projects/netperf/sys/netinet/udp_usrreq.c#14 (text+ko) ====

@@ -943,7 +943,7 @@
 		return error;
 	}
 	s = splnet();
-	error = in_pcballoc(so, &udbinfo, td);
+	error = in_pcballoc(so, &udbinfo, td, "udpinp");
 	splx(s);
 	if (error) {
 		INP_INFO_WUNLOCK(&udbinfo);

==== //depot/projects/netperf/sys/netinet6/raw_ip6.c#11 (text+ko) ====

@@ -580,7 +580,7 @@
 	if (error)
 		return error;
 	s = splnet();
-	error = in_pcballoc(so, &ripcbinfo, td);
+	error = in_pcballoc(so, &ripcbinfo, td, "raw6inp");
 	splx(s);
 	if (error)
 		return error;

==== //depot/projects/netperf/sys/netinet6/udp6_usrreq.c#7 (text+ko) ====

@@ -560,7 +560,7 @@
 			return error;
 	}
 	s = splnet();
-	error = in_pcballoc(so, &udbinfo, td);
+	error = in_pcballoc(so, &udbinfo, td, "udp6inp");
 	splx(s);
 	if (error)
 		return error;



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