From owner-p4-projects@FreeBSD.ORG Tue Dec 12 16:00:45 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CE43F16A516; Tue, 12 Dec 2006 16:00:44 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7894E16A505 for ; Tue, 12 Dec 2006 16:00:44 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id B01BA43E2A for ; Tue, 12 Dec 2006 15:57:12 +0000 (GMT) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBCFwIlE074314 for ; Tue, 12 Dec 2006 15:58:18 GMT (envelope-from zec@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBCFwIdu074311 for perforce@freebsd.org; Tue, 12 Dec 2006 15:58:18 GMT (envelope-from zec@FreeBSD.org) Date: Tue, 12 Dec 2006 15:58:18 GMT Message-Id: <200612121558.kBCFwIdu074311@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@FreeBSD.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 111553 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2006 16:00:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=111553 Change 111553 by zec@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)