From owner-freebsd-virtualization@FreeBSD.ORG Tue Nov 18 20:17:41 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1C791065701 for ; Tue, 18 Nov 2008 20:17:41 +0000 (UTC) (envelope-from zec@icir.org) Received: from xaqua.tel.fer.hr (xaqua.tel.fer.hr [161.53.19.25]) by mx1.freebsd.org (Postfix) with ESMTP id B0FB38FC0A for ; Tue, 18 Nov 2008 20:17:41 +0000 (UTC) (envelope-from zec@icir.org) Received: by xaqua.tel.fer.hr (Postfix, from userid 20006) id 44BB19B647; Tue, 18 Nov 2008 21:17:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on xaqua.tel.fer.hr X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_SECURITYSAGE autolearn=no version=3.1.7 Received: from [192.168.200.110] (zec2.tel.fer.hr [161.53.19.79]) by xaqua.tel.fer.hr (Postfix) with ESMTP id 3E7169B646; Tue, 18 Nov 2008 21:17:33 +0100 (CET) From: Marko Zec To: freebsd-virtualization@freebsd.org Date: Tue, 18 Nov 2008 21:16:50 +0100 User-Agent: KMail/1.9.7 References: <491DC5BF.1060004@elischer.org> In-Reply-To: <491DC5BF.1060004@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811182116.50606.zec@icir.org> Cc: Julian Elischer Subject: Re: where are we? X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2008 20:17:42 -0000 On Friday 14 November 2008 19:38:55 Julian Elischer wrote: > I'm just coming up for air.. where are we? > > what's teh next commit? > > Marko, how close is commit2/... to where you want it to get to? I think what's been cooking in commit2 could be now ready to hit head, the diff is here for review: http://imunes.net/virtnet/20081118.diff This change is basically the first half of step #2 per vimage integration plan set here: http://wiki.freebsd.org/Image/Notes200808DevSummit Marko From owner-freebsd-virtualization@FreeBSD.ORG Tue Nov 18 21:33:15 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23C2E1065690 for ; Tue, 18 Nov 2008 21:33:15 +0000 (UTC) (envelope-from zec@icir.org) Received: from xaqua.tel.fer.hr (xaqua.tel.fer.hr [161.53.19.25]) by mx1.freebsd.org (Postfix) with ESMTP id CF1828FC22 for ; Tue, 18 Nov 2008 21:33:14 +0000 (UTC) (envelope-from zec@icir.org) Received: by xaqua.tel.fer.hr (Postfix, from userid 20006) id B759C9B647; Tue, 18 Nov 2008 22:33:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on xaqua.tel.fer.hr X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_SECURITYSAGE autolearn=no version=3.1.7 Received: from [192.168.200.110] (zec2.tel.fer.hr [161.53.19.79]) by xaqua.tel.fer.hr (Postfix) with ESMTP id EF4189B646; Tue, 18 Nov 2008 22:33:12 +0100 (CET) From: Marko Zec To: "Olivier SMEDTS" Date: Tue, 18 Nov 2008 22:33:09 +0100 User-Agent: KMail/1.9.7 References: <491DC5BF.1060004@elischer.org> <200811182116.50606.zec@icir.org> <367b2c980811181327l7c92832dnd5f496a1bb494ae@mail.gmail.com> In-Reply-To: <367b2c980811181327l7c92832dnd5f496a1bb494ae@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811182233.09911.zec@icir.org> Cc: freebsd-virtualization@freebsd.org Subject: Re: where are we? X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2008 21:33:15 -0000 On Tuesday 18 November 2008 22:27:41 Olivier SMEDTS wrote: > 2008/11/18 Marko Zec : > > On Friday 14 November 2008 19:38:55 Julian Elischer wrote: > >> I'm just coming up for air.. where are we? > >> > >> what's teh next commit? > >> > >> Marko, how close is commit2/... to where you want it to get to? > > > > I think what's been cooking in commit2 could be now ready to hit > > head, the diff is here for review: > > http://imunes.net/virtnet/20081118.diff > > The tcp_hostcache.h include is not in the patch, therefore the kernel > can't be built with "options VIMAGE". > make buildkernel fails with : ... > > Is it normal ? Yes this is normal! :) The kernel from svn / head shouldn't be configured with options VIMAGE enabled yet, given that we are still somewhere in the middle of the integration process. You should try out the vimage branch from perforce instead. Marko > Olivier > > > This change is basically the first half of step #2 per vimage > > integration plan set here: > > http://wiki.freebsd.org/Image/Notes200808DevSummit > > > > Marko > > _______________________________________________ > > freebsd-virtualization@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > > To unsubscribe, send any mail to > > "freebsd-virtualization-unsubscribe@freebsd.org" From owner-freebsd-virtualization@FreeBSD.ORG Tue Nov 18 21:41:04 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CD04106564A for ; Tue, 18 Nov 2008 21:41:04 +0000 (UTC) (envelope-from olivier@gid0.org) Received: from mail-gx0-f12.google.com (mail-gx0-f12.google.com [209.85.217.12]) by mx1.freebsd.org (Postfix) with ESMTP id 34B728FC08 for ; Tue, 18 Nov 2008 21:41:04 +0000 (UTC) (envelope-from olivier@gid0.org) Received: by gxk5 with SMTP id 5so406977gxk.19 for ; Tue, 18 Nov 2008 13:41:03 -0800 (PST) Received: by 10.142.173.14 with SMTP id v14mr136687wfe.115.1227043661596; Tue, 18 Nov 2008 13:27:41 -0800 (PST) Received: by 10.142.179.14 with HTTP; Tue, 18 Nov 2008 13:27:41 -0800 (PST) Message-ID: <367b2c980811181327l7c92832dnd5f496a1bb494ae@mail.gmail.com> Date: Tue, 18 Nov 2008 22:27:41 +0100 From: "Olivier SMEDTS" To: "Marko Zec" In-Reply-To: <200811182116.50606.zec@icir.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <491DC5BF.1060004@elischer.org> <200811182116.50606.zec@icir.org> Cc: freebsd-virtualization@freebsd.org Subject: Re: where are we? X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2008 21:41:04 -0000 2008/11/18 Marko Zec : > On Friday 14 November 2008 19:38:55 Julian Elischer wrote: >> I'm just coming up for air.. where are we? >> >> what's teh next commit? >> >> Marko, how close is commit2/... to where you want it to get to? > > I think what's been cooking in commit2 could be now ready to hit head, > the diff is here for review: http://imunes.net/virtnet/20081118.diff The tcp_hostcache.h include is not in the patch, therefore the kernel can't be built with "options VIMAGE". make buildkernel fails with : In file included from /work/src/sys/modules/dtrace/dtrace/../../../netinet/vinet.h:45, from /work/src/sys/modules/dtrace/dtrace/../../../netinet/in.h:747, from @/amd64/amd64/genassym.c:61: /work/src/sys/modules/dtrace/dtrace/../../../netinet/ip_var.h: In function 'ip_newid': /work/src/sys/modules/dtrace/dtrace/../../../netinet/ip_var.h:243: error: 'V_ip_do_randomid' undeclared (first use in this function) /work/src/sys/modules/dtrace/dtrace/../../../netinet/ip_var.h:243: error: (Each undeclared identifier is reported only once /work/src/sys/modules/dtrace/dtrace/../../../netinet/ip_var.h:243: error: for each function it appears in.) /work/src/sys/modules/dtrace/dtrace/../../../netinet/ip_var.h:246: error: 'V_ip_id' undeclared (first use in this function) In file included from /work/src/sys/modules/dtrace/dtrace/../../../netinet/in.h:747, from @/amd64/amd64/genassym.c:61: /work/src/sys/modules/dtrace/dtrace/../../../netinet/vinet.h:52:35: error: netinet/tcp_hostcache.h: No such file or directory In file included from /work/src/sys/modules/dtrace/dtrace/../../../netinet/in.h:747, from @/amd64/amd64/genassym.c:61: /work/src/sys/modules/dtrace/dtrace/../../../netinet/vinet.h: At top level: /work/src/sys/modules/dtrace/dtrace/../../../netinet/vinet.h:90: error: field '_tcp_hostcache' has incomplete type *** Error code 1 Is it normal ? Olivier > > This change is basically the first half of step #2 per vimage > integration plan set here: > http://wiki.freebsd.org/Image/Notes200808DevSummit > > Marko > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org" > -- Olivier Smedts _ ASCII ribbon campaign ( ) e-mail: olivier@gid0.org - against HTML email & vCards X www: http://www.gid0.org - against proprietary attachments / \ "Il y a seulement 10 sortes de gens dans le monde : ceux qui comprennent le binaire, et ceux qui ne le comprennent pas." From owner-freebsd-virtualization@FreeBSD.ORG Wed Nov 19 11:31:31 2008 Return-Path: Delivered-To: virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59EEF106567D; Wed, 19 Nov 2008 11:31:31 +0000 (UTC) (envelope-from zec@icir.org) Received: from xaqua.tel.fer.hr (xaqua.tel.fer.hr [161.53.19.25]) by mx1.freebsd.org (Postfix) with ESMTP id 3A1B08FC13; Wed, 19 Nov 2008 11:31:30 +0000 (UTC) (envelope-from zec@icir.org) Received: by xaqua.tel.fer.hr (Postfix, from userid 20006) id 13D2F9B649; Wed, 19 Nov 2008 12:03:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on xaqua.tel.fer.hr X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_SECURITYSAGE autolearn=no version=3.1.7 Received: from [192.168.200.110] (zec2.tel.fer.hr [161.53.19.79]) by xaqua.tel.fer.hr (Postfix) with ESMTP id CD4049B646; Wed, 19 Nov 2008 12:03:13 +0100 (CET) From: Marko Zec To: current@freebsd.org, virtualization@freebsd.org Date: Wed, 19 Nov 2008 12:02:54 +0100 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200811191202.54465.zec@icir.org> Cc: Subject: HEADS UP: initialization of kernel global variables (Fwd: svn commit: r185088) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2008 11:31:31 -0000 As a part of an effort to merge network stack virtualization=20 infrastructure (also known as project virtnet / vimage) to head,=20 initialization of global kernel variables which are scheduled to become=20 virtualized should now adhere to a simple yet important new rule.=20 Initialization of such variables should no longer be performed at=20 instatiation point, but instead assignments of initial values should be=20 done in initializer functions. This should have zero functional impact=20 to existing code, but will allow us to switch between using global=20 variables and their counterparts residing in virtualization containers=20 with minimum code churn, and in the long run allow us to intialize=20 multiple instances of such container structures. Note that this change applies only to global variables related to the=20 network stack, and only to the subset of those that have been selected=20 for virtualization as in sys/net/vnet.h, sys/netinet/vinet.h,=20 sys/netinet6/vinet6.h, sys/netipsec/vipsec.h etc. No other subsystems=20 will be affected at this point in time.=A0A MFC of this change to=20 stable/7 or older branches is not planned. Cheers, Marko =2D--------- Forwarded Message ---------- Subject: svn commit: r185088 - in head/sys: dev/cxgb/ulp/tom net netinet=20 netinet6 netipsec sys Date: Wednesday 19 November 2008 =46rom: Marko Zec To: src-committers@freebsd.org, svn-src-all@freebsd.org,=20 svn-src-head@freebsd.org Author: zec Date: Wed Nov 19 09:39:34 2008 New Revision: 185088 URL: http://svn.freebsd.org/changeset/base/185088 Log: Change the initialization methodology for global variables scheduled for virtualization. =20 Instead of initializing the affected global variables at instatiation, assign initial values to them in initializer functions. As a rule, initialization at instatiation for such variables should never be introduced again from now on. Furthermore, enclose all instantiations of such global variables in #ifdef VIMAGE_GLOBALS blocks. =20 Essentialy, this change should have zero functional impact. In the=20 next phase of merging network stack virtualization infrastructure from p4/vimage branch, the new initialization methology will allow us to switch between using global variables and their counterparts residing=20 in virtualization containers with minimum code churn, and in the long run allow us to intialize multiple instances of such container structures. =20 Discussed at: devsummit Strassburg Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/net/if.c head/sys/net/if_ethersubr.c head/sys/net/if_gif.c head/sys/net/if_loop.c head/sys/net/raw_cb.c head/sys/net/route.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_gif.c head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/in_proto.c head/sys/netinet/in_rmx.c head/sys/netinet/in_var.h head/sys/netinet/ip_divert.c head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_icmp.h head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_var.h head/sys/netinet/udp_usrreq.c head/sys/netinet/vinet.h head/sys/netinet6/frag6.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/scope6.c head/sys/netinet6/vinet6.h head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/key.c head/sys/netipsec/keysock.c head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netipsec/xform_ipcomp.c head/sys/netipsec/xform_ipip.c head/sys/sys/vimage.h Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Nov 19 08:56:35 2008=09 (r185087) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Nov 19 09:39:34 2008=09 (r185088) @@ -154,11 +154,6 @@ static unsigned int mbuf_wrs[TX_MAX_SEGS #define TCP_CLOSE 2 #define TCP_DROP 3 =20 =2Dextern int tcp_do_autorcvbuf; =2Dextern int tcp_do_autosndbuf; =2Dextern int tcp_autorcvbuf_max; =2Dextern int tcp_autosndbuf_max; =2D static void t3_send_reset(struct toepcb *toep); static void send_abort_rpl(struct mbuf *m, struct toedev *tdev, int=20 rst_status); static inline void free_atid(struct t3cdev *cdev, unsigned int tid); Modified: head/sys/net/if.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/net/if.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/net/if.c Wed Nov 19 09:39:34 2008 (r185088) @@ -134,22 +134,21 @@ static int if_getgroupmembers(struct ifg extern void nd6_setmtu(struct ifnet *); #endif =20 =2Dint if_index =3D 0; =2Dint ifqmaxlen =3D IFQ_MAXLEN; +#ifdef VIMAGE_GLOBALS struct ifnethead ifnet; /* depend on static init XXX */ struct ifgrouphead ifg_head; +int if_index; +static int if_indexlim; +/* Table of ifnet/cdev by index. Locked with ifnet_lock. */ +static struct ifindex_entry *ifindex_table; +static struct knlist ifklist; +#endif + +int ifqmaxlen =3D IFQ_MAXLEN; struct mtx ifnet_lock; static if_com_alloc_t *if_com_alloc[256]; static if_com_free_t *if_com_free[256]; =20 =2Dstatic int if_indexlim =3D 8; =2Dstatic struct knlist ifklist; =2D =2D/* =2D * Table of ifnet/cdev by index. Locked with ifnet_lock. =2D */ =2Dstatic struct ifindex_entry *ifindex_table =3D NULL; =2D static void filt_netdetach(struct knote *kn); static int filt_netdev(struct knote *kn, long hint); =20 @@ -357,6 +356,10 @@ if_init(void *dummy __unused) { INIT_VNET_NET(curvnet); =20 + V_if_index =3D 0; + V_ifindex_table =3D NULL; + V_if_indexlim =3D 8; + IFNET_LOCK_INIT(); TAILQ_INIT(&V_ifnet); TAILQ_INIT(&V_ifg_head); Modified: head/sys/net/if_ethersubr.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/net/if_ethersubr.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/net/if_ethersubr.c Wed Nov 19 09:39:34 2008 (r185088) @@ -142,8 +142,10 @@ MALLOC_DEFINE(M_ARPCOM, "arpcom", "802.* int ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, struct ip_fw **rule, int shared); +#ifdef VIMAGE_GLOBALS static int ether_ipfw; #endif +#endif =20 /* * Ethernet output routine. Modified: head/sys/net/if_gif.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/net/if_gif.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/net/if_gif.c Wed Nov 19 09:39:34 2008 (r185088) @@ -94,7 +94,18 @@ */ static struct mtx gif_mtx; static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); + +#ifdef VIMAGE_GLOBALS static LIST_HEAD(, gif_softc) gif_softc_list; +static int max_gif_nesting; +static int parallel_tunnels; +#ifdef INET +int ip_gif_ttl; +#endif +#ifdef INET6 +int ip6_gif_hlim; +#endif +#endif =20 void (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af); void (*ng_gif_input_orphan_p)(struct ifnet *ifp, struct mbuf *m, int=20 af); @@ -123,9 +134,6 @@ SYSCTL_NODE(_net_link, IFT_GIF, gif, CTL */ #define MAX_GIF_NEST 1 #endif =2D#ifndef VIMAGE =2Dstatic int max_gif_nesting =3D MAX_GIF_NEST; =2D#endif SYSCTL_V_INT(V_NET, vnet_gif, _net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW, max_gif_nesting, 0, "Max nested tunnels"); =20 @@ -140,11 +148,6 @@ SYSCTL_V_INT(V_NET, vnet_gif, _net_inet6 * pair of addresses. Some applications require this functionality so * we allow control over this check here. */ =2D#ifdef XBONEHACK =2Dstatic int parallel_tunnels =3D 1; =2D#else =2Dstatic int parallel_tunnels =3D 0; =2D#endif SYSCTL_V_INT(V_NET, vnet_gif, _net_link_gif, OID_AUTO,=20 parallel_tunnels, CTLFLAG_RW, parallel_tunnels, 0, "Allow parallel tunnels?"); =20 @@ -251,12 +254,21 @@ gifmodevent(mod, type, data) switch (type) { case MOD_LOAD: mtx_init(&gif_mtx, "gif_mtx", NULL, MTX_DEF); =2D LIST_INIT(&V_gif_softc_list); =2D if_clone_attach(&gif_cloner); =20 + LIST_INIT(&V_gif_softc_list); + V_max_gif_nesting =3D MAX_GIF_NEST; +#ifdef XBONEHACK + V_parallel_tunnels =3D 1; +#else + V_parallel_tunnels =3D 0; +#endif +#ifdef INET + V_ip_gif_ttl =3D GIF_TTL; +#endif #ifdef INET6 V_ip6_gif_hlim =3D GIF_HLIM; #endif + if_clone_attach(&gif_cloner); =20 break; case MOD_UNLOAD: Modified: head/sys/net/if_loop.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/net/if_loop.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/net/if_loop.c Wed Nov 19 09:39:34 2008 (r185088) @@ -96,7 +96,9 @@ int looutput(struct ifnet *ifp, struct=20 static int lo_clone_create(struct if_clone *, int, caddr_t); static void lo_clone_destroy(struct ifnet *); =20 =2Dstruct ifnet *loif =3D NULL; /* Used externally */ +#ifdef VIMAGE_GLOBALS +struct ifnet *loif; /* Used externally */ +#endif =20 IFC_SIMPLE_DECLARE(lo, 1); =20 @@ -142,6 +144,7 @@ loop_modevent(module_t mod, int type, vo =20 switch (type) { case MOD_LOAD: + V_loif =3D NULL; if_clone_attach(&lo_cloner); break; =20 Modified: head/sys/net/raw_cb.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/net/raw_cb.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/net/raw_cb.c Wed Nov 19 09:39:34 2008 (r185088) @@ -57,7 +57,9 @@ */ =20 struct mtx rawcb_mtx; +#ifdef VIMAGE_GLOBALS struct rawcb_list_head rawcb_list; +#endif =20 SYSCTL_NODE(_net, OID_AUTO, raw, CTLFLAG_RW, 0, "Raw socket=20 infrastructure"); =20 Modified: head/sys/net/route.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/net/route.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/net/route.c Wed Nov 19 09:39:34 2008 (r185088) @@ -84,6 +84,7 @@ SYSCTL_INT(_net, OID_AUTO, add_addr_allf &rt_add_addr_allfibs, 0, ""); TUNABLE_INT("net.add_addr_allfibs", &rt_add_addr_allfibs); =20 +#ifdef VIMAGE_GLOBALS static struct rtstat rtstat; =20 /* by default only the first 'row' of tables will be accessed. */ @@ -96,6 +97,7 @@ static struct rtstat rtstat; struct radix_node_head *rt_tables[RT_MAXFIBS][AF_MAX+1]; =20 static int rttrash; /* routes not in table but not freed */ +#endif =20 static void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); Modified: head/sys/netinet/if_ether.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/if_ether.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/if_ether.c Wed Nov 19 09:39:34 2008 (r185088) @@ -82,7 +82,12 @@ SYSCTL_DECL(_net_link_ether); SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, ""); =20 /* timer values */ =2Dstatic int arpt_keep =3D (20*60); /* once resolved, good for 20 more=20 minutes */ +#ifdef VIMAGE_GLOBALS +static int arpt_keep; /* once resolved, good for 20 more minutes */ +static int arp_maxtries; +static int useloopback; /* use loopback interface for local traffic */ +static int arp_proxyall; +#endif =20 SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW,=20 &arpt_keep, 0, "ARP entry lifetime in seconds"); @@ -99,10 +104,6 @@ struct llinfo_arp { =20 static struct ifqueue arpintrq; =20 =2Dstatic int arp_maxtries =3D 5; =2Dstatic int useloopback =3D 1; /* use loopback interface for local traffi= c=20 */ =2Dstatic int arp_proxyall =3D 0; =2D SYSCTL_V_INT(V_NET, vnet_inet, _net_link_ether_inet, OID_AUTO,=20 maxtries, CTLFLAG_RW, arp_maxtries, 0, "ARP resolution attempts before returning error"); @@ -1076,6 +1077,12 @@ arp_ifinit2(struct ifnet *ifp, struct if static void arp_init(void) { + INIT_VNET_INET(curvnet); + + V_arpt_keep =3D (20*60); /* once resolved, good for 20 more minutes */ + V_arp_maxtries =3D 5; + V_useloopback =3D 1; /* use loopback interface for local traffic */ + V_arp_proxyall =3D 0; =20 arpintrq.ifq_maxlen =3D 50; mtx_init(&arpintrq.ifq_mtx, "arp_inq", NULL, MTX_DEF); Modified: head/sys/netinet/igmp.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/igmp.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/igmp.c Wed Nov 19 09:39:34 2008 (r185088) @@ -80,7 +80,9 @@ static MALLOC_DEFINE(M_IGMP, "igmp", "ig static struct router_info *find_rti(struct ifnet *ifp); static void igmp_sendpkt(struct in_multi *, int, unsigned long); =20 +#ifdef VIMAGE_GLOBALS static struct igmpstat igmpstat; +#endif =20 SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RW, igmpstat, igmpstat, ""); @@ -92,8 +94,10 @@ SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_i * reference counting is used. We allow unlocked reads of router_info=20 data * when accessed via an in_multi read-only. */ =2Dstatic struct mtx igmp_mtx; +#ifdef VIMAGE_GLOBALS static SLIST_HEAD(, router_info) router_info_head; +#endif +static struct mtx igmp_mtx; static int igmp_timers_are_running; =20 /* Modified: head/sys/netinet/in.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/in.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/in.c Wed Nov 19 09:39:34 2008 (r185088) @@ -66,18 +66,20 @@ static int in_ifinit(struct ifnet *, struct in_ifaddr *, struct sockaddr_in *, int); static void in_purgemaddrs(struct ifnet *); =20 =2Dstatic int subnetsarelocal =3D 0; +#ifdef VIMAGE_GLOBALS +static int subnetsarelocal; +static int sameprefixcarponly; +extern struct inpcbinfo ripcbinfo; +extern struct inpcbinfo udbinfo; +#endif + SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO,=20 subnets_are_local, CTLFLAG_RW, subnetsarelocal, 0, "Treat all subnets as directly connected"); =2Dstatic int sameprefixcarponly =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO,=20 same_prefix_carp_only, CTLFLAG_RW, sameprefixcarponly, 0, "Refuse to create same prefixes on different interfaces"); =20 =2Dextern struct inpcbinfo ripcbinfo; =2Dextern struct inpcbinfo udbinfo; =2D /* * Return 1 if an internet address is for a ``local'' host * (one to which we have a connection). If subnetsarelocal Modified: head/sys/netinet/in_gif.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/in_gif.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/in_gif.c Wed Nov 19 09:39:34 2008 (r185088) @@ -85,7 +85,9 @@ struct protosw in_gif_protosw =3D { .pr_usrreqs =3D &rip_usrreqs }; =20 =2Dstatic int ip_gif_ttl =3D GIF_TTL; +#ifdef VIMAGE_GLOBALS +extern int ip_gif_ttl; +#endif SYSCTL_V_INT(V_NET, vnet_gif, _net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW, ip_gif_ttl, 0, ""); =20 Modified: head/sys/netinet/in_mcast.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/in_mcast.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/in_mcast.c Wed Nov 19 09:39:34 2008 (r185088) @@ -86,7 +86,9 @@ static MALLOC_DEFINE(M_IPMSOURCE, "in_ms * ip_output() to send IGMP packets while holding the lock; this=20 probably is * not quite desirable. */ +#ifdef VIMAGE_GLOBALS struct in_multihead in_multihead; /* XXX BSS initialization */ +#endif struct mtx in_multi_mtx; MTX_SYSINIT(in_multi_mtx, &in_multi_mtx, "in_multi_mtx", MTX_DEF |=20 MTX_RECURSE); =20 Modified: head/sys/netinet/in_pcb.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/in_pcb.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/in_pcb.c Wed Nov 19 09:39:34 2008 (r185088) @@ -84,32 +84,34 @@ __FBSDID("$FreeBSD$"); =20 #include =20 +#ifdef VIMAGE_GLOBALS /* * These configure the range of local port addresses assigned to * "unspecified" outgoing connections/packets/whatever. */ =2Dint ipport_lowfirstauto =3D IPPORT_RESERVED - 1; /* 1023 */ =2Dint ipport_lowlastauto =3D IPPORT_RESERVEDSTART; /* 600 */ =2Dint ipport_firstauto =3D IPPORT_EPHEMERALFIRST; /* 10000 */ =2Dint ipport_lastauto =3D IPPORT_EPHEMERALLAST; /* 65535 */ =2Dint ipport_hifirstauto =3D IPPORT_HIFIRSTAUTO; /* 49152 */ =2Dint ipport_hilastauto =3D IPPORT_HILASTAUTO; /* 65535 */ +int ipport_lowfirstauto; +int ipport_lowlastauto; +int ipport_firstauto; +int ipport_lastauto; +int ipport_hifirstauto; +int ipport_hilastauto; =20 /* * Reserved ports accessible only to root. There are significant * security considerations that must be accounted for when changing=20 these, * but the security benefits can be great. Please be careful. */ =2Dint ipport_reservedhigh =3D IPPORT_RESERVED - 1; /* 1023 */ =2Dint ipport_reservedlow =3D 0; +int ipport_reservedhigh; +int ipport_reservedlow; =20 /* Variables dealing with random ephemeral port allocation. */ =2Dint ipport_randomized =3D 1; /* user controlled via sysctl */ =2Dint ipport_randomcps =3D 10; /* user controlled via sysctl */ =2Dint ipport_randomtime =3D 45; /* user controlled via sysctl */ =2Dint ipport_stoprandom =3D 0; /* toggled by ipport_tick */ +int ipport_randomized; +int ipport_randomcps; +int ipport_randomtime; +int ipport_stoprandom; int ipport_tcpallocs; int ipport_tcplastcount; +#endif =20 #define RANGECHK(var, min, max) \ if ((var) < (min)) { (var) =3D (min); } \ Modified: head/sys/netinet/in_pcb.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/in_pcb.h Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/in_pcb.h Wed Nov 19 09:39:34 2008 (r185088) @@ -450,6 +450,8 @@ extern int ipport_lastauto; extern int ipport_hifirstauto; extern int ipport_hilastauto; extern int ipport_randomized; +extern int ipport_randomcps; +extern int ipport_randomtime; extern int ipport_stoprandom; extern int ipport_tcpallocs; extern struct callout ipport_tick_callout; Modified: head/sys/netinet/in_proto.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/in_proto.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/in_proto.c Wed Nov 19 09:39:34 2008 (r185088) @@ -193,6 +193,7 @@ struct protosw inetsw[] =3D { .pr_flags =3D PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input =3D icmp_input, .pr_ctloutput =3D rip_ctloutput, + .pr_init =3D icmp_init, .pr_usrreqs =3D &rip_usrreqs }, { Modified: head/sys/netinet/in_rmx.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/in_rmx.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/in_rmx.c Wed Nov 19 09:39:34 2008 (r185088) @@ -151,17 +151,20 @@ in_matroute(void *v_arg, struct radix_no return rn; } =20 =2Dstatic int rtq_reallyold =3D 60*60; /* one hour is "really old" */ +#ifdef VIMAGE_GLOBALS +static int rtq_reallyold; +static int rtq_minreallyold; +static int rtq_toomany; +#endif + SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, IPCTL_RTEXPIRE, rtexpire, CTLFLAG_RW, rtq_reallyold, 0, "Default expiration time on dynamically learned routes"); =20 =2Dstatic int rtq_minreallyold =3D 10; /* never automatically crank down t= o=20 less */ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, rtq_minreallyold, 0, "Minimum time to attempt to hold onto dynamically learned routes"); =20 =2Dstatic int rtq_toomany =3D 128; /* 128 cached routes is "too many" */ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_RW, rtq_toomany, 0, "Upper limit on dynamically learned routes"); @@ -256,8 +259,10 @@ in_rtqkill(struct radix_node *rn, void * } =20 #define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */ =2Dstatic int rtq_timeout =3D RTQ_TIMEOUT; +#ifdef VIMAGE_GLOBALS +static int rtq_timeout; static struct callout rtq_timer; +#endif =20 static void in_rtqtimo_one(void *rock); =20 @@ -376,6 +381,11 @@ in_inithead(void **head, int off) if (off =3D=3D 0) /* XXX MRT see above */ return 1; /* only do the rest for a real routing table */ =20 + V_rtq_reallyold =3D 60*60; /* one hour is "really old" */ + V_rtq_minreallyold =3D 10; /* never automatically crank down to less */ + V_rtq_toomany =3D 128; /* 128 cached routes is "too many" */ + V_rtq_timeout =3D RTQ_TIMEOUT; + rnh =3D *head; rnh->rnh_addaddr =3D in_addroute; rnh->rnh_matchaddr =3D in_matroute; Modified: head/sys/netinet/in_var.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/in_var.h Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/in_var.h Wed Nov 19 09:39:34 2008 (r185088) @@ -138,6 +138,15 @@ do { \ #endif =20 /* + * 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) + +/* * This information should be part of the ifnet structure but we don't=20 wish * to change that - as it might break a number of things */ Modified: head/sys/netinet/ip_divert.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/ip_divert.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/ip_divert.c Wed Nov 19 09:39:34 2008 (r185088) @@ -112,8 +112,10 @@ __FBSDID("$FreeBSD$"); */ =20 /* Internal variables. */ +#ifdef VIMAGE_GLOBALS static struct inpcbhead divcb; static struct inpcbinfo divcbinfo; +#endif =20 static u_long div_sendspace =3D DIVSNDQ; /* XXX sysctl ? */ static u_long div_recvspace =3D DIVRCVQ; /* XXX sysctl ? */ Modified: head/sys/netinet/ip_fastfwd.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/ip_fastfwd.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/ip_fastfwd.c Wed Nov 19 09:39:34 2008 (r185088) @@ -106,7 +106,9 @@ __FBSDID("$FreeBSD$"); =20 #include =20 =2Dstatic int ipfastforward_active =3D 0; +#ifdef VIMAGE_GLOBALS +static int ipfastforward_active; +#endif SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_RW, ipfastforward_active, 0, "Enable fast IP forwarding"); =20 Modified: head/sys/netinet/ip_icmp.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/ip_icmp.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/ip_icmp.c Wed Nov 19 09:39:34 2008 (r185088) @@ -77,47 +77,51 @@ __FBSDID("$FreeBSD$"); * host table maintenance routines. */ =20 =2Dstruct icmpstat icmpstat; +#ifdef VIMAGE_GLOBALS +struct icmpstat icmpstat; +static int icmpmaskrepl; +static u_int icmpmaskfake; +static int drop_redirect; +static int log_redirect; +static int icmplim; +static int icmplim_output; +static char reply_src[IFNAMSIZ]; +static int icmp_rfi; +static int icmp_quotelen; +static int icmpbmcastecho; +#endif + SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RW, icmpstat, icmpstat, ""); =20 =2Dstatic int icmpmaskrepl =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, ICMPCTL_MASKREPL,=20 maskrepl, CTLFLAG_RW, icmpmaskrepl, 0, "Reply to ICMP Address Mask Request packets."); =20 =2Dstatic u_int icmpmaskfake =3D 0; SYSCTL_V_UINT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, maskfake,=20 CTLFLAG_RW, icmpmaskfake, 0, "Fake reply to ICMP Address Mask Request packets."); =20 =2Dstatic int drop_redirect =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_RW, drop_redirect, 0, "Ignore ICMP redirects"); =20 =2Dstatic int log_redirect =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_RW, log_redirect, 0, "Log ICMP redirects to the console"); =20 =2Dstatic int icmplim =3D 200; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, ICMPCTL_ICMPLIM,=20 icmplim, CTLFLAG_RW, icmplim, 0, "Maximum number of ICMP responses per=20 second"); =20 =2Dstatic int icmplim_output =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO,=20 icmplim_output, CTLFLAG_RW, icmplim_output, 0, "Enable rate limiting of ICMP responses"); =20 =2Dstatic char reply_src[IFNAMSIZ]; SYSCTL_V_STRING(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_RW, reply_src, IFNAMSIZ, "icmp reply source for non-local packets."); =20 =2Dstatic int icmp_rfi =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO,=20 reply_from_interface, CTLFLAG_RW, icmp_rfi, 0, "ICMP reply from incoming interface for " "non-local packets"); =20 =2Dstatic int icmp_quotelen =3D 8; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, quotelen,=20 CTLFLAG_RW, icmp_quotelen, 0, "Number of bytes from original packet to " "quote in ICMP reply"); @@ -126,7 +130,6 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet * ICMP broadcast echo sysctl */ =20 =2Dstatic int icmpbmcastecho =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, icmpbmcastecho, 0, ""); =20 @@ -140,6 +143,22 @@ static void icmp_send(struct mbuf *, str =20 extern struct protosw inetsw[]; =20 +void +icmp_init(void) +{ + INIT_VNET_INET(curvnet); + + V_icmpmaskrepl =3D 0; + V_icmpmaskfake =3D 0; + V_drop_redirect =3D 0; + V_log_redirect =3D 0; + V_icmplim =3D 200; + V_icmplim_output =3D 1; + V_icmp_rfi =3D 0; + V_icmp_quotelen =3D 8; + V_icmpbmcastecho =3D 0; +} + /* * Generate an error packet of type error * in response to bad packet ip. Modified: head/sys/netinet/ip_icmp.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/ip_icmp.h Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/ip_icmp.h Wed Nov 19 09:39:34 2008 (r185088) @@ -204,6 +204,7 @@ struct icmp { #ifdef _KERNEL void icmp_error(struct mbuf *, int, int, n_long, int); void icmp_input(struct mbuf *, int); +void icmp_init(void); int ip_next_mtu(int, int); #endif =20 Modified: head/sys/netinet/ip_input.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/ip_input.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/ip_input.c Wed Nov 19 09:39:34 2008 (r185088) @@ -89,33 +89,47 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct ip) =3D=3D 20); #endif =20 =2Dint rsvp_on =3D 0; +#ifdef VIMAGE_GLOBALS +static int ipsendredirects; +static int ip_checkinterface; +static int ip_keepfaith; +static int ip_sendsourcequench; +int ip_defttl; +int ip_do_randomid; +int ipforwarding; +struct in_ifaddrhead in_ifaddrhead; /* first inet address */ +struct in_ifaddrhashhead *in_ifaddrhashtbl; /* inet addr hash table */ +u_long in_ifaddrhmask; /* mask for hash table */ +struct ipstat ipstat; +static int ip_rsvp_on; +struct socket *ip_rsvpd; +int rsvp_on; +static TAILQ_HEAD(ipqhead, ipq) ipq[IPREASS_NHASH]; +static int maxnipq; /* Administrative limit on # reass queues. */ +static int maxfragsperpacket; +int ipstealth; +static int nipq; /* Total # of reass queues */ +#endif =20 =2Dint ipforwarding =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW, ipforwarding, 0, "Enable IP forwarding between interfaces"); =20 =2Dstatic int ipsendredirects =3D 1; /* XXX */ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW, ipsendredirects, 0, "Enable sending IP redirects"); =20 =2Dint ip_defttl =3D IPDEFTTL; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW, ip_defttl, 0, "Maximum TTL on IP packets"); =20 =2Dstatic int ip_keepfaith =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, IPCTL_KEEPFAITH, keepfaith, CTLFLAG_RW, ip_keepfaith, 0, "Enable packet capture for FAITH IPv4->IPv6 translater daemon"); =20 =2Dstatic int ip_sendsourcequench =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_RW, ip_sendsourcequench, 0, "Enable the transmission of source quench packets"); =20 =2Dint ip_do_randomid =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, random_id, CTLFLAG_RW, ip_do_randomid, 0, "Assign random ip_id values"); =20 @@ -132,7 +146,6 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet * to the loopback interface instead of the interface where the * packets for those addresses are received. */ =2Dstatic int ip_checkinterface =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, check_interface, CTLFLAG_RW, ip_checkinterface, 0, "Verify packet arrives on correct interface"); @@ -145,9 +158,6 @@ static int ipqmaxlen =3D IFQ_MAXLEN; extern struct domain inetdomain; extern struct protosw inetsw[]; u_char ip_protox[IPPROTO_MAX]; =2Dstruct in_ifaddrhead in_ifaddrhead; /* first inet address */ =2Dstruct in_ifaddrhashhead *in_ifaddrhashtbl; /* inet addr hash table */ =2Du_long in_ifaddrhmask; /* mask for hash table */ =20 SYSCTL_INT(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_queue_maxlen,=20 CTLFLAG_RW, &ipintrq.ifq_maxlen, 0, "Maximum size of the IP input queue"); @@ -155,21 +165,10 @@ SYSCTL_INT(_net_inet_ip, IPCTL_INTRQDROP &ipintrq.ifq_drops, 0, "Number of packets dropped from the IP input queue"); =20 =2Dstruct ipstat ipstat; SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_ip, IPCTL_STATS, stats,=20 CTLFLAG_RW, ipstat, ipstat, "IP statistics (struct ipstat, netinet/ip_var.h)"); =20 =2D/* =2D * IP datagram reassembly. =2D */ =2D#define IPREASS_NHASH_LOG2 6 =2D#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2) =2D#define IPREASS_HMASK (IPREASS_NHASH - 1) =2D#define IPREASS_HASH(x,y) \ =2D (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK) =2D static uma_zone_t ipq_zone; =2Dstatic TAILQ_HEAD(ipqhead, ipq) ipq[IPREASS_NHASH]; static struct mtx ipqlock; =20 #define IPQ_LOCK() mtx_lock(&ipqlock) @@ -180,13 +179,10 @@ static struct mtx ipqlock; static void maxnipq_update(void); static void ipq_zone_change(void *); =20 =2Dstatic int maxnipq; /* Administrative limit on # reass queues. */ =2Dstatic int nipq =3D 0; /* Total # of reass queues */ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_RD, nipq, 0, "Current number of IPv4 fragment reassembly queue entries"); =20 =2Dstatic int maxfragsperpacket; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO,=20 maxfragsperpacket, CTLFLAG_RW, maxfragsperpacket, 0, "Maximum number of IPv4 fragments allowed per packet"); @@ -199,7 +195,6 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, m #endif =20 #ifdef IPSTEALTH =2Dint ipstealth =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, stealth,=20 CTLFLAG_RW, ipstealth, 0, "IP stealth mode, no TTL decrementation on=20 forwarding"); #endif @@ -225,6 +220,37 @@ ip_init(void) struct protosw *pr; int i; =20 + V_ipsendredirects =3D 1; /* XXX */ + V_ip_checkinterface =3D 0; + V_ip_keepfaith =3D 0; + V_ip_sendsourcequench =3D 0; + V_rsvp_on =3D 0; + V_ip_defttl =3D IPDEFTTL; + V_ip_do_randomid =3D 0; + V_ipforwarding =3D 0; + V_ipstealth =3D 0; + V_nipq =3D 0; /* Total # of reass queues */ + + V_ipport_lowfirstauto =3D IPPORT_RESERVED - 1; /* 1023 */ + V_ipport_lowlastauto =3D IPPORT_RESERVEDSTART; /* 600 */ + V_ipport_firstauto =3D IPPORT_EPHEMERALFIRST; /* 10000 */ + V_ipport_lastauto =3D IPPORT_EPHEMERALLAST; /* 65535 */ + V_ipport_hifirstauto =3D IPPORT_HIFIRSTAUTO; /* 49152 */ + V_ipport_hilastauto =3D IPPORT_HILASTAUTO; /* 65535 */ + V_ipport_reservedhigh =3D IPPORT_RESERVED - 1; /* 1023 */ + V_ipport_reservedlow =3D 0; + V_ipport_randomized =3D 1; /* user controlled via sysctl */ + V_ipport_randomcps =3D 10; /* user controlled via sysctl */ + V_ipport_randomtime =3D 45; /* user controlled via sysctl */ + V_ipport_stoprandom =3D 0; /* toggled by ipport_tick */ + +#ifdef NOTYET + /* XXX global static but not instantiated in this file */ + V_ipfastforward_active =3D 0; + V_subnetsarelocal =3D 0; + V_sameprefixcarponly =3D 0; +#endif + TAILQ_INIT(&V_in_ifaddrhead); V_in_ifaddrhashtbl =3D hashinit(INADDR_NHASH, M_IFADDR,=20 &V_in_ifaddrhmask); pr =3D pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); @@ -1591,8 +1617,6 @@ makedummy:=09 * locking. This code remains in ip_input.c as ip_mroute.c is=20 optionally * compiled. */ =2Dstatic int ip_rsvp_on; =2Dstruct socket *ip_rsvpd; int ip_rsvp_init(struct socket *so) { Modified: head/sys/netinet/ip_output.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/ip_output.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/ip_output.c Wed Nov 19 09:39:34 2008 (r185088) @@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$"); (ntohl(a.s_addr)>>8)&0xFF,\ (ntohl(a.s_addr))&0xFF, y); =20 +#ifdef VIMAGE_GLOBALS u_short ip_id; +#endif =20 #ifdef MBUF_STRESS_TEST int mbuf_frag_size =3D 0; Modified: head/sys/netinet/raw_ip.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/raw_ip.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/raw_ip.c Wed Nov 19 09:39:34 2008 (r185088) @@ -76,8 +76,10 @@ __FBSDID("$FreeBSD$"); =20 #include =20 +#ifdef VIMAGE_GLOBALS struct inpcbhead ripcb; struct inpcbinfo ripcbinfo; +#endif =20 /* control hooks for ipfw and dummynet */ ip_fw_ctl_t *ip_fw_ctl_ptr =3D NULL; @@ -91,7 +93,9 @@ ip_dn_ctl_t *ip_dn_ctl_ptr =3D NULL; /* * The socket used to communicate with the multicast routing daemon. */ +#ifdef VIMAGE_GLOBALS struct socket *ip_mrouter; +#endif =20 /* * The various mrouter and rsvp functions. Modified: head/sys/netinet/tcp_hostcache.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/tcp_hostcache.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/tcp_hostcache.c Wed Nov 19 09:39:34 2008 (r185088) @@ -146,9 +146,11 @@ struct tcp_hostcache { int prune; int purgeall; }; =2Dstatic struct tcp_hostcache tcp_hostcache; =20 +#ifdef VIMAGE_GLOBALS +static struct tcp_hostcache tcp_hostcache; static struct callout tcp_hc_callout; +#endif =20 static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *); static struct hc_metrics *tcp_hc_insert(struct in_conninfo *); Modified: head/sys/netinet/tcp_input.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/tcp_input.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/tcp_input.c Wed Nov 19 09:39:34 2008 (r185088) @@ -99,7 +99,21 @@ __FBSDID("$FreeBSD$"); =20 static const int tcprexmtthresh =3D 3; =20 +#ifdef VIMAGE_GLOBALS struct tcpstat tcpstat; +int blackhole; +int tcp_delack_enabled; +int drop_synfin; +int tcp_do_rfc3042; +int tcp_do_rfc3390; +int tcp_do_ecn; +int tcp_ecn_maxretries; +int tcp_insecure_rst; +int tcp_do_autorcvbuf; +int tcp_autorcvbuf_inc; +int tcp_autorcvbuf_max; +#endif + SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_tcp, TCPCTL_STATS, stats, CTLFLAG_RW, tcpstat , tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)"); @@ -108,59 +122,50 @@ int tcp_log_in_vain =3D 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_in_vain, CTLFLAG_RW, &tcp_log_in_vain, 0, "Log all incoming TCP segments to closed=20 ports"); =20 =2Dstatic int blackhole =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, blackhole,=20 CTLFLAG_RW, blackhole, 0, "Do not send RST on segments to closed ports"); =20 =2Dint tcp_delack_enabled =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, delayed_ack, CTLFLAG_RW, tcp_delack_enabled, 0, "Delay ACK to try and piggyback it onto a data packet"); =20 =2Dstatic int drop_synfin =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_RW, drop_synfin, 0, "Drop TCP packets with SYN+FIN set"); =20 =2Dstatic int tcp_do_rfc3042 =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, rfc3042,=20 CTLFLAG_RW, tcp_do_rfc3042, 0, "Enable RFC 3042 (Limited Transmit)"); =20 =2Dstatic int tcp_do_rfc3390 =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, rfc3390,=20 CTLFLAG_RW, tcp_do_rfc3390, 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); =20 =2Dint tcp_do_ecn =3D 0; =2Dint tcp_ecn_maxretries =3D 1; SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN"); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_ecn, OID_AUTO, enable, CTLFLAG_RW, tcp_do_ecn, 0, "TCP ECN support"); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_ecn, OID_AUTO, maxretries, CTLFLAG_RW, tcp_ecn_maxretries, 0, "Max retries before giving up on=20 ECN"); =20 =2Dstatic int tcp_insecure_rst =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_RW, tcp_insecure_rst, 0, "Follow the old (insecure) criteria for accepting RST packets"); =20 =2Dint tcp_do_autorcvbuf =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_RW, tcp_do_autorcvbuf, 0, "Enable automatic receive buffer sizing"); =20 =2Dint tcp_autorcvbuf_inc =3D 16*1024; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_RW, tcp_autorcvbuf_inc, 0, "Incrementor step size of automatic receive buffer"); =20 =2Dint tcp_autorcvbuf_max =3D 256*1024; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_RW, tcp_autorcvbuf_max, 0, "Max size of automatic receive buffer"); =20 +#ifdef VIMAGE_GLOBALS struct inpcbhead tcb; =2D#define tcb6 tcb /* for KAME src sync over BSD*'s */ struct inpcbinfo tcbinfo; +#endif +#define tcb6 tcb /* for KAME src sync over BSD*'s */ =20 static void tcp_dooptions(struct tcpopt *, u_char *, int, int); static void tcp_do_segment(struct mbuf *, struct tcphdr *, Modified: head/sys/netinet/tcp_output.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/tcp_output.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/tcp_output.c Wed Nov 19 09:39:34 2008 (r185088) @@ -87,39 +87,42 @@ __FBSDID("$FreeBSD$"); extern struct mbuf *m_copypack(); #endif =20 =2Dint path_mtu_discovery =3D 1; +#ifdef VIMAGE_GLOBALS +int path_mtu_discovery; +int ss_fltsz; +int ss_fltsz_local; +int tcp_do_newreno; +int tcp_do_tso; +int tcp_do_autosndbuf; +int tcp_autosndbuf_inc; +int tcp_autosndbuf_max; +#endif + SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO,=20 path_mtu_discovery, CTLFLAG_RW, path_mtu_discovery, 1, "Enable Path MTU Discovery"); =20 =2Dint ss_fltsz =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, slowstart_flightsize, CTLFLAG_RW, ss_fltsz, 1, "Slow start flight size"); =20 =2Dint ss_fltsz_local =3D 4; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, local_slowstart_flightsize, CTLFLAG_RW, ss_fltsz_local, 1, "Slow start flight size for local networks"); =20 =2Dint tcp_do_newreno =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, newreno,=20 CTLFLAG_RW, tcp_do_newreno, 0, "Enable NewReno Algorithms"); =20 =2Dint tcp_do_tso =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, tso,=20 CTLFLAG_RW, tcp_do_tso, 0, "Enable TCP Segmentation Offload"); =20 =2Dint tcp_do_autosndbuf =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_RW, tcp_do_autosndbuf, 0, "Enable automatic send buffer sizing"); =20 =2Dint tcp_autosndbuf_inc =3D 8*1024; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_RW, tcp_autosndbuf_inc, 0, "Incrementor step size of automatic send buffer"); =20 =2Dint tcp_autosndbuf_max =3D 256*1024; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_RW, tcp_autosndbuf_max, 0, "Max size of automatic send buffer"); Modified: head/sys/netinet/tcp_reass.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/tcp_reass.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/tcp_reass.c Wed Nov 19 09:39:34 2008 (r185088) @@ -74,25 +74,28 @@ __FBSDID("$FreeBSD$"); #include #endif /* TCPDEBUG */ =20 +#ifdef VIMAGE_GLOBALS +static int tcp_reass_maxseg; +int tcp_reass_qsize; +static int tcp_reass_maxqlen; +static int tcp_reass_overflows; +#endif + SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, "TCP Segment Reassembly Queue"); =20 =2Dstatic int tcp_reass_maxseg =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_reass, OID_AUTO,=20 maxsegments, CTLFLAG_RDTUN, tcp_reass_maxseg, 0, "Global maximum number of TCP Segments in Reassembly Queue"); =20 =2Dint tcp_reass_qsize =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_reass, OID_AUTO,=20 cursegments, CTLFLAG_RD, tcp_reass_qsize, 0, "Global number of TCP Segments currently in Reassembly Queue"); =20 =2Dstatic int tcp_reass_maxqlen =3D 48; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_reass, OID_AUTO, maxqlen, CTLFLAG_RW, tcp_reass_maxqlen, 0, "Maximum number of TCP Segments per individual Reassembly Queue"); =20 =2Dstatic int tcp_reass_overflows =3D 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_reass, OID_AUTO,=20 overflows, CTLFLAG_RD, tcp_reass_overflows, 0, "Global number of TCP Segment Reassembly Queue Overflows"); @@ -114,6 +117,11 @@ tcp_reass_init(void) { INIT_VNET_INET(curvnet); =20 + V_tcp_reass_maxseg =3D 0; + V_tcp_reass_qsize =3D 0; + V_tcp_reass_maxqlen =3D 48; + V_tcp_reass_overflows =3D 0; + V_tcp_reass_maxseg =3D nmbclusters / 16; TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments", &V_tcp_reass_maxseg); Modified: head/sys/netinet/tcp_sack.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =2D-- head/sys/netinet/tcp_sack.c Wed Nov 19 08:56:35 2008 (r185087) +++ head/sys/netinet/tcp_sack.c Wed Nov 19 09:39:34 2008 (r185088) @@ -124,23 +124,26 @@ __FBSDID("$FreeBSD$"); =20 extern struct uma_zone *sack_hole_zone; =20 +#ifdef VIMAGE_GLOBALS +int tcp_do_sack; +int tcp_sack_maxholes; +int tcp_sack_globalmaxholes; +int tcp_sack_globalholes; +#endif + SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack, CTLFLAG_RW, 0, "TCP SACK"); =2Dint tcp_do_sack =3D 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_sack, OID_AUTO, enable, CTLFLAG_RW, tcp_do_sack, 0, "Enable/Disable TCP SACK support"); TUNABLE_INT("net.inet.tcp.sack.enable", &tcp_do_sack); =20 =2Dstatic int tcp_sack_maxholes =3D 128; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_sack, OID_AUTO, maxholes, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** =2D------------------------------------------------------ From owner-freebsd-virtualization@FreeBSD.ORG Sat Nov 22 04:32:02 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1CB81065678 for ; Sat, 22 Nov 2008 04:32:02 +0000 (UTC) (envelope-from jason.fines@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.244]) by mx1.freebsd.org (Postfix) with ESMTP id 5658E8FC0C for ; Sat, 22 Nov 2008 04:32:02 +0000 (UTC) (envelope-from jason.fines@gmail.com) Received: by an-out-0708.google.com with SMTP id b6so557125ana.13 for ; Fri, 21 Nov 2008 20:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=D4vLJnkJzRSXaB7FHykjJfuwFUtAKrYno2JmPJHsZgA=; b=TMbiarmtdgstHhO8TyocWc4QsgIv0bYgfFBitSJkDTCR2eIASpzbfDLqcmyACnBQJv 5SHoSioM58jcu9HJfU+LMMYkmAoBK4QA5MuuFWha1Fs4S7aiOuqLN5vpvMC1rGlnYzPt 8sIUjdxzMJAXOaKCxY0Q87t/xppJy1eYlfI6E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=Ypp6TT/eOaKV5PaU3vgT7Sc5gTiagR5t1jm48+pS/oZTxjJ2AdF16QEuWwG7eUdcO5 Y2jHmy8BUUxq09TyqZuR/BsVtIPA4y2ncOJUMVBVQDuDWVeQ2k/wYCPj/PSPhBv4Jl5e CjptXdmJBNC6A2A7eZa+299K3NzMoR0VHJc7Q= Received: by 10.100.41.9 with SMTP id o9mr588760ano.39.1227327829521; Fri, 21 Nov 2008 20:23:49 -0800 (PST) Received: by 10.100.6.18 with HTTP; Fri, 21 Nov 2008 20:23:49 -0800 (PST) Message-ID: <5e6025b70811212023p5ed662a9id42ad8665df2043f@mail.gmail.com> Date: Fri, 21 Nov 2008 23:23:49 -0500 From: "Jason Fines" To: freebsd-virtualization@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Question About TCP Reassembly Inside VImages X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2008 04:32:02 -0000 Hello all, I've got a question about setting the sysctl variable net.inet.tcp.reass.maxsegments to a non-zero value inside my vimages. I'm currently running the FreeBSD 7 with the VIMAGE package available at http://imunes.tel.fer.hr/virtnet/vimage_7-20081015.tgz. My problem is with TCP reassembly support inside of the vimages, namely with the tcp.reass.maxsegments sysctl variable. I've tracked down where in the code the variable is set to line 122 in tcp_reass_init() of netinet/tcp_reass.c: "V_tcp_reass_maxseg = nmbclusters / 16;". The line clearly reads that maxsegments should be set to "nmbclusters /16", in the main OS (not in any vimage) the value is correctly set to 1/16 of what my nmbclusters sysctl variable is set to. However, inside all my vimages nmbclusters is set correctly, while reass.maxsegments is incorrectly set to zero!!! Is it possible that nmbclusters when read on line 122 of netinet/tcp_reass.c is zero? Has anyone else experienced this problem? Is TCP reassembly not supported/tested inside vimages? Any help in this area would be greatly appreciated. Thanks, Jason P.S. This technology is phenomenal, and thanks to everyone who is involved developing it. From owner-freebsd-virtualization@FreeBSD.ORG Sat Nov 22 04:52:01 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BED3106564A for ; Sat, 22 Nov 2008 04:52:01 +0000 (UTC) (envelope-from jason.fines@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.28]) by mx1.freebsd.org (Postfix) with ESMTP id B69C98FC0A for ; Sat, 22 Nov 2008 04:52:00 +0000 (UTC) (envelope-from jason.fines@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so549083yxb.13 for ; Fri, 21 Nov 2008 20:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=PfRTMBp/cuuMMDy+1PpefvhHlCLFLBmlLjA0VktEh+A=; b=hWTO0yARG0YM1/amVfC565YzsUaRJ2YvbEsdbKrDWKgLLWbDa/cPCas5/ZallEsNN5 QBdl/QSIMArFDvhKwV0plYhHSscZXR9kNSpk4NZ8HdHq+M0W4lx5ZInJWijmiM+ru9nQ 5Sg2AOJ9MaZQh7SvQfGdPXuKJdqAhjlWrqBes= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=SYvBhYz9hr42FHL3SxImwvOQKPoZS6Syizt2StnwaOJ3kmIdwmhKYS+wK85/2ghmcV k6b0gqMiO/p4oxR/yM9M7GbwowIBkKOrWW7DGKrxLWCGZ7Oh6f8wAqtm+GuTyoLjCdGe 9aBSjZeDBMwG6WP3ft9IoDxWvWaY/0IFekiM4= Received: by 10.100.232.10 with SMTP id e10mr587538anh.36.1227327598047; Fri, 21 Nov 2008 20:19:58 -0800 (PST) Received: by 10.100.6.18 with HTTP; Fri, 21 Nov 2008 20:19:57 -0800 (PST) Message-ID: <5e6025b70811212019h64feb7dcrd02ab78ba1b558c3@mail.gmail.com> Date: Fri, 21 Nov 2008 23:19:57 -0500 From: "Jason Fines" To: freebsd-virtualization@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Question About TCP Reassembly Inside VImages X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2008 04:52:01 -0000 Hello all, I've got a question about setting the sysctl variable net.inet.tcp.reass.maxsegments to a non-zero value inside my vimages. I'm currently running the FreeBSD 7 with the VIMAGE package available at http://imunes.tel.fer.hr/virtnet/vimage_7-20081015.tgz. My problem is with TCP reassembly support inside of the vimages, namely with the tcp.reass.maxsegments sysctl variable. I've tracked down where in the code the variable is set to line 122 in tcp_reass_init() of netinet/tcp_reass.c: "V_tcp_reass_maxseg = nmbclusters / 16;". The line clearly reads that maxsegments should be set to "nmbclusters /16", in the main OS (not in any vimage) the value is correctly set to 1/16 of what my nmbclusters sysctl variable is set to. However, inside all my vimages nmbclusters is set correctly, while reass.maxsegments is incorrectly set to zero!!! Is it possible that nmbclusters when read on line 122 of netinet/tcp_reass.c is zero? Has anyone else experienced this problem? Is TCP reassembly not supported/tested inside vimages? Any help in this area would be greatly appreciated. Thanks, Jason P.S. This technology is phenomenal, and thanks to everyone who is involved developing it. From owner-freebsd-virtualization@FreeBSD.ORG Sat Nov 22 10:24:53 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CF271065674 for ; Sat, 22 Nov 2008 10:24:53 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outC.internet-mail-service.net (outc.internet-mail-service.net [216.240.47.226]) by mx1.freebsd.org (Postfix) with ESMTP id F0F2A8FC12 for ; Sat, 22 Nov 2008 10:24:52 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 1354F23F9; Sat, 22 Nov 2008 02:12:06 -0800 (PST) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 8B1DA2D6004; Sat, 22 Nov 2008 02:12:02 -0800 (PST) Message-ID: <4927DAF2.5040709@elischer.org> Date: Sat, 22 Nov 2008 02:12:02 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Jason Fines References: <5e6025b70811212019h64feb7dcrd02ab78ba1b558c3@mail.gmail.com> In-Reply-To: <5e6025b70811212019h64feb7dcrd02ab78ba1b558c3@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-virtualization@freebsd.org Subject: Re: Question About TCP Reassembly Inside VImages X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2008 10:24:53 -0000 Jason Fines wrote: > Hello all, > > I've got a question about setting the sysctl variable > net.inet.tcp.reass.maxsegments to a non-zero value inside my vimages. I'm > currently running the FreeBSD 7 with the VIMAGE package available at > http://imunes.tel.fer.hr/virtnet/vimage_7-20081015.tgz. > > My problem is with TCP reassembly support inside of the vimages, namely with > the tcp.reass.maxsegments sysctl variable. I've tracked down where in the > code the variable is set to line 122 in tcp_reass_init() of > netinet/tcp_reass.c: "V_tcp_reass_maxseg = nmbclusters / 16;". The line > clearly reads that maxsegments should be set to "nmbclusters /16", in the > main OS (not in any vimage) the value is correctly set to 1/16 of what my > nmbclusters sysctl variable is set to. However, inside all my vimages > nmbclusters is set correctly, while reass.maxsegments is incorrectly set to > zero!!! V_tcp_reass_maxseg is a macro that hides the fact that tcp_reass_maxseg is a PER Vimage variable. Part of the patch is to make some sysctls be per-vimage. I do not know exactly about that one.. I suspect it is actually a read-only whole-system value, and not per vimage. > > Is it possible that nmbclusters when read on line 122 of netinet/tcp_reass.c > is zero? Has anyone else experienced this problem? Is TCP reassembly not > supported/tested inside vimages? > > Any help in this area would be greatly appreciated. > > Thanks, > Jason > > P.S. This technology is phenomenal, and thanks to everyone who is involved > developing it. > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org" From owner-freebsd-virtualization@FreeBSD.ORG Sat Nov 22 13:52:16 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FE6A1065673 for ; Sat, 22 Nov 2008 13:52:16 +0000 (UTC) (envelope-from jason.fines@gmail.com) Received: from mail-gx0-f22.google.com (mail-gx0-f22.google.com [209.85.217.22]) by mx1.freebsd.org (Postfix) with ESMTP id 198F68FC0A for ; Sat, 22 Nov 2008 13:52:15 +0000 (UTC) (envelope-from jason.fines@gmail.com) Received: by gxk3 with SMTP id 3so750286gxk.19 for ; Sat, 22 Nov 2008 05:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=dGbcIrsuyjl2MoYC20BBBN60fzRPTTH04XNvfEON0U0=; b=g3TDNc2pyG0Buw1epwAvPuy12KGetUTWL1nr3HpG6avNpo3RzScU86y+MXZJNOtTTw SmqT4Yi30j91josN3rdwbvPZCJDq97F5O0OjvR0XENrAuHvlymeO0M27XLXtIbr7sVj0 Fi8FoP/NQC3GhESm72drF3fgD3axbLXv7SirI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=ErR14bNEbnkHP+wKU4VJYw8CFrDoDSeSaxsB6Ymnarcv31UWL9rGVw7gSQzDThImRq t0Uu9QABs5tJhajnWqUjGVYVxArzkWrjMo6EpxkEEw6nydSlOt8wVNE9+8yztkVp54+1 BK+q1S5A+vE8DbSA4twQ00M7m+JvXUm9LdqK0= Received: by 10.100.32.6 with SMTP id f6mr708932anf.90.1227361934215; Sat, 22 Nov 2008 05:52:14 -0800 (PST) Received: by 10.100.6.18 with HTTP; Sat, 22 Nov 2008 05:52:14 -0800 (PST) Message-ID: <5e6025b70811220552g48e139d6h8269babccc3254a8@mail.gmail.com> Date: Sat, 22 Nov 2008 08:52:14 -0500 From: "Jason Fines" To: "Julian Elischer" In-Reply-To: <4927DAF2.5040709@elischer.org> MIME-Version: 1.0 References: <5e6025b70811212019h64feb7dcrd02ab78ba1b558c3@mail.gmail.com> <4927DAF2.5040709@elischer.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-virtualization@freebsd.org Subject: Re: Question About TCP Reassembly Inside VImages X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2008 13:52:16 -0000 Thanks Julian, I suspect you are correct as nmbclusters is a system wide sysctl variable set at boot time and although V_tcp_reass_maxseg is set per vimage it is the result of a constant operation done on nmbclusters (nmbclusters / 16). What I've described is what I suspect is the root of my problem. The manifestation of this problem is that TCP packets passing through my vimage(s) are not reassembled when they are out of order and I get an exceptionally high value reported by netstat -m stating that packets were dropped due to "insufficient memory". Posts I've found on the net point to the reassembly queue length, which in the vimages is zero for some reason. Perhaps this additional information will help clarify my exact problem. Thanks, Jason On Sat, Nov 22, 2008 at 5:12 AM, Julian Elischer wrote: > Jason Fines wrote: > >> Hello all, >> >> I've got a question about setting the sysctl variable >> net.inet.tcp.reass.maxsegments to a non-zero value inside my vimages. I'm >> currently running the FreeBSD 7 with the VIMAGE package available at >> http://imunes.tel.fer.hr/virtnet/vimage_7-20081015.tgz. >> >> My problem is with TCP reassembly support inside of the vimages, namely >> with >> the tcp.reass.maxsegments sysctl variable. I've tracked down where in the >> code the variable is set to line 122 in tcp_reass_init() of >> netinet/tcp_reass.c: "V_tcp_reass_maxseg = nmbclusters / 16;". The line >> clearly reads that maxsegments should be set to "nmbclusters /16", in the >> main OS (not in any vimage) the value is correctly set to 1/16 of what my >> nmbclusters sysctl variable is set to. However, inside all my vimages >> nmbclusters is set correctly, while reass.maxsegments is incorrectly set >> to >> zero!!! >> > > V_tcp_reass_maxseg is a macro that hides the fact that > tcp_reass_maxseg is a PER Vimage variable. > > Part of the patch > is to make some sysctls be per-vimage. I do not know exactly > about that one.. I suspect it is actually a read-only > whole-system value, and not per vimage. > > > > > >> Is it possible that nmbclusters when read on line 122 of >> netinet/tcp_reass.c >> is zero? Has anyone else experienced this problem? Is TCP reassembly not >> supported/tested inside vimages? >> >> Any help in this area would be greatly appreciated. >> >> Thanks, >> Jason >> >> P.S. This technology is phenomenal, and thanks to everyone who is involved >> developing it. >> _______________________________________________ >> freebsd-virtualization@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization >> To unsubscribe, send any mail to " >> freebsd-virtualization-unsubscribe@freebsd.org" >> > >