svn commit: r270874 - in head/sys: dev/netmap net

Luigi Rizzo rizzo at iet.unipi.it
Mon Sep 8 11:18:50 UTC 2014


Just noticed this.

I would appreciate if you and others could inform me _before_ touching
netmap-related stuff, and also, if you make changes make sure they are
visible to the preprocessor so i can use conditional compilations.

This is because this code is supposed to be the same on various FreeBSD
revisions
and Linux, and if each platform randomly changes its structures maintainance
becomes very hard

cheers
luigi


On Sun, Aug 31, 2014 at 1:33 PM, Gleb Smirnoff <glebius at freebsd.org> wrote:

> Author: glebius
> Date: Sun Aug 31 11:33:19 2014
> New Revision: 270874
> URL: http://svnweb.freebsd.org/changeset/base/270874
>
> Log:
>   Provide pointer from struct ifnet to struct netmap_adapter,
>   instead of abusing spare field.
>
> Modified:
>   head/sys/dev/netmap/netmap_kern.h
>   head/sys/net/if_var.h
>
> Modified: head/sys/dev/netmap/netmap_kern.h
>
> ==============================================================================
> --- head/sys/dev/netmap/netmap_kern.h   Sun Aug 31 10:42:52 2014
> (r270873)
> +++ head/sys/dev/netmap/netmap_kern.h   Sun Aug 31 11:33:19 2014
> (r270874)
> @@ -1187,7 +1187,7 @@ extern int netmap_generic_rings;
>   * WNA is used to write it.
>   */
>  #ifndef WNA
> -#define        WNA(_ifp)       (_ifp)->if_pspare[0]
> +#define        WNA(_ifp)       (_ifp)->if_netmap
>  #endif
>  #define        NA(_ifp)        ((struct netmap_adapter *)WNA(_ifp))
>
>
> Modified: head/sys/net/if_var.h
>
> ==============================================================================
> --- head/sys/net/if_var.h       Sun Aug 31 10:42:52 2014        (r270873)
> +++ head/sys/net/if_var.h       Sun Aug 31 11:33:19 2014        (r270874)
> @@ -67,6 +67,7 @@ struct  ifvlantrunk;
>  struct route;                  /* if_output */
>  struct vnet;
>  struct ifmedia;
> +struct netmap_adapter;
>
>  #ifdef _KERNEL
>  #include <sys/mbuf.h>          /* ifqueue only? */
> @@ -202,6 +203,7 @@ struct ifnet {
>         void    *if_pf_kif;             /* pf glue */
>         struct  carp_if *if_carp;       /* carp interface structure */
>         struct  label *if_label;        /* interface MAC label */
> +       struct  netmap_adapter *if_netmap; /* netmap(4) softc */
>
>         /* Various procedures of the layer2 encapsulation and drivers. */
>         int     (*if_output)            /* output routine (enqueue) */
>
>


-- 
-----------------------------------------+-------------------------------
 Prof. Luigi RIZZO, rizzo at iet.unipi.it  . Dip. di Ing. dell'Informazione
 http://www.iet.unipi.it/~luigi/        . Universita` di Pisa
 TEL      +39-050-2211611               . via Diotisalvi 2
 Mobile   +39-338-6809875               . 56122 PISA (Italy)
-----------------------------------------+-------------------------------


More information about the svn-src-head mailing list