[v5,02/11] net/virtio: add virtio 1.1 defines

Message ID 20180906181947.20646-3-jfreimann@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series implement packed virtqueues |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK

Commit Message

Jens Freimann Sept. 6, 2018, 6:19 p.m. UTC
  Signed-off-by: Jens Freimann <jfreimann@redhat.com>
---
 drivers/net/virtio/virtio_ring.h | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Gavin Hu Sept. 10, 2018, 5:22 a.m. UTC | #1
The following 1.1 new defines should be added in this patch or the parent patch.
VIRTIO_F_IO_BARRIER
VIRTIO_F_SR_IOV

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Jens Freimann
> Sent: Friday, September 7, 2018 2:20 AM
> To: dev@dpdk.org
> Cc: tiwei.bie@intel.com; maxime.coquelin@redhat.com
> Subject: [dpdk-dev] [PATCH v5 02/11] net/virtio: add virtio 1.1 defines
>
> Signed-off-by: Jens Freimann <jfreimann@redhat.com>
> ---
>  drivers/net/virtio/virtio_ring.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h
> index cea4d441e..e2c597434 100644
> --- a/drivers/net/virtio/virtio_ring.h
> +++ b/drivers/net/virtio/virtio_ring.h
> @@ -15,7 +15,11 @@
>  #define VRING_DESC_F_WRITE      2
>  /* This means the buffer contains a list of buffer descriptors. */
>  #define VRING_DESC_F_INDIRECT   4
> +/* This flag means the descriptor was made available by the driver */
>
> +#define VRING_DESC_F_AVAIL(b)   ((uint16_t)(b) << 7)
> +/* This flag means the descriptor was used by the device */
> +#define VRING_DESC_F_USED(b)    ((uint16_t)(b) << 15)
>  /* The Host uses this in used->flags to advise the Guest: don't kick me
>   * when you add a buffer.  It's unreliable, so it's simply an
>   * optimization.  Guest will still kick if it's out of buffers. */
> --
> 2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
  
Tiwei Bie Sept. 10, 2018, 6:07 a.m. UTC | #2
On Mon, Sep 10, 2018 at 05:22:43AM +0000, Gavin Hu (Arm Technology China) wrote:
> The following 1.1 new defines should be added in this patch or the parent patch.
> VIRTIO_F_IO_BARRIER
> VIRTIO_F_SR_IOV

I don't think we should introduce these defines in this patch
or this series. This series should focus on packed ring. And
the title of this patch should be something about packed ring
instead of virtio 1.1.

Thanks

> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Jens Freimann
> > Sent: Friday, September 7, 2018 2:20 AM
> > To: dev@dpdk.org
> > Cc: tiwei.bie@intel.com; maxime.coquelin@redhat.com
> > Subject: [dpdk-dev] [PATCH v5 02/11] net/virtio: add virtio 1.1 defines
> >
> > Signed-off-by: Jens Freimann <jfreimann@redhat.com>
> > ---
> >  drivers/net/virtio/virtio_ring.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h
> > index cea4d441e..e2c597434 100644
> > --- a/drivers/net/virtio/virtio_ring.h
> > +++ b/drivers/net/virtio/virtio_ring.h
> > @@ -15,7 +15,11 @@
> >  #define VRING_DESC_F_WRITE      2
> >  /* This means the buffer contains a list of buffer descriptors. */
> >  #define VRING_DESC_F_INDIRECT   4
> > +/* This flag means the descriptor was made available by the driver */
> >
> > +#define VRING_DESC_F_AVAIL(b)   ((uint16_t)(b) << 7)
> > +/* This flag means the descriptor was used by the device */
> > +#define VRING_DESC_F_USED(b)    ((uint16_t)(b) << 15)
> >  /* The Host uses this in used->flags to advise the Guest: don't kick me
> >   * when you add a buffer.  It's unreliable, so it's simply an
> >   * optimization.  Guest will still kick if it's out of buffers. */
> > --
> > 2.17.1
> 
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
  
Jens Freimann Sept. 11, 2018, 7:18 a.m. UTC | #3
On Mon, Sep 10, 2018 at 05:22:43AM +0000, Gavin Hu (Arm Technology China) wrote:
>The following 1.1 new defines should be added in this patch or the parent patch.
>VIRTIO_F_IO_BARRIER
>VIRTIO_F_SR_IOV

I think I should rename this patch to "add packed virtqueue defines"
instead. Above defines should be introduced in the appropriate patch
set. 

Thanks for the review!

regards,
Jens
  

Patch

diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h
index cea4d441e..e2c597434 100644
--- a/drivers/net/virtio/virtio_ring.h
+++ b/drivers/net/virtio/virtio_ring.h
@@ -15,7 +15,11 @@ 
 #define VRING_DESC_F_WRITE      2
 /* This means the buffer contains a list of buffer descriptors. */
 #define VRING_DESC_F_INDIRECT   4
+/* This flag means the descriptor was made available by the driver */
 
+#define VRING_DESC_F_AVAIL(b)   ((uint16_t)(b) << 7)
+/* This flag means the descriptor was used by the device */
+#define VRING_DESC_F_USED(b)    ((uint16_t)(b) << 15)
 /* The Host uses this in used->flags to advise the Guest: don't kick me
  * when you add a buffer.  It's unreliable, so it's simply an
  * optimization.  Guest will still kick if it's out of buffers. */