qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Paul Durrant <paul.durrant@citrix.com>
Cc: xen-devel@lists.xenproject.org, qemu-block@nongnu.org,
	qemu-devel@nongnu.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Greg Kurz <groug@kaod.org>, Paolo Bonzini <pbonzini@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 3/8] xen: remove other open-coded use of libxengnttab
Date: Wed, 16 May 2018 15:14:24 +0100	[thread overview]
Message-ID: <20180516141424.GH2057@perard.uk.xensource.com> (raw)
In-Reply-To: <1525461967-32174-4-git-send-email-paul.durrant@citrix.com>

On Fri, May 04, 2018 at 08:26:02PM +0100, Paul Durrant wrote:
> Now that helpers are available in xen_backend, use them throughout all
> Xen PV backends.
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> ---
> diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
> index 20c43a6..73d6f1b 100644
> --- a/hw/net/xen_nic.c
> +++ b/hw/net/xen_nic.c
> @@ -160,9 +160,8 @@ static void net_tx_packets(struct XenNetDev *netdev)
>                            (txreq.flags & NETTXF_more_data)      ? " more_data"      : "",
>                            (txreq.flags & NETTXF_extra_info)     ? " extra_info"     : "");
>  
> -            page = xengnttab_map_grant_ref(netdev->xendev.gnttabdev,
> -                                           netdev->xendev.dom,
> -                                           txreq.gref, PROT_READ);
> +            page = xen_be_map_grant_refs(&netdev->xendev,
> +                                         &txreq.gref, 1, PROT_READ);

xen_be_map_grant_ref instead?

>              if (page == NULL) {
>                  xen_pv_printf(&netdev->xendev, 0,
>                                "error: tx gref dereference failed (%d)\n",
> @@ -183,7 +182,7 @@ static void net_tx_packets(struct XenNetDev *netdev)
>                  qemu_send_packet(qemu_get_queue(netdev->nic),
>                                   page + txreq.offset, txreq.size);
>              }
> -            xengnttab_unmap(netdev->xendev.gnttabdev, page, 1);
> +            xen_be_unmap_grant_ref(&netdev->xendev, page);
>              net_tx_response(netdev, &txreq, NETIF_RSP_OKAY);
>          }
>          if (!netdev->tx_work) {
> @@ -254,9 +253,8 @@ static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size
>      memcpy(&rxreq, RING_GET_REQUEST(&netdev->rx_ring, rc), sizeof(rxreq));
>      netdev->rx_ring.req_cons = ++rc;
>  
> -    page = xengnttab_map_grant_ref(netdev->xendev.gnttabdev,
> -                                   netdev->xendev.dom,
> -                                   rxreq.gref, PROT_WRITE);
> +    page = xen_be_map_grant_refs(&netdev->xendev, &rxreq.gref, 1,
> +                                 PROT_WRITE);

xen_be_map_grant_ref instead?

With that fix:
Acked-by: Anthony PERARD <anthony.perard@citrix.com>

-- 
Anthony PERARD

  reply	other threads:[~2018-05-16 14:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 19:25 [Qemu-devel] [PATCH v3 0/8] xen_disk: legacy code removal and cleanup Paul Durrant
2018-05-04 19:26 ` [Qemu-devel] [PATCH v3 1/8] xen_backend: add grant table helpers Paul Durrant
2018-05-16 13:50   ` Anthony PERARD
2018-05-16 14:00     ` Paul Durrant
2018-05-04 19:26 ` [Qemu-devel] [PATCH v3 2/8] xen_disk: remove open-coded use of libxengnttab Paul Durrant
2018-05-16 14:02   ` Anthony PERARD
2018-05-04 19:26 ` [Qemu-devel] [PATCH v3 3/8] xen: remove other " Paul Durrant
2018-05-16 14:14   ` Anthony PERARD [this message]
2018-05-16 14:22     ` Paul Durrant
2018-05-04 19:26 ` [Qemu-devel] [PATCH v3 4/8] xen_backend: add an emulation of grant copy Paul Durrant
2018-05-16 14:30   ` Anthony PERARD
2018-05-16 14:34     ` Paul Durrant
2018-05-04 19:26 ` [Qemu-devel] [PATCH v3 5/8] xen_disk: remove use of grant map/unmap Paul Durrant
2018-05-17 10:31   ` Anthony PERARD
2018-05-04 19:26 ` [Qemu-devel] [PATCH v3 6/8] xen_backend: make the xen_feature_grant_copy flag private Paul Durrant
2018-05-17 10:31   ` Anthony PERARD
2018-05-04 19:26 ` [Qemu-devel] [PATCH v3 7/8] xen_disk: use a single entry iovec Paul Durrant
2018-05-17 10:59   ` Anthony PERARD
2018-05-04 19:26 ` [Qemu-devel] [PATCH v3 8/8] xen_disk: be consistent with use of xendev and blkdev->xendev Paul Durrant
2018-05-17 11:07   ` Anthony PERARD

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=20180516141424.GH2057@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=groug@kaod.org \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=paul.durrant@citrix.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --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).