From owner-svn-src-head@FreeBSD.ORG Sun Mar 1 12:42:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BB791065675; Sun, 1 Mar 2009 12:42:55 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08E998FC1E; Sun, 1 Mar 2009 12:42:55 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n21CgsNp043574; Sun, 1 Mar 2009 12:42:54 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n21CgsV1043573; Sun, 1 Mar 2009 12:42:54 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903011242.n21CgsV1043573@svn.freebsd.org> From: Robert Watson Date: Sun, 1 Mar 2009 12:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189230 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2009 12:42:57 -0000 Author: rwatson Date: Sun Mar 1 12:42:54 2009 New Revision: 189230 URL: http://svn.freebsd.org/changeset/base/189230 Log: Do a bit of struct ifnet cleanup in preparation for 8.0: group function pointers together, move padding to the bottom of the structure, and add two new integer spares due to attrition over time. Remove unused spare "flags" field, we can use one of the spare ints if we need it later. This change requires a rebuild of device driver modules that depend on the layout of ifnet for binary compatibility reasons. Discussed with: kmacy Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Mar 1 11:20:35 2009 (r189229) +++ head/sys/net/if_var.h Sun Mar 1 12:42:54 2009 (r189230) @@ -162,10 +162,13 @@ struct ifnet { (void *); int (*if_resolvemulti) /* validate/resolve multicast */ (struct ifnet *, struct sockaddr **, struct sockaddr *); + void (*if_qflush) /* flush any queues */ + (struct ifnet *); + int (*if_transmit) /* initiate output routine */ + (struct ifnet *, struct mbuf *); struct ifaddr *if_addr; /* pointer to link-level address */ void *if_llsoftc; /* link layer softc */ int if_drv_flags; /* driver-managed status flags */ - u_int if_spare_flags2; /* spare flags 2 */ struct ifaltq if_snd; /* output queue (includes altq) */ const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ @@ -187,12 +190,14 @@ struct ifnet { /* protected by if_addr_mtx */ void *if_pf_kif; void *if_lagg; /* lagg glue */ - void *if_pspare[8]; /* TOE 3; vimage 3; general use 4 */ - void (*if_qflush) /* flush any queues */ - (struct ifnet *); - int (*if_transmit) /* initiate output routine */ - (struct ifnet *, struct mbuf *); - int if_ispare[2]; /* general use 2 */ + + /* + * Spare fields are added so that we can modify sensitive data + * structures without changing the kernel binary interface, and must + * be used with care where binary compatibility is required. + */ + void *if_pspare[8]; + int if_ispare[4]; }; typedef void if_init_f_t(void *);