Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Oct 2001 17:11:42 -0700
From:      Luigi Rizzo <rizzo@aciri.org>
To:        stable@freebsd.org
Subject:   struct ifnet changes
Message-ID:  <20011024171142.A48147@iguana.aciri.org>

next in thread | raw e-mail | index | archive | help
Hi,
in order to add polling support to network interfaces
i need to add one more flag to network interface descriptors,
but the relevant field in struct ifnet (if_flags) is only 16 bit
wide and already fully used.

I would like to extend it to 32 bit, which is not a problem in
CURRENT, but doing this in STABLE will break binary compatibility
with older drivers (presumably up to FreeBSD 4.2, as between 4.1
and 4.2 there were other changes that probably prevent the use of
old binary drivers).

Are there strong objections to this change ?

I can avoid breaking binary compatibility by using some other unused
field (e.g. if_ipending, which is currently unused), but i'd rather
not have to, because we risk to carry this dirty hack forever.

If I am allowed to make changes to the structure, I would do the following:

 + change if_flags to an u_int32_t to accommodate more flags,
   and move it to the beginning of the structure -- this is
   accessed very very frequently, and this change makes the
   kernel 200 bytes smaller, and possibly a bit faster;

 + remove if_ipending -- noone is using it;

 + change if_index to u_int32_t (mostly to preserve alignment
   of the remaining fields);

 + maybe change if_unit and if_timer to 32 bit, for better alignment
   and code efficiency

 + redefine some of the (currently unused) fields for polling
   support. This does not compromise binary compatibility
   because the field size and position will remain the same,
   only the type will change.

Comments ?

	cheers
	luigi
----------------------------------+-----------------------------------------
 Luigi RIZZO, luigi@iet.unipi.it  . ACIRI/ICSI (on leave from Univ. di Pisa)
 http://www.iet.unipi.it/~luigi/  . 1947 Center St, Berkeley CA 94704
 Phone: (510) 666 2927
----------------------------------+-----------------------------------------

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011024171142.A48147>