From owner-freebsd-net@FreeBSD.ORG Mon Mar 2 18:57:00 2009 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C7DF1065C84; Mon, 2 Mar 2009 18:57:00 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id B78938FC1C; Mon, 2 Mar 2009 18:56:59 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 0817D73098; Mon, 2 Mar 2009 20:01:57 +0100 (CET) Date: Mon, 2 Mar 2009 20:01:57 +0100 From: Luigi Rizzo To: Robert Watson Message-ID: <20090302190157.GA33704@onelab2.iet.unipi.it> References: <20090301153010.GA58942@onelab2.iet.unipi.it> <49AAFD92.105@elischer.org> <8EBEEE24-6473-411D-AE3F-C4D1D3897E51@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: Rui Paulo , arch@freebsd.org, Julian Elischer , net@freebsd.org Subject: Re: spliting kernel ipfw source ? (also involves sctp) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2009 18:57:04 -0000 On Mon, Mar 02, 2009 at 06:30:27PM +0000, Robert Watson wrote: .. > >>Luigi Rizzo wrote: > >>>Hi, I am planning to split netinet/ip_fw2.c in a number of smaller files > >>>to make it more manageable, and while i do this I would also like to > >>>move the files related to ipfw2 (namely ip_fw*c) to a better place. Any > >>>objection to moving them to sys/netinet/ipfw2 ? Also, I can't help > >>>noticing that sys/netinet/ contains 36 files related to sctp -- wouldn't > >>>it be the case to move them (perhaps with the exception of the userland > >>>headers) to a separate subdirectory ? ... > I think massively rearranging things doesn't by us much in terms of beauty, > but does give us a lot in terms of hassle, given current assumptions of > alignment between the layout of /usr/include and the layout of > /usr/src/sys. We'd need to introduce new explicit mappings to install > include files in their old locations (which are required by applications), > etc. For a change with such a minor benefit, the hassle will be huge. I'm > fine with renaming the ipfw .c files and leaving in netinet, but let's not > get carried away. I suspect that the mention of symlinks (which is not mine and absolutely not what I want to do) triggered some alarms :) I have very clear the potential nightmare with careless moving of files, so I tried to make it clear that public headers are excluded: as you see i wrote "ip_fw*c" and "exception of the userland headers". To further clarify, my plan is the following: - leave ip_fw.h and ip_dummynet.h in /sys/netinet in case userland code is dependent on their location; - create /sys/netinet/ipfw/ to hold the kernel .c files related to ipfw and possibly dummynet (and also their private headers if any); I am not going to touch other people's stuff, though I repeat that sctp would clearly deserve a cleanup -- i doubt userland needs more than one or possibly two headers (one for the basic stuff, one for the fancy and possibly non-portable stuff). Tcp has similar issues especially for recent additions. More than the number of files in /sys/netinet/, i am worried by the amount of private headers that are exposed to userland for no good reason. In fact, some of them are contain: #ifndef _KERNEL #error "no user-serviceable parts inside" #endif Part of this is for historical reasons, but we should try to move to a better structure. Take e.g. tcp_var.h contains the stats (that some userland program may want to have) but also a ton of internal structures (e.g. those for SACK support) that have appeared very recently and have no reason to be there. cheers luigi