PERFORCE change 111553 for review
Marko Zec
zec at FreeBSD.org
Tue Dec 12 08:00:45 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=111553
Change 111553 by zec at zec_tca51 on 2006/12/12 15:57:31
Introduce a quiet version of a macro used to set the
per-thread vnet affinity. The standard CURVNETB_SET()
version normally prints out a warning message if we
begin to "stack" the vnet affinity, i.e. if in a call
graph we call CURVNETB_SET() more than once without
previously reverting it with CURVNETB_RESTORE().
However, there are circumstances when such "stacking" of
vnet affinity is unavoidable, such as when instatiating
new vnets or moving interfaces from one vnet to another,
in which case the CURVNETB_SET_QUIET() macro can / should
be used.
Affected files ...
.. //depot/projects/vimage/src/sys/kern/kern_vimage.c#10 edit
.. //depot/projects/vimage/src/sys/sys/vimage.h#8 edit
Differences ...
==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#10 (text+ko) ====
@@ -192,7 +192,7 @@
if (vi_req != NULL) {
struct ifnet *t_ifp;
- CURVNETB_SET(new_vnetb);
+ CURVNETB_SET_QUIET(new_vnetb);
t_ifp = ifunit(vi_req->vi_parent_name);
CURVNETB_RESTORE();
if (t_ifp != NULL)
@@ -442,7 +442,7 @@
LIST_INSERT_HEAD(&vnetb_head, vnetb, vnetb_le);
LIST_INSERT_HEAD(&vprocg_head, vprocg, vprocg_le);
LIST_INSERT_HEAD(&vcpu_head, vcpu, vcpu_le);
- CURVNETB_SET(vnetb);
+ CURVNETB_SET_QUIET(vnetb);
/*
* Initialize modules with ORDER_1ST flag set
@@ -504,7 +504,7 @@
struct vcpu *vcpu = vip->v_cpu;
struct ifnet *ifp;
- CURVNETB_SET(vnetb);
+ CURVNETB_SET_QUIET(vnetb);
INIT_VNET_NET(vnetb);
/* return all interfaces to the parent vnetb */
==== //depot/projects/vimage/src/sys/sys/vimage.h#8 (text+ko) ====
@@ -126,16 +126,21 @@
#define VNET_MAGIC_N 0x3e0d8f29
-#define CURVNETB_SET(arg) \
+#define CURVNETB_SET_QUIET(arg) \
VNET_ASSERT((arg)->vnet_magic_n == VNET_MAGIC_N); \
struct vnet_base *saved_vnetb = curvnetb; \
const char *saved_vnet_lpush = curthread->td_vnet_lpush; \
curvnetb = arg; \
- curthread->td_vnet_lpush = __FUNCTION__ ; \
+ curthread->td_vnet_lpush = __FUNCTION__ ;
+
+#define CURVNETB_SET_VERBOSE(arg) \
+ CURVNETB_SET_QUIET(arg) \
if (saved_vnetb) \
printf("curvnetb_set() in %s cpu %d: %p (%s) -> %p\n", \
curthread->td_vnet_lpush, curcpu, saved_vnetb, \
saved_vnet_lpush, curvnetb);
+
+#define CURVNETB_SET(arg) CURVNETB_SET_VERBOSE(arg)
#define CURVNETB_RESTORE() \
VNET_ASSERT(saved_vnetb == NULL || \
@@ -176,6 +181,7 @@
* Non-VIMAGE null-macros
*/
#define CURVNETB_SET(arg)
+#define CURVNETB_SET_QUIET(arg)
#define CURVNETB_RESTORE()
#define VNET_ASSERT(condition)
#define VSYM(base, sym) (sym)
More information about the p4-projects
mailing list