qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC] pvrdma: wean code off pvrdma_ring.h kernel header


From: Cornelia Huck
Subject: Re: [PATCH RFC] pvrdma: wean code off pvrdma_ring.h kernel header
Date: Tue, 9 Feb 2021 08:40:36 +0100

On Mon, 8 Feb 2021 13:29:53 -0500
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Fri, Jan 22, 2021 at 07:00:29PM +0100, Cornelia Huck wrote:
> > The pvrdma code relies on the pvrdma_ring.h kernel header for some
> > basic ring buffer handling. The content of that header isn't very
> > exciting, but contains some (q)atomic_*() invocations that (a)
> > cause manual massaging when doing a headers update, and (b) are
> > an indication that we probably should not be importing that header
> > at all.
> > 
> > Let's reimplement the ring buffer handling directly in the pvrdma
> > code instead. This arguably also improves readability of the code.
> > 
> > Importing the header can now be dropped.
> > 
> > Signed-off-by: Cornelia Huck <cohuck@redhat.com>  
> 
> Given it's a single struct that we need, this is a good fix.
> How about adding a comment explaining where it came from,
> just in case rdma guys decide to export this in uapi properly?

> > diff --git a/hw/rdma/vmw/pvrdma_dev_ring.h b/hw/rdma/vmw/pvrdma_dev_ring.h
> > index 5f2a0cf9b9fa..d231588ce004 100644
> > --- a/hw/rdma/vmw/pvrdma_dev_ring.h
> > +++ b/hw/rdma/vmw/pvrdma_dev_ring.h
> > @@ -19,18 +19,23 @@
> >  
> >  #define MAX_RING_NAME_SZ 32
> >  

/* struct pvrdma_ring from drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h */

> > +typedef struct PvrdmaRingState {
> > +    int prod_tail; /* producer tail */
> > +    int cons_head; /* consumer head */
> > +} PvrdmaRingState;
> > +

I guess this can be folded in?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]