From owner-p4-projects@FreeBSD.ORG Fri Apr 17 07:29:46 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8F8FC1065672; Fri, 17 Apr 2009 07:29:46 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44632106564A for ; Fri, 17 Apr 2009 07:29:46 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 329B68FC12 for ; Fri, 17 Apr 2009 07:29:46 +0000 (UTC) (envelope-from zec@fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H7Tkh1071811 for ; Fri, 17 Apr 2009 07:29:46 GMT (envelope-from zec@fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3H7Tj18071809 for perforce@freebsd.org; Fri, 17 Apr 2009 07:29:45 GMT (envelope-from zec@fer.hr) Date: Fri, 17 Apr 2009 07:29:45 GMT Message-Id: <200904170729.n3H7Tj18071809@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 160728 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2009 07:29:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=160728 Change 160728 by zec@zec_amdx2 on 2009/04/17 07:29:34 Populate vnet backpointers in various embedded per-vnet structs, which are user to set per-vnet-module base pointers such as INIT_VNET_INET(tp->t_vnet). At this point the vimage-commit2 branch builds, boots and works quite happily both as GENERIC as well as with options VIMAGE. Submitted from: amdx2 8.0-CURRENT /p4/vc2_compile/sys/VIMAGE Affected files ... .. //depot/projects/vimage-commit2/src/sys/netinet/ip_divert.c#25 edit .. //depot/projects/vimage-commit2/src/sys/netinet/raw_ip.c#26 edit .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#47 edit .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_syncache.c#33 edit .. //depot/projects/vimage-commit2/src/sys/netinet/udp_usrreq.c#34 edit Differences ... ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_divert.c#25 (text+ko) ==== @@ -162,6 +162,9 @@ INP_INFO_LOCK_INIT(&V_divcbinfo, "div"); LIST_INIT(&V_divcb); V_divcbinfo.ipi_listhead = &V_divcb; +#ifdef VIMAGE + V_divcbinfo.ipi_vnet = curvnet; +#endif /* * XXX We don't use the hash list for divert IP, but it's easier * to allocate a one entry hash list than it is to check all ==== //depot/projects/vimage-commit2/src/sys/netinet/raw_ip.c#26 (text+ko) ==== @@ -187,6 +187,9 @@ INP_INFO_LOCK_INIT(&V_ripcbinfo, "rip"); LIST_INIT(&V_ripcb); +#ifdef VIMAGE + V_ripcbinfo.ipi_vnet = curvnet; +#endif V_ripcbinfo.ipi_listhead = &V_ripcb; V_ripcbinfo.ipi_hashbase = hashinit(INP_PCBHASH_RAW_SIZE, M_PCB, &V_ripcbinfo.ipi_hashmask); ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#47 (text+ko) ==== @@ -359,6 +359,9 @@ INP_INFO_LOCK_INIT(&V_tcbinfo, "tcp"); LIST_INIT(&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); @@ -703,6 +706,9 @@ if (tm == NULL) return (NULL); tp = &tm->tcb; +#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 = ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_syncache.c#33 (text+ko) ==== @@ -259,6 +259,9 @@ /* Initialize the hash buckets. */ for (i = 0; i < V_tcp_syncache.hashsize; i++) { +#ifdef VIMAGE + V_tcp_syncache.hashbase[i].sch_vnet = curvnet; +#endif TAILQ_INIT(&V_tcp_syncache.hashbase[i].sch_bucket); mtx_init(&V_tcp_syncache.hashbase[i].sch_mtx, "tcp_sc_head", NULL, MTX_DEF); ==== //depot/projects/vimage-commit2/src/sys/netinet/udp_usrreq.c#34 (text+ko) ==== @@ -179,6 +179,9 @@ INP_INFO_LOCK_INIT(&V_udbinfo, "udp"); LIST_INIT(&V_udb); +#ifdef VIMAGE + V_udbinfo.ipi_vnet = curvnet; +#endif V_udbinfo.ipi_listhead = &V_udb; V_udbinfo.ipi_hashbase = hashinit(UDBHASHSIZE, M_PCB, &V_udbinfo.ipi_hashmask);