From: Yifeng Sun <pkusunyifeng@gmail.com>
To: Tiwei Bie <tiwei.bie@intel.com>
Cc: dev@dpdk.org, William Tu <u9012063@gmail.com>,
Maxime Coquelin <maxime.coquelin@redhat.com>,
zhihong.wang@intel.com, xiaolong.ye@intel.com
Subject: Re: [dpdk-dev] Question about vhost user interrupt mode
Date: Wed, 26 Feb 2020 09:26:41 -0800 [thread overview]
Message-ID: <CAEYOeXP1K9GBpq6yc2hXYSspdD6xDuDCoWEOgk9qNi1qKOjB8A@mail.gmail.com> (raw)
In-Reply-To: <20200226015110.GA32777@___>
Hi Tiwei,
Thanks a lot for your comment. I will take a look at rte_vhost_get_vhost_vring.
Best,
Yifeng
On Tue, Feb 25, 2020 at 5:51 PM Tiwei Bie <tiwei.bie@intel.com> wrote:
>
> 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
next prev parent reply other threads:[~2020-02-26 17:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-21 22:32 Yifeng Sun
2020-02-25 20:44 ` Yifeng Sun
2020-02-26 1:51 ` Tiwei Bie
2020-02-26 17:26 ` Yifeng Sun [this message]
2020-02-27 2:30 ` William Tu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEYOeXP1K9GBpq6yc2hXYSspdD6xDuDCoWEOgk9qNi1qKOjB8A@mail.gmail.com \
--to=pkusunyifeng@gmail.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=tiwei.bie@intel.com \
--cc=u9012063@gmail.com \
--cc=xiaolong.ye@intel.com \
--cc=zhihong.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).