[v6,03/10] vhost: add the inflight structure

Message ID 20190829141224.49700-4-jin.yu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series vhost: support inflight share memory protocol feature |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail Compilation issues

Commit Message

Jin Yu Aug. 29, 2019, 2:12 p.m. UTC
  This patch adds the inflight queue region structure include
the split and packed.

Signed-off-by: Lin Li <lilin24@baidu.com>
Signed-off-by: Xun Ni <nixun@baidu.com>
Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
---
 lib/librte_vhost/rte_vhost.h | 43 ++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
  

Comments

Maxime Coquelin Sept. 6, 2019, 4:45 p.m. UTC | #1
On 8/29/19 4:12 PM, JinYu wrote:
> This patch adds the inflight queue region structure include
> the split and packed.
> 
> Signed-off-by: Lin Li <lilin24@baidu.com>
> Signed-off-by: Xun Ni <nixun@baidu.com>
> Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
> Signed-off-by: Jin Yu <jin.yu@intel.com>
> ---
>  lib/librte_vhost/rte_vhost.h | 43 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
> index 7257f0965..1d6b7a1cf 100644
> --- a/lib/librte_vhost/rte_vhost.h
> +++ b/lib/librte_vhost/rte_vhost.h
> @@ -102,6 +102,49 @@ struct rte_vhost_memory {
>  	struct rte_vhost_mem_region regions[];
>  };
>  
> +struct inflight_desc_split {

the struct names should be prefixed with rte_
as it is part of the API.

> +	uint8_t inflight;
> +	uint8_t padding[5];
> +	uint16_t next;
> +	uint64_t counter;
> +};
> +
> +struct inflight_info_split {
> +	uint64_t features;
> +	uint16_t version;
> +	uint16_t desc_num;
> +	uint16_t last_inflight_io;
> +	uint16_t used_idx;
> +	struct inflight_desc_split desc[0];
> +};
> +
> +struct inflight_desc_packed {
> +	uint8_t inflight;
> +	uint8_t padding;
> +	uint16_t next;
> +	uint16_t last;
> +	uint16_t num;
> +	uint64_t counter;
> +	uint16_t id;
> +	uint16_t flags;
> +	uint32_t len;
> +	uint64_t addr;
> +	};
> +
> +struct inflight_info_packed {
> +	uint64_t features;
> +	uint16_t version;
> +	uint16_t desc_num;
> +	uint16_t free_head;
> +	uint16_t old_free_head;
> +	uint16_t used_idx;
> +	uint16_t old_used_idx;
> +	uint8_t used_wrap_counter;
> +	uint8_t old_used_wrap_counter;
> +	uint8_t padding[7];
> +	struct inflight_desc_packed desc[0];
> +};
> +
>  struct rte_vhost_vring {
>  	union {
>  		struct vring_desc *desc;
>
  
Jin Yu Sept. 9, 2019, 3:04 a.m. UTC | #2
> -----Original Message-----
> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> Sent: Saturday, September 7, 2019 12:46 AM
> To: Yu, Jin <jin.yu@intel.com>; dev@dpdk.org
> Cc: Liu, Changpeng <changpeng.liu@intel.com>; Bie, Tiwei
> <tiwei.bie@intel.com>; Wang, Zhihong <zhihong.wang@intel.com>; Lin Li
> <lilin24@baidu.com>; Xun Ni <nixun@baidu.com>; Yu Zhang
> <zhangyu31@baidu.com>
> Subject: Re: [PATCH v6 03/10] vhost: add the inflight structure
> 
> 
> 
> On 8/29/19 4:12 PM, JinYu wrote:
> > This patch adds the inflight queue region structure include the split
> > and packed.
> >
> > Signed-off-by: Lin Li <lilin24@baidu.com>
> > Signed-off-by: Xun Ni <nixun@baidu.com>
> > Signed-off-by: Yu Zhang <zhangyu31@baidu.com>
> > Signed-off-by: Jin Yu <jin.yu@intel.com>
> > ---
> >  lib/librte_vhost/rte_vhost.h | 43
> > ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 43 insertions(+)
> >
> > diff --git a/lib/librte_vhost/rte_vhost.h
> > b/lib/librte_vhost/rte_vhost.h index 7257f0965..1d6b7a1cf 100644
> > --- a/lib/librte_vhost/rte_vhost.h
> > +++ b/lib/librte_vhost/rte_vhost.h
> > @@ -102,6 +102,49 @@ struct rte_vhost_memory {
> >  	struct rte_vhost_mem_region regions[];  };
> >
> > +struct inflight_desc_split {
> 
> the struct names should be prefixed with rte_ as it is part of the API.
Got it.
> 
> > +	uint8_t inflight;
> > +	uint8_t padding[5];
> > +	uint16_t next;
> > +	uint64_t counter;
> > +};
> > +
> > +struct inflight_info_split {
> > +	uint64_t features;
> > +	uint16_t version;
> > +	uint16_t desc_num;
> > +	uint16_t last_inflight_io;
> > +	uint16_t used_idx;
> > +	struct inflight_desc_split desc[0];
> > +};
> > +
> > +struct inflight_desc_packed {
> > +	uint8_t inflight;
> > +	uint8_t padding;
> > +	uint16_t next;
> > +	uint16_t last;
> > +	uint16_t num;
> > +	uint64_t counter;
> > +	uint16_t id;
> > +	uint16_t flags;
> > +	uint32_t len;
> > +	uint64_t addr;
> > +	};
> > +
> > +struct inflight_info_packed {
> > +	uint64_t features;
> > +	uint16_t version;
> > +	uint16_t desc_num;
> > +	uint16_t free_head;
> > +	uint16_t old_free_head;
> > +	uint16_t used_idx;
> > +	uint16_t old_used_idx;
> > +	uint8_t used_wrap_counter;
> > +	uint8_t old_used_wrap_counter;
> > +	uint8_t padding[7];
> > +	struct inflight_desc_packed desc[0]; };
> > +
> >  struct rte_vhost_vring {
> >  	union {
> >  		struct vring_desc *desc;
> >
  

Patch

diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
index 7257f0965..1d6b7a1cf 100644
--- a/lib/librte_vhost/rte_vhost.h
+++ b/lib/librte_vhost/rte_vhost.h
@@ -102,6 +102,49 @@  struct rte_vhost_memory {
 	struct rte_vhost_mem_region regions[];
 };
 
+struct inflight_desc_split {
+	uint8_t inflight;
+	uint8_t padding[5];
+	uint16_t next;
+	uint64_t counter;
+};
+
+struct inflight_info_split {
+	uint64_t features;
+	uint16_t version;
+	uint16_t desc_num;
+	uint16_t last_inflight_io;
+	uint16_t used_idx;
+	struct inflight_desc_split desc[0];
+};
+
+struct inflight_desc_packed {
+	uint8_t inflight;
+	uint8_t padding;
+	uint16_t next;
+	uint16_t last;
+	uint16_t num;
+	uint64_t counter;
+	uint16_t id;
+	uint16_t flags;
+	uint32_t len;
+	uint64_t addr;
+	};
+
+struct inflight_info_packed {
+	uint64_t features;
+	uint16_t version;
+	uint16_t desc_num;
+	uint16_t free_head;
+	uint16_t old_free_head;
+	uint16_t used_idx;
+	uint16_t old_used_idx;
+	uint8_t used_wrap_counter;
+	uint8_t old_used_wrap_counter;
+	uint8_t padding[7];
+	struct inflight_desc_packed desc[0];
+};
+
 struct rte_vhost_vring {
 	union {
 		struct vring_desc *desc;