Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jun 2009 13:33:45 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 163261 for review
Message-ID:  <200906011333.n51DXjc5081946@repoman.freebsd.org>

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

Change 163261 by zec@zec_amdx4 on 2009/06/01 13:33:33

	Garbage collect diffs against head while working towards
	unbreaking options VIMAGE build.

Affected files ...

.. //depot/projects/vimage/src/sys/net/if_loop.c#48 edit
.. //depot/projects/vimage/src/sys/net80211/ieee80211.c#34 edit
.. //depot/projects/vimage/src/sys/netinet/if_ether.c#44 edit
.. //depot/projects/vimage/src/sys/netinet/in_var.h#20 edit
.. //depot/projects/vimage/src/sys/netinet/raw_ip.c#46 edit
.. //depot/projects/vimage/src/sys/netinet/sctp_crc32.c#14 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_hostcache.c#38 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_subr.c#84 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_syncache.c#53 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_timewait.c#33 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_var.h#34 edit
.. //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#56 edit
.. //depot/projects/vimage/src/sys/netinet/vinet.h#59 edit
.. //depot/projects/vimage/src/sys/nfsclient/nfs_vnops.c#35 edit

Differences ...

==== //depot/projects/vimage/src/sys/net/if_loop.c#48 (text+ko) ====

@@ -98,13 +98,7 @@
 #define	LO_CSUM_SET		(CSUM_DATA_VALID | CSUM_PSEUDO_HDR | \
 				    CSUM_IP_CHECKED | CSUM_IP_VALID | \
 				    CSUM_SCTP_VALID)
-#define LONAME	"lo"
 
-struct lo_softc {
-	struct	ifnet *sc_ifp;
-	LIST_ENTRY(lo_softc) sc_next;
-};
-
 int		loioctl(struct ifnet *, u_long, caddr_t);
 static void	lortrequest(int, struct rtentry *, struct rt_addrinfo *);
 int		looutput(struct ifnet *ifp, struct mbuf *m,
@@ -136,32 +130,21 @@
 };
 #endif /* !VIMAGE_GLOBALS */
 
-static MALLOC_DEFINE(M_LO, LONAME, "Loopback Interface");
-
-static struct mtx lo_mtx;
-
 IFC_SIMPLE_DECLARE(lo, 1);
 
 static void
 lo_clone_destroy(struct ifnet *ifp)
 {
-	struct lo_softc *sc;
 #ifdef INVARIANTS
 	INIT_VNET_NET(ifp->if_vnet);
 #endif
 	
-	sc = ifp->if_softc;
-
 	/* XXX: destroying lo0 will lead to panics. */
 	KASSERT(V_loif != ifp, ("%s: destroying lo0", __func__));
 
-	mtx_lock(&lo_mtx);
-	LIST_REMOVE(sc, sc_next);
-	mtx_unlock(&lo_mtx);
 	bpfdetach(ifp);
 	if_detach(ifp);
 	if_free(ifp);
-	free(sc, M_LO);
 }
 
 static int
@@ -169,16 +152,10 @@
 {
 	INIT_VNET_NET(curvnet);
 	struct ifnet *ifp;
-	struct lo_softc *sc;
 
-	MALLOC(sc, struct lo_softc *, sizeof(*sc), M_LO, M_WAITOK | M_ZERO);
-	ifp = sc->sc_ifp = if_alloc(IFT_LOOP);
-	if (ifp == NULL) {
-		free(sc, M_LO);
+	ifp = if_alloc(IFT_LOOP);
+	if (ifp == NULL)
 		return (ENOSPC);
-	}
-	if (V_loif == NULL)
-		V_loif = ifp;
 
 	if_initname(ifp, ifc->ifc_name, unit);
 	ifp->if_mtu = LOMTU;
@@ -188,11 +165,10 @@
 	ifp->if_snd.ifq_maxlen = ifqmaxlen;
 	ifp->if_capabilities = ifp->if_capenable = IFCAP_HWCSUM;
 	ifp->if_hwassist = LO_CSUM_FEATURES;
-	ifp->if_softc = sc;
 	if_attach(ifp);
 	bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
-	mtx_lock(&lo_mtx);
-	mtx_unlock(&lo_mtx);
+	if (V_loif == NULL)
+		V_loif = ifp;
 
 	return (0);
 }
