Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Aug 2014 11:33:19 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270874 - in head/sys: dev/netmap net
Message-ID:  <201408311133.s7VBXJlv084881@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) */



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