PERFORCE change 124828 for review

Marko Zec zec at FreeBSD.org
Tue Aug 7 08:39:59 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=124828

Change 124828 by zec at 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();
 	}
 }
 


More information about the p4-projects mailing list