@@ -218,27 +194,10 @@
 static int vnet_loif_idetach(unused)
 	const void *unused;
 {
-	INIT_VNET_NET(curvnet);
-	struct lo_softc *sc, *nsc;
 
-	LIST_FOREACH_SAFE(sc, &V_lo_list, sc_next, nsc) {
-		struct ifnet *ifp = sc->sc_ifp;
+	/* XXX nothing done here - revisit! */
 
-		if (ifp == V_loif) {
-			/*
-			 * A hack to allow lo0 to be detached:
-			 * bump if_unit number from 0 to 1.  By 
-			 * setting V_loif to NULL we prevent queuing
-			 * of routing messages that would have
-			 * m_pkthdr.rcvif pointing to a nonexisting
-			 * ifnet, i.e. the lo0 we just destroyed.
-			 */
-			ifp->if_dunit = 1;
-			V_loif = NULL;
-		}
-		if_clone_destroy(ifp->if_xname);
-	}
-	return 0;
+	return (0);
 }
 #endif
 
@@ -248,7 +207,6 @@
 
 	switch (type) {
 	case MOD_LOAD:
-		mtx_init(&lo_mtx, "lo_mtx", NULL, MTX_DEF);
 #ifndef VIMAGE_GLOBALS
 		vnet_mod_register(&vnet_loif_modinfo);
 #else

==== //depot/projects/vimage/src/sys/net80211/ieee80211.c#34 (text+ko) ====

@@ -37,7 +37,6 @@
 #include <sys/kernel.h>
 
 #include <sys/socket.h>
-#include <sys/vimage.h>
 
 #include <net/if.h>
 #include <net/if_dl.h>
@@ -249,9 +248,6 @@
 	struct ifaddr *ifa;
 
 	KASSERT(ifp->if_type == IFT_IEEE80211, ("if_type %d", ifp->if_type));
-#ifdef VIMAGE
-	ifp->if_reassign = NULL; /* Override ether_reassign() */
-#endif
 
 	IEEE80211_LOCK_INIT(ic, ifp->if_xname);
 	TAILQ_INIT(&ic->ic_vaps);
@@ -742,30 +738,6 @@
 	IEEE80211_UNLOCK(ic);
 }
 
-#ifdef VIMAGE
-void
-ieee80211_reassign( struct ieee80211vap *vap, struct vnet *vnet, char *dname)
-{
-	struct ifnet *ifp = vap->iv_ifp;
-	u_char eaddr[6];
-
-	bcopy(IF_LLADDR(ifp), eaddr, 6);
-	bpfdetach(ifp);
-	ether_ifdetach(ifp);
-	ifp->if_bpf = NULL;
-	vap->iv_rawbpf = NULL;
-	if_reassign_common(ifp, vnet, ifp->if_dname);
-	if (dname)
-		snprintf(ifp->if_xname, IFNAMSIZ, "%s", dname);
-
-	CURVNET_SET_QUIET(vnet);
-	ether_ifattach(ifp, eaddr);
-	bpfattach2(ifp, DLT_IEEE802_11,
-	    sizeof(struct ieee80211_frame_addr4), &vap->iv_rawbpf);
-	CURVNET_RESTORE();
-}
-#endif
-
 static __inline int
 mapgsm(u_int freq, u_int flags)
 {

==== //depot/projects/vimage/src/sys/netinet/if_ether.c#44 (text+ko) ====

@@ -822,9 +822,9 @@
 #else
 	arp_iattach(NULL);
 #endif
+
 	arpintrq.ifq_maxlen = 50;
 	mtx_init(&arpintrq.ifq_mtx, "arp_inq", NULL, MTX_DEF);
 	netisr_register(NETISR_ARP, arpintr, &arpintrq, 0);
 }
-
 SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0);

==== //depot/projects/vimage/src/sys/netinet/in_var.h#20 (text+ko) ====

@@ -108,15 +108,6 @@
 extern	u_long in_ifaddrhmask;			/* mask for hash table */
 #endif
 
