[dpdk-dev] Question about vhost user interrupt mode

Tiwei Bie tiwei.bie at intel.com
Wed Feb 26 02:51:10 CET 2020


On Tue, Feb 25, 2020 at 12:44:48PM -0800, Yifeng Sun wrote:
> >
> > +int rte_vhost_get_kickfd(int vid, uint16_t queue_id)

Introducing rte_vhost_get_kickfd() may not help much, we already
have rte_vhost_get_vhost_vring() to do that.

https://github.com/DPDK/dpdk/blob/d7142fbae16f/drivers/net/vhost/rte_eth_vhost.c#L628-L644

> > +{
> > +       struct virtio_net *dev;
> > +       struct vhost_virtqueue *vq;
> > +
> > +       dev = get_device(vid);
> > +       if (!dev)
> > +               return -1;
> > +
> > +       if (unlikely(!(dev->flags & VIRTIO_DEV_BUILTIN_VIRTIO_NET))) {
> > +               //  vhost net backend is disabled.
> > +               return -1;
> > +       }
> > +
> > +       if (unlikely(!is_valid_virt_queue_idx(queue_id, 1, dev->nr_vring))) {
> > +               return -1;
> > +       }
> > +
> > +       vq = dev->virtqueue[queue_id];
> > +       // XXX lock?
> > +       return vq->kickfd;
> > +}
> >
> > Best,
> > Yifeng Sun


More information about the dev mailing list