From: Steven Smith Subject: Re: PATCH: multicall and auto_translated in netfront.c Date: Fri, 18 Aug 2006 18:30:01 +0100 Message-ID: <20060818173001.GA5829@cam.ac.uk> References: <200608181602.22811.Tristan.Gingold@bull.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0780666835==" Return-path: In-Reply-To: <200608181602.22811.Tristan.Gingold@bull.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tristan Gingold Cc: xen-devel@lists.xensource.com, sos22@srcf.ucam.org List-Id: xen-devel@lists.xenproject.org --===============0780666835== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > diff -r bef360142b62 -r ee4aef404bce linux-2.6-xen-sparse/drivers/xen/net= front/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: > =20 > /* Do all the remapping work, and M2P updates, in one big hypercall. */ > if (likely(pages_done)) { > - mcl =3D np->rx_mcl + pages_done; > + unsigned int mcl_off; > + > + if (!xen_feature(XENFEAT_auto_translated_physmap)) > + mcl_off =3D pages_done; > + else > + mcl_off =3D 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 !=3D 0 then the mmu update you do next will be incorrect) > + mcl =3D np->rx_mcl + mcl_off; > mcl->op =3D __HYPERVISOR_mmu_update; > mcl->args[0] =3D (unsigned long)np->rx_mmu; > mcl->args[1] =3D pages_done; > mcl->args[2] =3D 0; > mcl->args[3] =3D DOMID_SELF; > - (void)HYPERVISOR_multicall(np->rx_mcl, pages_done + 1); > + (void)HYPERVISOR_multicall(np->rx_mcl, mcl_off + 1); > } > =20 > while ((skb =3D __skb_dequeue(&errq))) Steven. --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQFE5fkZO4S8/gLNrjcRAmvJAJ9YilYNgaVamCIMKklORvjOIjwEkQCgx+w3 iIhusa1z+ugeGwyVKt5KBDY= =7mMY -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz-- --===============0780666835== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0780666835==--