-/*
- * IP datagram reassembly.
- */
-#define IPREASS_NHASH_LOG2	6
-#define IPREASS_NHASH		(1 << IPREASS_NHASH_LOG2)
-#define IPREASS_HMASK		(IPREASS_NHASH - 1)
-#define IPREASS_HASH(x,y) \
-	(((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
-
 #define INADDR_NHASH_LOG2       9
 #define INADDR_NHASH		(1 << INADDR_NHASH_LOG2)
 #define INADDR_HASHVAL(x)	fnv_32_buf((&(x)), sizeof(x), FNV1_32_INIT)

==== //depot/projects/vimage/src/sys/netinet/raw_ip.c#46 (text+ko) ====

@@ -197,7 +197,6 @@
 	    hashinit(1, M_PCB, &V_ripcbinfo.ipi_porthashmask);
 	V_ripcbinfo.ipi_zone = uma_zcreate("ripcb", sizeof(struct inpcb),
 	    NULL, NULL, rip_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
-	V_ripcbinfo.ipi_vnet = curvnet;
 	uma_zone_set_max(V_ripcbinfo.ipi_zone, maxsockets);
 	EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change, NULL,
 	    EVENTHANDLER_PRI_ANY);

==== //depot/projects/vimage/src/sys/netinet/sctp_crc32.c#14 (text+ko) ====

@@ -30,6 +30,7 @@
 
 /* $KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $	 */
 
+
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/sys/netinet/sctp_crc32.c,v 1.17 2009/05/07 16:43:49 rrs Exp $");
 

==== //depot/projects/vimage/src/sys/netinet/tcp_hostcache.c#38 (text+ko) ====

@@ -216,8 +216,6 @@
 
 	/*
 	 * Allocate the hostcache entries.
-	 *
-	 * XXX don't need a separate zone for each hc instance - revisit!!!
 	 */
 	V_tcp_hostcache.zone =
 	    uma_zcreate("hostcache", sizeof(struct hc_metrics),

==== //depot/projects/vimage/src/sys/netinet/tcp_subr.c#84 (text+ko) ====

@@ -290,6 +290,7 @@
 {
 	INIT_VNET_INET(curvnet);
 
+	uma_zone_set_max(V_tcbinfo.ipi_zone, maxsockets);
 	uma_zone_set_max(V_tcpcb_zone, maxsockets);
 	tcp_tw_zone_change();
 }
@@ -345,17 +346,6 @@
 	V_tcp_autosndbuf_inc = 8*1024;
 	V_tcp_autosndbuf_max = 256*1024;
 
-	/*
-	 * These have to be type stable for the benefit of the timers.
-	 */
-	V_tcpcb_zone = uma_zcreate("tcpcb", sizeof(struct tcpcb_mem),
-	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
-	uma_zone_set_max(V_tcpcb_zone, maxsockets);
-	V_sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole),
-	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
-
-	tcp_tw_init();
-
 	V_tcp_do_sack = 1;
 	V_tcp_sack_maxholes = 128;
 	V_tcp_sack_globalmaxholes = 65536;
@@ -367,10 +357,10 @@
 
 	INP_INFO_LOCK_INIT(&V_tcbinfo, "tcp");
 	LIST_INIT(&V_tcb);
-	V_tcbinfo.ipi_listhead = &V_tcb;
 #ifdef VIMAGE
 	V_tcbinfo.ipi_vnet = curvnet;
 #endif
+	V_tcbinfo.ipi_listhead = &V_tcb;
 	hashsize = TCBHASHSIZE;
 	TUNABLE_INT_FETCH("net.inet.tcp.tcbhashsize", &hashsize);
 	if (!powerof2(hashsize)) {
@@ -426,10 +416,6 @@
 		panic("tcp_init");
 #undef TCP_MINPROTOHDR
 
-
-	if (!IS_DEFAULT_VNET(curvnet))
-		return;
-
 	ISN_LOCK_INIT();
 	callout_init(&isn_callout, CALLOUT_MPSAFE);
 	callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL);
@@ -737,10 +723,10 @@
 	if (tm == NULL)
 		return (NULL);
 	tp = &tm->tcb;
-	tp->t_timers = &tm->tt;
 #ifdef VIMAGE
 	tp->t_vnet = inp->inp_vnet;
 #endif
+	tp->t_timers = &tm->tt;
 	/*	LIST_INIT(&tp->t_segq); */	/* XXX covered by M_ZERO */
 	tp->t_maxseg = tp->t_maxopd =
 #ifdef INET6

==== //depot/projects/vimage/src/sys/netinet/tcp_syncache.c#53 (text+ko) ====

@@ -271,7 +271,6 @@
 	}
 
 	/* Create the syncache entry zone. */
-	/* XXX one zone for all vnets should do fine - revisit!!! */
 	V_tcp_syncache.zone = uma_zcreate("syncache", sizeof(struct syncache),
 	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
 	uma_zone_set_max(V_tcp_syncache.zone, V_tcp_syncache.cache_limit);

==== //depot/projects/vimage/src/sys/netinet/tcp_timewait.c#33 (text+ko) ====

@@ -170,8 +170,6 @@
 {
 	INIT_VNET_INET(curvnet);
 
-	TAILQ_INIT(&V_twq_2msl);
-
 	V_tcptw_zone = uma_zcreate("tcptw", sizeof(struct tcptw),
 	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
 	TUNABLE_INT_FETCH("net.inet.tcp.maxtcptw", &maxtcptw);
@@ -179,6 +177,7 @@
 		uma_zone_set_max(V_tcptw_zone, tcptw_auto_size());
 	else
 		uma_zone_set_max(V_tcptw_zone, maxtcptw);
+	TAILQ_INIT(&V_twq_2msl);
 }
 
 #ifdef VIMAGE

==== //depot/projects/vimage/src/sys/netinet/tcp_var.h#34 (text+ko) ====

@@ -541,7 +541,6 @@
 extern	int ss_fltsz;
 extern	int ss_fltsz_local;
 
-extern	int tcp_autorcvbuf;
 extern	int blackhole;
 extern	int drop_synfin;
 extern	int tcp_do_rfc3042;

==== //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#56 (text+ko) ====

@@ -179,9 +179,6 @@
 
 	V_udp_blackhole = 0;
 
-	EVENTHANDLER_REGISTER(maxsockets_change, udp_zone_change, NULL,
-	    EVENTHANDLER_PRI_ANY);
-
 	INP_INFO_LOCK_INIT(&V_udbinfo, "udp");
 	LIST_INIT(&V_udb);
 #ifdef VIMAGE
@@ -194,13 +191,14 @@
 	    &V_udbinfo.ipi_porthashmask);
 	V_udbinfo.ipi_zone = uma_zcreate("udp_inpcb", sizeof(struct inpcb),
 	    NULL, NULL, udp_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
-	V_udbinfo.ipi_vnet = curvnet;
 	uma_zone_set_max(V_udbinfo.ipi_zone, maxsockets);
 
 	V_udpcb_zone = uma_zcreate("udpcb", sizeof(struct udpcb),
 	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
 	uma_zone_set_max(V_udpcb_zone, maxsockets);
 
+	EVENTHANDLER_REGISTER(maxsockets_change, udp_zone_change, NULL,
+	    EVENTHANDLER_PRI_ANY);
 }
 
 int

==== //depot/projects/vimage/src/sys/netinet/vinet.h#59 (text+ko) ====

@@ -313,7 +313,7 @@
 #define	V_reply_src		VNET_INET(reply_src)
 #define	V_ripcb			VNET_INET(ripcb)
 #define	V_ripcbinfo		VNET_INET(ripcbinfo)
-/* #define	V_router_info_head	VNET_INET(router_info_head) */
+#define	V_router_info_head	VNET_INET(router_info_head)
 #define	V_rsvp_on		VNET_INET(rsvp_on)
 #define	V_rtq_minreallyold	VNET_INET(rtq_minreallyold)
 #define	V_rtq_reallyold		VNET_INET(rtq_reallyold)
@@ -370,8 +370,6 @@
 #define	V_tcp_syncookies	VNET_INET(tcp_syncookies)
 #define	V_tcp_syncookiesonly	VNET_INET(tcp_syncookiesonly)
 #define	V_tcp_v6mssdflt		VNET_INET(tcp_v6mssdflt)
-#define	V_tcpcb_zone		VNET_INET(tcpcb_zone)
-#define	V_tcptw_zone		VNET_INET(tcptw_zone)
 #define	V_tcpstat		VNET_INET(tcpstat)
 #define	V_twq_2msl		VNET_INET(twq_2msl)
 #define	V_udb			VNET_INET(udb)

==== //depot/projects/vimage/src/sys/nfsclient/nfs_vnops.c#35 (text+ko) ====

@@ -1520,11 +1520,7 @@
 	if (v3) {
 		tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
 		if (fmode & O_EXCL) {
-#ifdef NFS_LEGACYRPC
-			CURVNET_SET(VFSTONFS(dvp->v_mount)->nm_so->so_vnet);
-#else
-			CURVNET_SET(VFSTONFS(dvp->v_mount)->nm_rpcclnt.rc_so->so_vnet);
-#endif
+			CURVNET_SET(P_TO_VNET(&proc0)); /* XXX revisit! */
 			*tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
 			tl = nfsm_build(u_int32_t *, NFSX_V3CREATEVERF);
 #ifdef INET



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