[dpdk-dev] [PATCH v7 10/10] vhost: add vhost-user-blk example which support inflight

Tiwei Bie tiwei.bie at intel.com
Thu Sep 26 16:40:29 CEST 2019


On Thu, Sep 26, 2019 at 10:29:19PM +0800, Yu, Jin wrote:
> > -----Original Message-----
> > From: Bie, Tiwei
> > Sent: Wednesday, September 25, 2019 10:46 PM
> > To: Yu, Jin <jin.yu at intel.com>
> > Cc: dev at dpdk.org; Liu, Changpeng <changpeng.liu at intel.com>;
> > maxime.coquelin at redhat.com; Wang, Zhihong <zhihong.wang at intel.com>
> > Subject: Re: [PATCH v7 10/10] vhost: add vhost-user-blk example which support
> > inflight
> > 
> > On Fri, Sep 20, 2019 at 08:01:02PM +0800, Jin Yu wrote:
> > > A vhost-user-blk example that support inflight feature. It uses the
> > > new APIs that introduced in the first patch, so It can show how there
> > 
> > s/It/it/
> > s/there/these/
> 
> Got it. Thanks.
> > 
> > > APIs work to support inflight feature.
> > >
> > > Signed-off-by: Jin Yu <jin.yu at intel.com>
> > > ---
> > > V1 - add the case.
> > > V2 - add the rte_vhost prefix.
> > > V3 - add packed ring support
> > > ---
> > >  examples/vhost_blk/Makefile           |   67 ++
> > >  examples/vhost_blk/blk.c              |  125 +++
> > >  examples/vhost_blk/blk_spec.h         |   95 ++
> > >  examples/vhost_blk/meson.build        |   20 +
> > >  examples/vhost_blk/vhost_blk.c        | 1313 +++++++++++++++++++++++++
> > >  examples/vhost_blk/vhost_blk.h        |  116 +++
> > >  examples/vhost_blk/vhost_blk_compat.c |  195 ++++
> > >  7 files changed, 1931 insertions(+)
> > 
> > I met some build issues when trying this example.
> > 
> > examples/vhost_blk/vhost_blk.c: In function ‘descriptor_get_next_packed’:
> > examples/vhost_blk/vhost_blk.c:71:21: error: invalid use of undefined type
> > ‘struct vring_packed_desc’
> >   if (vq->desc_packed[*idx % vq->size].flags & VIRTQ_DESC_F_NEXT) {
> >                      ^
> > examples/vhost_blk/vhost_blk.c:71:21: error: dereferencing pointer to
> > incomplete type ‘struct vring_packed_desc’
> > examples/vhost_blk/vhost_blk.c:73:26: error: invalid use of undefined type
> > ‘struct vring_packed_desc’
> >    return &vq->desc_packed[*idx % vq->size];
> 
> The new version of virtio_ring.h have defined the vring_packed_desc.
> For the compatibility, I will add the definition in the rte_vhost.h.

No. They should be added in this example instead of
the vhost API.

> Thanks.
> 
> >                           ^
> > examples/vhost_blk/vhost_blk.c: In function
> > ‘inflight_submit_completion_packed’:
> > examples/vhost_blk/vhost_blk.c:165:2: warning:
> > ‘rte_vhost_set_last_inflight_io_packed’ is deprecated: Symbol is not yet part of
> > stable ABI [-Wdeprecated-declarations]
> 
> Should I ignore this warning? I'm not sure about this.
> The reason is the _rte_experiment keyword?

You need something like this:

https://github.com/DPDK/dpdk/blob/bd253daa7717835f88bbc58b09a94d0060380396/examples/vhost/Makefile#L29
https://github.com/DPDK/dpdk/blob/bd253daa7717835f88bbc58b09a94d0060380396/examples/vhost/meson.build#L13


> Thanks.
> >   ret = rte_vhost_set_last_inflight_io_packed(ctrlr->bdev->vid, q_idx,
> >   ^~~
> > In file included from examples/vhost_blk/vhost_blk.c:17:0:
> > x86_64-native-linuxapp-gcc/include/rte_vhost.h:810:1: note: declared here
> > rte_vhost_set_last_inflight_io_packed(int vid,
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >                          ^
> > ...


More information about the dev mailing list