freebsd-skq/sys/dev/netmap
Marcel Moolenaar 62d76917b8 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.

The MII code has been converted to use the driver API to avoid
unnecessary code churn. Code churn comes from having to work with
both converted and unconverted drivers in correlation with having
callback functions that take an interface. By converting the MII
code first, the callback functions can be defined so that the
compiler will perform the typecasts automatically.

As soon as all drivers have been converted, the if_t type can be
redefined as needed and the API functions can be fix to not need
an explicit cast.

The immediate benefactors of this change are:
1.  Juniper Networks - The network stack implementation in Junos
    is entirely different from FreeBSD's one and this change
    allows Juniper to build "stock" NIC drivers that can be used
    in combination with both the FreeBSD and Junos stacks.
2.  FreeBSD - This change opens the door towards changing ifnet
    and implementing new features and optimizations in the network
    stack without it requiring a change in the many NIC drivers
    FreeBSD has.

Submitted by:	Anuranjan Shukla <anshukla@juniper.net>
Reviewed by:	glebius@
Obtained from:	Juniper Networks, Inc.
2014-06-02 17:54:39 +00:00
..
if_em_netmap.h It is 2014 and we have a new version of netmap. 2014-01-06 12:53:15 +00:00
if_igb_netmap.h It is 2014 and we have a new version of netmap. 2014-01-06 12:53:15 +00:00
if_lem_netmap.h It is 2014 and we have a new version of netmap. 2014-01-06 12:53:15 +00:00
if_re_netmap.h It is 2014 and we have a new version of netmap. 2014-01-06 12:53:15 +00:00
ixgbe_netmap.h It is 2014 and we have a new version of netmap. 2014-01-06 12:53:15 +00:00
netmap_freebsd.c compile with NOINET 2014-02-20 04:56:55 +00:00
netmap_generic.c Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
netmap_kern.h Introduce a procedural interface to the ifnet structure. The new 2014-06-02 17:54:39 +00:00
netmap_mbq.c It is 2014 and we have a new version of netmap. 2014-01-06 12:53:15 +00:00
netmap_mbq.h It is 2014 and we have a new version of netmap. 2014-01-06 12:53:15 +00:00
netmap_mem2.c This new version of netmap brings you the following: 2014-02-15 04:53:04 +00:00
netmap_mem2.h This new version of netmap brings you the following: 2014-02-15 04:53:04 +00:00
netmap_offloadings.c This new version of netmap brings you the following: 2014-02-15 04:53:04 +00:00
netmap_pipe.c This new version of netmap brings you the following: 2014-02-15 04:53:04 +00:00
netmap_vale.c This new version of netmap brings you the following: 2014-02-15 04:53:04 +00:00
netmap.c two small changes: 2014-02-18 04:27:41 +00:00