From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [Pv-ops][PATCH 3/4 v2] Netback: Multiple tasklets support Date: Tue, 4 May 2010 09:23:11 -0400 Message-ID: <20100504132311.GA31716@phenom.dumpdata.com> References: <20100503160644.GE31299@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Xu, Dongxiao" Cc: Jeremy Fitzhardinge , "xen-devel@lists.xensource.com" , Steven Smith List-Id: xen-devel@lists.xenproject.org > > +static void netbk_add_netif(struct xen_netbk *netbk, int group_nr, > > + struct xen_netif *netif) > > +{ > > + int i; > > + int min_netfront_count; > > + int min_group = 0; > > + spin_lock(&netbk->group_operation_lock); > > + min_netfront_count = netbk[0].netfront_count; > > + for (i = 0; i < group_nr; i++) { > > + if (netbk[i].netfront_count < min_netfront_count) { > > + min_group = i; > > + min_netfront_count = netbk[i].netfront_count; > > > > Should you have a 'break' here? I am not sure if it makes sense to go > > through all of the tasklets to set the min_group and > > min_netfrount_count to the last one? > > To find the minimum count, I think it should go through all the tasklsets. Ahh yes (duh!). I missed the 'min_netfrount_count' assigment! That makes much more sense. .. snip .. > > Say you have 7 VIFs and only 4 VCPUs, are these netfront_count values > > correct? > > > > netbk[0].netfront_count == 1; /* vif0 added */ > > netbk[3].netfront_count == 1; /* vif1 added */ > > netbk[2].netfront_count == 1; /* vif2 added */ > > netbk[1].netfront_count == 1; /* vif3 added */ > > netbk[0].netfront_count == 2; /* vif4 added */ > > netbk[3].netfront_count == 2; /* vif5 added */ > > netbk[2].netfront_count == 2; /* vif6 added */ > > Basically it is true, but the order may be changed.