[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v3 3/8] xen: remove other open-coded use of libx
From: |
Paul Durrant |
Subject: |
Re: [Qemu-block] [PATCH v3 3/8] xen: remove other open-coded use of libxengnttab |
Date: |
Wed, 16 May 2018 14:22:59 +0000 |
> -----Original Message-----
> From: Anthony PERARD [mailto:address@hidden
> Sent: 16 May 2018 15:14
> To: Paul Durrant <address@hidden>
> Cc: address@hidden; address@hidden; qemu-
> address@hidden; Stefano Stabellini <address@hidden>; Greg Kurz
> <address@hidden>; Paolo Bonzini <address@hidden>; Jason Wang
> <address@hidden>; Gerd Hoffmann <address@hidden>
> Subject: Re: [PATCH v3 3/8] xen: remove other open-coded use of
> libxengnttab
>
> 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 <address@hidden>
> > ---
> > 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?
>
Yep.
> > 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?
>
And yep again.
> With that fix:
> Acked-by: Anthony PERARD <address@hidden>
>
Thanks :-)
Paul
> --
> Anthony PERARD
- [Qemu-block] [PATCH v3 0/8] xen_disk: legacy code removal and cleanup, Paul Durrant, 2018/05/04
- [Qemu-block] [PATCH v3 7/8] xen_disk: use a single entry iovec, Paul Durrant, 2018/05/04
- [Qemu-block] [PATCH v3 8/8] xen_disk: be consistent with use of xendev and blkdev->xendev, Paul Durrant, 2018/05/04
- [Qemu-block] [PATCH v3 5/8] xen_disk: remove use of grant map/unmap, Paul Durrant, 2018/05/04
- [Qemu-block] [PATCH v3 3/8] xen: remove other open-coded use of libxengnttab, Paul Durrant, 2018/05/04
- [Qemu-block] [PATCH v3 6/8] xen_backend: make the xen_feature_grant_copy flag private, Paul Durrant, 2018/05/04
- [Qemu-block] [PATCH v3 1/8] xen_backend: add grant table helpers, Paul Durrant, 2018/05/04
- [Qemu-block] [PATCH v3 2/8] xen_disk: remove open-coded use of libxengnttab, Paul Durrant, 2018/05/04
- [Qemu-block] [PATCH v3 4/8] xen_backend: add an emulation of grant copy, Paul Durrant, 2018/05/04