From owner-freebsd-net@FreeBSD.ORG Sat Apr 3 13:39:14 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBD1916A4CE for ; Sat, 3 Apr 2004 13:39:14 -0800 (PST) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB6EE43D49 for ; Sat, 3 Apr 2004 13:39:14 -0800 (PST) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.9p1/8.12.8) with ESMTP id i33LdDgd067474; Sat, 3 Apr 2004 13:39:13 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.9p1/8.12.3/Submit) id i33LdDjY067473; Sat, 3 Apr 2004 13:39:13 -0800 (PST) (envelope-from rizzo) Date: Sat, 3 Apr 2004 13:39:13 -0800 From: Luigi Rizzo To: net@freebsd.org Message-ID: <20040403133913.A67287@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Subject: removal of unused and redundant fields in 'struct ifnet' X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2004 21:39:15 -0000 Hi, in -current, I am about to remove the following unused fields from 'struct ifnet', hope there are no objections: - int (*if_done) /* output complete routine */ - (struct ifnet *); /* (XXX not used; fake prototype) */ - int (*if_poll_recv) /* polled receive routine */ - (struct ifnet *, int *); - int (*if_poll_xmit) /* polled transmit routine */ - (struct ifnet *, int *); - void (*if_poll_intren) /* polled interrupt reenable routine */ - (struct ifnet *); - void (*if_poll_slowinput) /* input routine for slow devices */ - (struct ifnet *, struct mbuf *); - struct ifqueue *if_poll_slowq; /* input queue for slow devices */ On passing, i also note that the following fields are only used by IPv6, and they seem quite redundant (and space-consuming! AF_MAX is 36) struct ifprefixhead if_prefixhead; /* list of prefixes per if */ void *if_afdata[AF_MAX]; int if_afdata_initialized; struct mtx if_afdata_mtx; I suppose all of this could go into a 'struct inet6_data *', using the lock on the struct ifnet for the initial creation, and an additional lock inside the struct for specific ops. While this is not a change i plan to make soon, at some point in the future I would like to fix this too. comments ? cheers luigi