Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Aug 2007 15:39:58 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 124828 for review
Message-ID:  <200708071539.l77Fdwo6083099@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124828

Change 124828 by zec@zec_tpx32 on 2007/08/07 15:39:55

	With each netgraph node store its vnet affinity.  So far this
	info is used to set the curvnet context when processing the
	workqueue in ngintr().

Affected files ...

.. //depot/projects/vimage/src/sys/netgraph/netgraph.h#4 edit
.. //depot/projects/vimage/src/sys/netgraph/ng_base.c#19 edit

Differences ...

==== //depot/projects/vimage/src/sys/netgraph/netgraph.h#4 (text+ko) ====

@@ -340,6 +340,7 @@
 	LIST_ENTRY(ng_node)	  nd_idnodes;	/* ID hash collision list */
 	TAILQ_ENTRY(ng_node)	  nd_work;	/* nodes with work to do */
 	struct	ng_queue	  nd_input_queue; /* input queue for locking */
+	struct	vnet		 *nd_vnet;	/* network stack instance */
 #ifdef	NETGRAPH_DEBUG /*----------------------------------------------*/
 #define ND_MAGIC 0x59264837
 	int	nd_magic;

==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#19 (text+ko) ====

@@ -633,6 +633,9 @@
 		return (ENOMEM);
 	}
 	node->nd_type = type;
+#ifdef VIMAGE
+	node->nd_vnet = curvnet;
+#endif
 	NG_NODE_REF(node);				/* note reference */
 	type->refs++;
 
@@ -3399,6 +3402,7 @@
 			NG_WORKLIST_UNLOCK();
 			break;
 		}
+		CURVNET_SET(node->nd_vnet);
 		node->nd_flags &= ~NGF_WORKQ;	
 		TAILQ_REMOVE(&ng_worklist, node, nd_work);
 		NG_WORKLIST_UNLOCK();
@@ -3433,6 +3437,7 @@
 			}
 		}
 		NG_NODE_UNREF(node);
+		CURVNET_RESTORE();
 	}
 }
 



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