WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [3/11] [NET] front: Stop using rx->id

On Thu, Jul 27, 2006 at 02:28:48PM +0100, Keir Fraser wrote:
> 
> >Had we used the body of the second loop for the initial segment we 
> >would
> >end up wiping out the values of rx_skbs and grant_rx_ref when we do the
> >assignments
> >
> >             skb = np->rx_skbs[requeue_idx] = xennet_get_rx_skb(np, i);
> >             ref = np->grant_rx_ref[requeue_idx] = xennet_get_rx_ref(np, 
> >             i);
> >
> >because for the initial segment requeue_idx is always the same as i.
> 
> But wouldn't the xennet_get_* functions wipe the entries, only to be 
> immediately filled in again by the assignment to e.g., 
> np->rx_skbs[requeue_idx], so it would all work out okay (except a 
> needless wipe-then-rewrite)?

That was the reason of having two loops instead of the one.  In the first
loop, we're not moving entries so we don't assign rx_skbs/grant_rx_ref
at all.  In the second loop, we know that requeue_idx != i so we're
always moving entries forward in which case clearing the original position
is necessary.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel