From: 杨晔 <yangye@ict.ac.cn>
To: "Li Feng" <fengli@smartx.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] Why kickfd from qemu is zero in qemu-dpdk vhost-user architecture?
Date: Sun, 15 Jul 2018 16:21:13 +0800 (GMT+08:00) [thread overview]
Message-ID: <646bcf27.16b17.1649d0785f5.Coremail.yangye@ict.ac.cn> (raw)
In-Reply-To: <CAHckoCyTtv4GCbG-e5ckOkYJt9DKNW0q5CtvbUMTghDA=mX=Dg@mail.gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 3397 bytes --]
Sure.
Here is my code. In virtio_net.c of dpdk.
uint16_t
rte_vhost_dequeue_burst(int vid, uint16_t queue_id,
struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count)
{
...
struct virtio_net *dev;
struct rte_mbuf *rarp_mbuf = NULL;
struct vhost_virtqueue *vq;
uint32_t desc_indexes[MAX_PKT_BURST];
uint32_t used_idx;
uint32_t i = 0;
uint16_t free_entries;
uint16_t avail_idx;
dev = get_device(vid);
if (!dev)
return 0;
if (unlikely(!is_valid_virt_queue_idx(queue_id, 1, dev->nr_vring))) {
RTE_LOG(ERR, VHOST_DATA, "(%d) %s: invalid virtqueue idx %d.\n",
dev->vid, __func__, queue_id);
return 0;
}
vq = dev->virtqueue[queue_id];
uint64_t val = 0;
int res = eventfd_read(vq->kickfd,&val);
if(res != 0)
{
RTE_LOG(INFO, VHOST_DATA, "res:(%d)\n", res);
return 0;
}
if(val > 0)
RTE_LOG(INFO, VHOST_DATA, "(%llu)\n", val);
else
return 0;
}
I just want to use the kickfd from qemu and guest kernel, and change backend DPDK'mode from polling to interrupt.
-----Original Messages-----
From:"Li Feng" <fengli@smartx.com>
Sent Time:2018-07-15 15:57:16 (Sunday)
To: "æ¨æ" <yangye@ict.ac.cn>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] Why kickfd from qemu is zero in qemu-dpdk vhost-user architecture?
You could paste some code here.
Is the eventfd is valid when passing to vhost?
Maybe the eventfd is bad.
Thanks,
Feng Li
ææºï¼13401157876
Webï¼http://www.smartx.com/
å°åï¼å京å¸æµ·æ·åºç§å¦é¢åè·¯2å·èç§èµè®¯ä¸å¿C座å楼712
2018-07-15 15:27 GMT+08:00 æ¨æ <yangye@ict.ac.cn>:
Hello,
I use the "vhost-user" mode in the qemu, and the backend is the dpdk-vhost.
But when I use the eventfd_read(vq->kickfd,&val) function. It always return an error, and the val has always been 0.
The kickfd is the eventfd that passing from qemu to vhost when the vring is set up and calling the vhost_user_set_vring_kick function.
It should be a none-zero value when there are packets in the sending queue.
The virtio-frontend should notify the backend then do the dequeue operation.
Does anyone know about this? I am looking forward to your reply.
Thank you.
--
Yang Ye
Network Research Center, Institute of Computing Technology, Chinese Academy of Sciences,
NO.6 Kexueyuan South Road, Zhongguancun, Haidian District, Beijing, China (100190)
The SmartX email address is only for business purpose. Any sent message that is not related to the business is not authorized or permitted by SmartX.
æ¬é®ç®±ä¸ºå京å¿å海纳ç§ææéå
¬å¸ï¼SmartXï¼å·¥ä½é®ç®±. å¦æ¬é®ç®±ååºçé®ä»¶ä¸å·¥ä½æ å
³,该é®ä»¶æªå¾å°æ¬å
¬å¸ä»»ä½çæ示æé»ç¤ºçææ.
--
Yang Ye
Network Research Center, Institute of Computing Technology, Chinese Academy of Sciences,
NO.6 Kexueyuan South Road, Zhongguancun, Haidian District, Beijing, China (100190)\x16º&}éà+&j»qrºrn^uÓt÷m5ñ\x17º¹ÏjØ_zx%É®Ü\¢d^qè¯y×ë¢i\+Õþu ç(f¢
õ\x7f`¢%yÊ&ÛO|çmµçVòvd¢¸\x0f¢Ë_\x1c"¶\x11\x1213ât\x1e5è=z\x11ú+ºÇ«±Ú]àJéõä¥ÛM|×N=Óß´ÛM\x02\x11$ÑyÇ¢½ç[Êf¢
õ\x7f`¢%yÊ&Â+aHÄÏÛz¿«(ÛÏtómu¹û~î±êìvd¢¸\x12º}y&évÓ_4×t÷NôÐðÓ\f¢\fJ('jÛ«z
next prev parent reply other threads:[~2018-07-15 8:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-15 7:27 杨晔
[not found] ` <CAHckoCyTtv4GCbG-e5ckOkYJt9DKNW0q5CtvbUMTghDA=mX=Dg@mail.gmail.com>
2018-07-15 8:21 ` 杨晔 [this message]
[not found] ` <CAHckoCxefjEU9boiuB+-Z3Mp-ZzeoZtd-w7SQ8knJhK7n4xH=w@mail.gmail.com>
2018-07-15 10:16 ` 杨晔
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=646bcf27.16b17.1649d0785f5.Coremail.yangye@ict.ac.cn \
--to=yangye@ict.ac.cn \
--cc=fengli@smartx.com \
--cc=users@dpdk.org \
/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).