From: Cornelia Huck <cohuck@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Yuval Shaia <yuval.shaia.ml@gmail.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH RFC] pvrdma: wean code off pvrdma_ring.h kernel header
Date: Tue, 9 Feb 2021 08:40:36 +0100 [thread overview]
Message-ID: <20210209084036.582311ad.cohuck@redhat.com> (raw)
In-Reply-To: <20210208132844-mutt-send-email-mst@kernel.org>
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?
next prev parent reply other threads:[~2021-02-09 8:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-22 18:00 [PATCH RFC] pvrdma: wean code off pvrdma_ring.h kernel header Cornelia Huck
2021-01-29 15:27 ` Cornelia Huck
2021-02-08 17:17 ` Cornelia Huck
2021-02-08 17:28 ` Paolo Bonzini
2021-02-09 3:47 ` Jason Wang
2021-02-22 8:33 ` Marcel Apfelbaum
2021-02-22 8:40 ` Jason Wang
2021-02-08 18:29 ` Michael S. Tsirkin
2021-02-09 7:40 ` Cornelia Huck [this message]
2021-02-10 8:56 ` Yuval Shaia
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=20210209084036.582311ad.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yuval.shaia.ml@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.