[PATCH v8 12/12] vhost: improve vDPA blk device configure condition
Pei, Andy
andy.pei at intel.com
Tue Oct 18 16:16:54 CEST 2022
Hi Maxime,
Thanks for your review.
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin at redhat.com>
> Sent: Tuesday, October 18, 2022 10:15 PM
> To: Pei, Andy <andy.pei at intel.com>; dev at dpdk.org
> Cc: Xia, Chenbo <Chenbo.Xia at intel.com>; Xu, Rosen <rosen.xu at intel.com>;
> Huang, Wei <wei.huang at intel.com>; Cao, Gang <gang.cao at intel.com>
> Subject: Re: [PATCH v8 12/12] vhost: improve vDPA blk device configure
> condition
>
>
>
> On 10/18/22 14:07, Andy Pei wrote:
> > To support multi-queue, configure device after call fd of all queues
> > are set.
> >
> > Signed-off-by: Andy Pei <andy.pei at intel.com>
> > Signed-off-by: Huang Wei <wei.huang at intel.com>
> > ---
> > lib/vhost/vhost_user.c | 13 ++++++++++---
> > 1 file changed, 10 insertions(+), 3 deletions(-)
> >
> > diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index
> > e0ff79d..9902ae9 100644
> > --- a/lib/vhost/vhost_user.c
> > +++ b/lib/vhost/vhost_user.c
> > @@ -2972,6 +2972,7 @@ static int is_vring_iotlb(struct virtio_net *dev,
> > bool handled;
> > uint32_t request;
> > uint32_t i;
> > + uint16_t blk_call_fd;
> >
> > dev = get_device(vid);
> > if (dev == NULL)
> > @@ -3181,9 +3182,15 @@ static int is_vring_iotlb(struct virtio_net *dev,
> > if (!vdpa_dev)
> > goto out;
> >
> > - if (vdpa_dev->type == RTE_VHOST_VDPA_DEVICE_TYPE_BLK
> > - && request != VHOST_USER_SET_VRING_CALL)
> > - goto out;
> > + if (vdpa_dev->type == RTE_VHOST_VDPA_DEVICE_TYPE_BLK) {
> > + if (request == VHOST_USER_SET_VRING_CALL) {
> > + blk_call_fd = ctx.msg.payload.u64 &
> VHOST_USER_VRING_IDX_MASK;
> > + if (blk_call_fd != dev->nr_vring - 1)
> > + goto out;
> > + } else {
> > + goto out;
> > + }
> > + }
> >
> > if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) {
> > if (vdpa_dev->ops->dev_conf(dev->vid))
>
> Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
>
> Thanks,
> Maxime
More information about the dev
mailing list