svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net

Juli Mallett jmallett at FreeBSD.org
Mon Jun 2 19:55:17 UTC 2014


Marcel,

On Mon, Jun 2, 2014 at 10:54 AM, Marcel Moolenaar <marcel at freebsd.org>
wrote:

> Author: marcel
> Date: Mon Jun  2 17:54:39 2014
> New Revision: 266974
> URL: http://svnweb.freebsd.org/changeset/base/266974
>
> Log:
>   Introduce a procedural interface to the ifnet structure.  The new
>   interface allows the ifnet structure to be defined as an opaque
>   type in NIC drivers.  This then allows the ifnet structure to be
>   changed without a need to change or recompile NIC drivers.
>
>   Put differently, NIC drivers can be written and compiled once and
>   be used with different network stack implementations, provided of
>   course that those network stack implementations have an API and
>   ABI compatible interface.
>
>   This commit introduces the 'if_t' type to replace 'struct ifnet *'
>   as the type of a network interface. The 'if_t' type is defined as
>   'void *' to enable the compiler to perform type conversion to
>   'struct ifnet *' and vice versa where needed and without warnings.
>   The functions that implement the API are the only functions that
>   need to have an explicit cast.
> [...]
>   Submitted by: Anuranjan Shukla <anshukla at juniper.net>
>   Reviewed by:  glebius@
>   Obtained from:        Juniper Networks, Inc.
>

Could you say a little bit about why so few reviewers?  Also, why "if_t"
rather than an opaque "struct ifnet" to minimize churn, and also not
conflict with other "if_t" types one might be using in third-party kernel
modules.  It's a pretty general name, and that seems problematic.  In
general am enthused about this happening, just minor implementation
concerns.

Thanks,
Juli.


More information about the svn-src-all mailing list