From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v3 0/2] block/xen-blkfront: Support non-indirect grant with 64KB page granularity Date: Tue, 1 Dec 2015 13:52:45 -0500 Message-ID: <20151201185245.GB27063@char.us.oracle.com> References: <1447873045-14663-1-git-send-email-julien.grall@citrix.com> <20151201153751.GE19885@char.us.oracle.com> <565DDF24.4000104@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TB36FDmn/VVEgNH/" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a3q2q-0005mc-7T for xen-devel@lists.xenproject.org; Tue, 01 Dec 2015 18:52:56 +0000 Content-Disposition: inline In-Reply-To: <565DDF24.4000104@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, Boris Ostrovsky , Roger Pau =?iso-8859-1?Q?Monn=E9?= , linux-kernel@vger.kernel.org, David Vrabel List-Id: xen-devel@lists.xenproject.org --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 01, 2015 at 05:55:48PM +0000, Julien Grall wrote: > Hi Konrad, > > On 01/12/15 15:37, Konrad Rzeszutek Wilk wrote: > > On Wed, Nov 18, 2015 at 06:57:23PM +0000, Julien Grall wrote: > >> Hi all, > >> > >> This is a follow-up on the previous discussion [1] related to guest using 64KB > >> page granularity which doesn't boot when the backend isn't using indirect > >> descriptor. > >> > >> This has been successfully tested on ARM64 with both 64KB and 4KB page > >> granularity guests and QEMU as the backend. Indeed QEMU doesn't support > >> indirect descriptor. > >> > >> This series is based on xentip/for-linus-4.4 which include the support for > >> 64KB Linux guest. > > > > In the meantime the multi-queue patches have been put in the queue > > > > git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git #devel/for-jens-4.5 > > > > I will try rebasing the patches on top of that. > > It will likely clash with the multiqueue changes. I will rebase this > patch series and resend it. I got patch #1 ported over (see attached). Testing it now. > > Regards, > > -- > Julien Grall --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="0001-block-xen-blkfront-Introduce-blkif_ring_get_request.patch" Content-Transfer-Encoding: quoted-printable >From ebbda22e54e6557188298a3e1d6c0dcf4b04da26 Mon Sep 17 00:00:00 2001 From: Julien Grall Date: Wed, 18 Nov 2015 18:57:24 +0000 Subject: [PATCH] block/xen-blkfront: Introduce blkif_ring_get_request MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit The code to get a request is always the same. Therefore we can factorize it in a single function. Signed-off-by: Julien Grall Acked-by: Roger Pau Monn=E9 Signed-off-by: Konrad Rzeszutek Wilk --- drivers/block/xen-blkfront.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 4f77d36..38af260 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -481,6 +481,24 @@ static int blkif_ioctl(struct block_device *bdev, fm= ode_t mode, return 0; } =20 +static unsigned long blkif_ring_get_request(struct blkfront_ring_info *r= info, + struct request *req, + struct blkif_request **ring_req) +{ + unsigned long id; + struct blkfront_info *info =3D rinfo->dev_info; + + *ring_req =3D RING_GET_REQUEST(&rinfo->ring, rinfo->ring.req_prod_pvt); + rinfo->ring.req_prod_pvt++; + + id =3D get_id_from_freelist(rinfo); + rinfo->shadow[id].request =3D req; + + (*ring_req)->u.rw.id =3D id; + + return id; +} + static int blkif_queue_discard_req(struct request *req, struct blkfront_= ring_info *rinfo) { struct blkfront_info *info =3D rinfo->dev_info; @@ -488,9 +506,7 @@ static int blkif_queue_discard_req(struct request *re= q, struct blkfront_ring_inf unsigned long id; =20 /* Fill out a communications ring structure. */ - ring_req =3D RING_GET_REQUEST(&rinfo->ring, rinfo->ring.req_prod_pvt); - id =3D get_id_from_freelist(rinfo); - rinfo->shadow[id].request =3D req; + id =3D blkif_ring_get_request(rinfo, req, &ring_req); =20 ring_req->operation =3D BLKIF_OP_DISCARD; ring_req->u.discard.nr_sectors =3D blk_rq_sectors(req); @@ -501,8 +517,6 @@ static int blkif_queue_discard_req(struct request *re= q, struct blkfront_ring_inf else ring_req->u.discard.flag =3D 0; =20 - rinfo->ring.req_prod_pvt++; - /* Keep a private copy so we can reissue requests when recovering. */ rinfo->shadow[id].req =3D *ring_req; =20 @@ -635,9 +649,7 @@ static int blkif_queue_rw_req(struct request *req, st= ruct blkfront_ring_info *ri } =20 /* Fill out a communications ring structure. */ - ring_req =3D RING_GET_REQUEST(&rinfo->ring, rinfo->ring.req_prod_pvt); - id =3D get_id_from_freelist(rinfo); - rinfo->shadow[id].request =3D req; + id =3D blkif_ring_get_request(rinfo, req, &ring_req); =20 BUG_ON(info->max_indirect_segments =3D=3D 0 && GREFS(req->nr_phys_segments) > BLKIF_MAX_SEGMENTS_PER_REQUEST); @@ -716,8 +728,6 @@ static int blkif_queue_rw_req(struct request *req, st= ruct blkfront_ring_info *ri if (setup.segments) kunmap_atomic(setup.segments); =20 - rinfo->ring.req_prod_pvt++; - /* Keep a private copy so we can reissue requests when recovering. */ rinfo->shadow[id].req =3D *ring_req; =20 --=20 2.1.0 --TB36FDmn/VVEgNH/ 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.xen.org http://lists.xen.org/xen-devel --TB36FDmn/VVEgNH/--