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

Re: [Xen-devel] PATCH: multicall and auto_translated in netfront.c

To: Tristan Gingold <Tristan.Gingold@xxxxxxxx>
Subject: Re: [Xen-devel] PATCH: multicall and auto_translated in netfront.c
From: Steven Smith <sos22-xen@xxxxxxxxxxxxx>
Date: Fri, 18 Aug 2006 18:30:01 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, sos22@xxxxxxxxxxxxx
Delivery-date: Fri, 18 Aug 2006 10:30:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200608181602.22811.Tristan.Gingold@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <200608181602.22811.Tristan.Gingold@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> diff -r bef360142b62 -r ee4aef404bce 
> linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
> --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c    Mon Aug 14 
> 14:21:21 2006 -0600
> +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c    Fri Aug 18 
> 14:00:37 2006 +0200
> @@ -1220,13 +1220,20 @@ err:
>  
>       /* Do all the remapping work, and M2P updates, in one big hypercall. */
>       if (likely(pages_done)) {
> -             mcl = np->rx_mcl + pages_done;
> +             unsigned int mcl_off;
> +
> +             if (!xen_feature(XENFEAT_auto_translated_physmap))
> +                     mcl_off = pages_done;
> +             else
> +                     mcl_off = 0;
> +
The intent of this code was that pages_done should be 0 if
auto_translated_physmap was set, so this should be a no-op.  It gets
initialised to 0 at the top of the big loop, and is then only modified
by xennet_get_responses through its mcl_offset_p pointer.
xennet_get_responses only modifies it if
!xen_feature(XENFEAT_auto_translated_physmap).  Am I simply confused?

(And, in fact, if pages_done != 0 then the mmu update you do next will
be incorrect)

> +             mcl = np->rx_mcl + mcl_off;
>               mcl->op = __HYPERVISOR_mmu_update;
>               mcl->args[0] = (unsigned long)np->rx_mmu;
>               mcl->args[1] = pages_done;
>               mcl->args[2] = 0;
>               mcl->args[3] = DOMID_SELF;
> -             (void)HYPERVISOR_multicall(np->rx_mcl, pages_done + 1);
> +             (void)HYPERVISOR_multicall(np->rx_mcl, mcl_off + 1);
>       }
>  
>       while ((skb = __skb_dequeue(&errq)))

Steven.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>