I did understand what you mean. I'm familiar with vhost-user about storage.
I mean you could check the `errno`. Thanks, Feng Li 手机:13401157876 Web:http://www.smartx.com/ 地址:北京市海淀区科学院南路2号融科资讯中心C座北楼712 2018-07-15 18:16 GMT+08:00 杨晔 <[email protected]>: > Oh, I forgot to say that eventfd_read returns -1. > > But I don't think you understand what I mean. > > In vhost-user architecture. Backend(ovs-dpdk) communicates with > fronted(qemu) through two virtqueues by default. > > Every queue has a pair of eventfd. > > Kickfd is written by backend to notify frontend to process packets. And in > dpdk's code, it will write these kickfds when enque or dequeue is finished. > > Callfd is written by frontend to notify backend to process packets. But > dpdk uses polling mode and don't check these callfds. > > Now I just want to use these callfd written by frontend to notify in my > modified version. > > Here is the question. That seems frontend do not write callfds. Is it > disabled in qemu now? > > And how should I do to implement such fenture? > > > -----Original Messages----- > *From:*"Li Feng" <[email protected]> > *Sent Time:*2018-07-15 16:49:08 (Sunday) > > *To:* "杨晔" <[email protected]> > *Cc:* "[email protected]" <[email protected]> > *Subject:* Re: [dpdk-users] Why kickfd from qemu is zero in qemu-dpdk > vhost-user architecture? > > I think you should add some logs at vhost initialization. And what's the > error code when you call event fd? > > 2018年7月15日星期日,杨晔 <[email protected]> 写道: > >> >> 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 **pkt >> s, 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 v >> irtqueue 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" <[email protected]> >> *Sent Time:*2018-07-15 15:57:16 (Sunday) >> *To:* "杨晔" <[email protected]> >> *Cc:* "[email protected]" <[email protected]> >> *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号 >> <https://maps.google.com/?q=%E5%8C%97%E4%BA%AC%E5%B8%82%E6%B5%B7%E6%B7%80%E5%8C%BA%E7%A7%91%E5%AD%A6%E9%99%A2%E5%8D%97%E8%B7%AF2%E5%8F%B7&entry=gmail&source=g> >> 融科资讯中心C座北楼712 >> >> 2018-07-15 15:27 GMT+08:00 杨晔 <[email protected]>: >> >>> 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 >>> <https://maps.google.com/?q=6+Kexueyuan+South+Road,+Zhongguancun,+Haidian+District,+Beijing,+China+(100190&entry=gmail&source=g> >>> ) >> >> >> >> 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 >> <https://maps.google.com/?q=6+Kexueyuan+South+Road,+Zhongguancun,+Haidian+District,+Beijing,+China+(100190&entry=gmail&source=g>) >> >> > > > -- > > Thanks, > > Feng Li > > > > 手机:13401157876 > > Web:http://www.smartx.com/ > > 地址:北京市海淀区科学院南路2号 > <https://maps.google.com/?q=%E5%8C%97%E4%BA%AC%E5%B8%82%E6%B5%B7%E6%B7%80%E5%8C%BA%E7%A7%91%E5%AD%A6%E9%99%A2%E5%8D%97%E8%B7%AF2%E5%8F%B7&entry=gmail&source=g> > 融科资讯中心C座北楼712 > > > 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 > <https://maps.google.com/?q=6+Kexueyuan+South+Road,+Zhongguancun,+Haidian+District,+Beijing,+China+(100190&entry=gmail&source=g>) > > -- 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)工作邮箱. 如本邮箱发出的邮件与工作无关,该邮件未得到本公司任何的明示或默示的授权.
