From: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
George.Dunlap@eu.citrix.com, ian.jackson@eu.citrix.com,
P.Gawkowski@ii.pw.edu.pl, anthony.perard@citrix.com,
xen-devel@lists.xenproject.org, roger.pau@citrix.com
Subject: Re: [PATCH RESEND 1/4] libs, gnttab, libxc: Interface for grant copy operation
Date: Wed, 01 Jun 2016 13:42:03 +0200 [thread overview]
Message-ID: <1464781323.8602.45.camel@localhost> (raw)
In-Reply-To: <574EC56E.2080403@citrix.com>
On Wed, 2016-06-01 at 12:22 +0100, David Vrabel wrote:
> On 01/06/16 08:45, Paulina Szubarczyk wrote:
> > On Tue, 2016-05-31 at 10:25 +0100, David Vrabel wrote:
> >>
> >> On 31/05/2016 05:44, Paulina Szubarczyk wrote:
> >>>
> >>> Notification is yet not implemented.
> >>
> >> I'm not sure what you mean by "notifcation" here.
> > There is notify interface for grant map operations to communicate a
> > failure to the peer in case of teardown if the notify_port is given
> > to allow it to take care of resources. I have not checked yet how is it
> > used.
>
> This is not relevant for grant copy, since there's no mapping that
> persists after the grant copy call.
>
> >>> --- a/tools/libs/gnttab/gnttab_core.c
> >>> +++ b/tools/libs/gnttab/gnttab_core.c
> >>> @@ -113,6 +113,18 @@ int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count)
> >>> return osdep_gnttab_unmap(xgt, start_address, count);
> >>> }
> >>>
> >>> +int xengnttab_copy_grant(xengnttab_handle *xgt,
> >>> + uint32_t count,
> >>> + uint16_t *domids,
> >>> + uint32_t *refs,
> >>> + void **bufs,
> >>> + uint32_t *offset,
> >>> + uint32_t *len,
> >>> + int type)
> >>
> >> This interface should match the ioctl which matches the hypercall. In
> >> particular the ioctl (and hypercall) allows copies to and from grant
> >> references in the same call and returns a per-op status.
> >>
> > I followed the pattern of declaration for the grant map in this file
> > which as I believe is generic due to the use of it by both linux and
> > mini-os.
>
> The library needs to expose all the functionality of the grant copy
> hypercall which includes having different ops in the call copying in
> different directions.
>
> > The header with 'struct ioctl_gntdev_copy_segment' is linked only to the
> > linux part which issues the hypercall by gntdev, whereas mini-os does
> > not use gntdev it is not accessible at the higher level.
>
> The library should provide its own structure that happens to look like
> the structure for the Linux ioctl.
>
> The (future) minios implementation can use the same structure.
>
> I think you will also find that the user of this API would prefer to
> deal with a single array of xengnttab_copy_segment_t's instead of the 5
> different arrays currently needed.
Ok, it will be changed.
> >> Using the same structure in libxc would also allow you to a) remove the
> >> memory allocations; and b) avoid having to fill in a different structure.
> >>
> >> I would suggest:
> >>
> >> int xengnttab_copy_grant(xengnttab_handle *xgt,
> >> unsigned int count,
> >> xengnttab_copy_segment_t *segs);
> >>
> >> With:
> >>
> >> typedef struct ioctl_gntdev_copy_segment xengnttab_copy_segment_t;
> >>
> >> You should put the required struct ioctl_gntdev_grant_copy on the stack
> >> since it is small.
>
> David
>
Paulina
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-06-01 11:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 4:44 [PATCH RESEND 0/4] qemu-qdisk: Replace grant map by grant copy Paulina Szubarczyk
2016-05-31 4:44 ` [PATCH RESEND 1/4] libs, gnttab, libxc: Interface for grant copy operation Paulina Szubarczyk
2016-05-31 9:25 ` David Vrabel
2016-06-01 7:45 ` Paulina Szubarczyk
2016-06-01 11:22 ` David Vrabel
2016-06-01 11:42 ` Paulina Szubarczyk [this message]
2016-06-02 9:37 ` Roger Pau Monné
2016-06-06 14:47 ` Wei Liu
2016-05-31 4:44 ` [PATCH RESEND 2/4] qdisk, hw/block/xen_disk: Removal of grant mapping Paulina Szubarczyk
2016-05-31 9:26 ` David Vrabel
2016-06-02 9:41 ` Roger Pau Monné
2016-06-02 9:57 ` Paulina Szubarczyk
2016-06-02 10:22 ` David Vrabel
2016-05-31 4:44 ` [PATCH RESEND 3/4] qdisk, hw/block/xen_disk: Perform grant copy instead of grant map Paulina Szubarczyk
2016-05-31 9:37 ` David Vrabel
2016-06-01 7:52 ` Paulina Szubarczyk
2016-06-01 11:15 ` David Vrabel
2016-06-02 13:47 ` Roger Pau Monné
2016-05-31 4:44 ` [PATCH RESEND 4/4] qemu-xen-dir/hw/block: Cache local buffers used in grant copy Paulina Szubarczyk
2016-06-02 14:19 ` Roger Pau Monné
2016-06-07 13:13 ` 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=1464781323.8602.45.camel@localhost \
--to=paulinaszubarczyk@gmail.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=P.Gawkowski@ii.pw.edu.pl \
--cc=anthony.perard@citrix.com \
--cc=david.vrabel@citrix.com \
--cc=ian.jackson@eu.citrix.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).