xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>,
	xen-devel@lists.xenproject.org, roger.pau@citrix.com
Cc: anthony.perard@citrix.com, ian.jackson@eu.citrix.com,
	sstabellini@kernel.org, wei.liu2@citrix.com,
	P.Gawkowski@ii.pw.edu.pl
Subject: Re: [PATCH v2 2/2] qdisk - hw/block/xen_disk: grant copy implementation
Date: Mon, 13 Jun 2016 11:15:28 +0100	[thread overview]
Message-ID: <575E87C0.5030609@citrix.com> (raw)
In-Reply-To: <1465811036-17026-3-git-send-email-paulinaszubarczyk@gmail.com>

On 13/06/16 10:43, Paulina Szubarczyk wrote:
> Copy data operated on during request from/to local buffers to/from 
> the grant references. 
> 
> Before grant copy operation local buffers must be allocated what is 
> done by calling ioreq_init_copy_buffers. For the 'read' operation, 
> first, the qemu device invokes the read operation on local buffers 
> and on the completion grant copy is called and buffers are freed. 
> For the 'write' operation grant copy is performed before invoking 
> write by qemu device. 
> 
> A new value 'feature_grant_copy' is added to recognize when the 
> grant copy operation is supported by a guest. 
> The body of the function 'ioreq_runio_qemu_aio' is moved to 
> 'ioreq_runio_qemu_aio_blk' and in the 'ioreq_runio_qemu_aio' depending
> on the support for grant copy according checks, initialization, grant 
> operation are made, then the 'ioreq_runio_qemu_aio_blk' function is 
> called. 

I think you should add an option to force the use of grant mapping even
if copy support is detected.  If future changes to the grant map
infrastructure makes it faster or if grant map scales better in some
systems, then it would be useful to be able to use it.

> +    rc = xc_gnttab_grant_copy(gnt, count, segs);
> +
> +    if (rc) {
> +        xen_be_printf(&ioreq->blkdev->xendev, 0, 
> +                      "failed to copy data %d \n", rc);

I don't think you want to log anything here.  A guest could spam the
logs by repeatedly submitting requests with (for example) bad grant
references.

> +        ioreq->aio_errors++;
> +        r = -1; goto out;

return -1;

> @@ -1020,10 +1163,18 @@ static int blk_connect(struct XenDevice *xendev)
>  
>      xen_be_bind_evtchn(&blkdev->xendev);
>  
> +    xc_gnttab_grant_copy_segment_t seg;
> +    blkdev->feature_grant_copy = 
> +                (xc_gnttab_grant_copy(blkdev->xendev.gnttabdev, 0, &seg) == 0);

You can pass NULL for the segments here.

> +
> +    xen_be_printf(&blkdev->xendev, 3, "GRANT COPY %s\n", 
> +                  blkdev->feature_grant_copy ? "ENABLED" : "DISABLED");
> +
>      xen_be_printf(&blkdev->xendev, 1, "ok: proto %s, ring-ref %d, "
>                    "remote port %d, local port %d\n",
>                    blkdev->xendev.protocol, blkdev->ring_ref,
>                    blkdev->xendev.remote_port, blkdev->xendev.local_port);
> +
>      return 0;
>  }

David


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-06-13 10:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13  9:43 [PATCH v2 0/2] qemu-qdisk: Implementation of grant copy operation Paulina Szubarczyk
2016-06-13  9:43 ` [PATCH v2 1/2] libs, libxc: Interface for " Paulina Szubarczyk
2016-06-13 10:04   ` David Vrabel
2016-06-16 12:16   ` Wei Liu
2016-06-16 12:36     ` David Vrabel
2016-06-16 12:50       ` Wei Liu
2016-06-17 16:43     ` Wei Liu
2016-06-17 17:27       ` Paulina Szubarczyk
2016-06-13  9:43 ` [PATCH v2 2/2] qdisk - hw/block/xen_disk: grant copy implementation Paulina Szubarczyk
2016-06-13 10:15   ` David Vrabel [this message]
2016-06-13 10:44     ` Paulina Szubarczyk
2016-06-13 10:58       ` David Vrabel
2016-06-15 16:55         ` Paulina Szubarczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=575E87C0.5030609@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=P.Gawkowski@ii.pw.edu.pl \
    --cc=anthony.perard@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=paulinaszubarczyk@gmail.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).