From owner-freebsd-virtualization@FreeBSD.ORG Wed Aug 20 08:18:20 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 5148E106568C for ; Wed, 20 Aug 2008 08:18:20 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outN.internet-mail-service.net (outn.internet-mail-service.net [216.240.47.237]) by mx1.freebsd.org (Postfix) with ESMTP id 352728FC21 for ; Wed, 20 Aug 2008 08:18:19 +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 0497D2349 for ; Wed, 20 Aug 2008 01:18:20 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 4D9362D6015 for ; Wed, 20 Aug 2008 01:18:19 -0700 (PDT) Message-ID: <48ABD349.6030701@elischer.org> Date: Wed, 20 Aug 2008 01:18:17 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: freebsd-virtualization@freebsd.org References: <48ABD1EF.5060307@elischer.org> In-Reply-To: <48ABD1EF.5060307@elischer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: report and comment 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, 20 Aug 2008 08:18:20 -0000 Julian Elischer wrote: > I have MOSTLY merged the last commit into > all the p4 branches.. > > progress should be good towards commit 1.5 > > > something I just noticed.... > > in sys/netinet/tcp_subr.c > ================================================ > [...] > #endif * Locking of the global variables isn_secret, isn_last_reseed, > isn_offset, > * isn_offset_old, and isn_ctx is performed using the TCP pcbinfo lock. In > * general, this means holding an exclusive (write) lock. > */ > > #define ISN_BYTES_PER_SECOND 1048576 > #define ISN_STATIC_INCREMENT 4096 > #define ISN_RANDOM_INCREMENT (4096 - 1) > > #ifndef VIMAGE > static u_char isn_secret[32]; > static int isn_last_reseed; > static u_int32_t isn_offset, isn_offset_old; > static MD5_CTX isn_ctx; > #endif > > tcp_seq > tcp_new_isn(struct tcpcb *tp) > { > [...] > ================================================ > > and in sys/contrib/pf/net/pf_subr.c > > ================================================ > [...] > * Locking of the global variables isn_secret, isn_last_reseed, isn_offset, > * isn_offset_old, and isn_ctx is performed using the TCP pcbinfo lock. In > * general, this means holding an exclusive (write) lock. > */ > > #define ISN_BYTES_PER_SECOND 1048576 > #define ISN_STATIC_INCREMENT 4096 > #define ISN_RANDOM_INCREMENT (4096 - 1) > > #ifndef VIMAGE > static u_char isn_secret[32]; > static int isn_last_reseed; > static u_int32_t isn_offset; > static MD5_CTX isn_ctx; > #endif > > u_int32_t > pf_new_isn(struct pf_state *s) > { > [...] > ===================================================== > > so we have the same global variables, static, in 2 places.. > so one set should go in the pf vars and the other in the inet > vars. The first answers I think of are: > > > 1/ rename one set > 2/ make one of them a VV_ macro that goes elsewhere. looking at the code better... I see the entire function is about the same.. 3/ remove the duplicated code in pf and call the one in tcp_subr.c from both places.. > > anyone have other suggestions? > > > > _______________________________________________ > 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"