From owner-freebsd-arch@FreeBSD.ORG Mon Jul 4 09:08:57 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B869106566C for ; Mon, 4 Jul 2011 09:08:57 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 0DC508FC14 for ; Mon, 4 Jul 2011 09:08:56 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id CE3067300A; Mon, 4 Jul 2011 11:09:12 +0200 (CEST) Date: Mon, 4 Jul 2011 11:09:12 +0200 From: Luigi Rizzo To: src-committers@freebsd.org Message-ID: <20110704090912.GA18578@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: arch@freebsd.org Subject: RFC: Correct location for SUBsystem-wide options ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 09:08:57 -0000 Hi, in the process of deciding where to put the kernel option for NETMAP, i have looked at the current practice, and i see a bit of confusion on how things are done. Looking at the comment at the top of sys/conf/options we have * opt_foo.h for options affecting a single source file foo.[cs] * opt_some_name.h for option SOME_NAME affecting only a few files. for options affecting many but not all files (e.g. all network interfaces) * opt_global.h for system-wide options So, we have no standard place for options affecting all network interfaces, which are exactly the thing i am looking at, and I see all possible varieties in our sys/conf/options: INET, INET6 go into their own headers (opt_inet.h and opt_inet6.h) In my view these are system wide in the sense that INET support may use some specific code also in device drivers, e.g. all the checksum and tcp offloading support DEVICE_POLLING goes into opt_device_polling.h NETGRAPH goes into opt_netgraph.h ALTQ, VIMAGE go into opt_global.h (note that internal ALTQ_* options are in opt_altq.h) Missing a specific header opt_network.h, in my opinion the correct approach is the one used for ALTQ and VIMAGE: they properly go into opt_global.h, and we should move there also INET, INET6, DEVICE_POLLING and NETGRAPH (and DEV_NETMAP). This way we reduce the clutter in all the if_*.c files, and also avoid the risk that one of these files forgets to include a required opt_something.h In any case, it is not my intention to modify the status quo, but at least add a proper suggestion in sys/conf/options to deal with these cases. Comments ? cheers luigi