DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] Why kickfd from qemu is zero in qemu-dpdk vhost-user architecture?
@ 2018-07-15  7:27 杨晔
       [not found] ` <CAHckoCyTtv4GCbG-e5ckOkYJt9DKNW0q5CtvbUMTghDA=mX=Dg@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: 杨晔 @ 2018-07-15  7:27 UTC (permalink / raw)
  To: users

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 995 bytes --]

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)\x16º&}éà–+&j»qr‰’ºrn—^t÷žõóm5ñ\x17­º¹ÏjØ_zx%ŠÉš®Ü\¢d^qè¯y×ë¢išŠ\&Ñþx‚Š •ç(šf¢—	´\x7fž ¢ˆ%yÊ&ïvç͹Ἕ¥Ù(®\x03è²×âÇ\b­„DŒLø÷Žx\x13`Cñú+ºÇ«±Ú]’ŠàJéõ䛥ÛM|ÓÞ{×Ï´ÛM\x02\x11$ÑyÇ¢½ç[Êf¢—	´\x7fž ¢ˆ%yÊ&Â+aHÄωÜõÞþ¬£]¼ë½¼ç	šåú+ºÇ«±Ú]’ŠàJéõ䛥ÛM|ÓN{×Í;ÓCÃL2ˆ1( «n­ë

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] Why kickfd from qemu is zero in qemu-dpdk vhost-user architecture?
       [not found] ` <CAHckoCyTtv4GCbG-e5ckOkYJt9DKNW0q5CtvbUMTghDA=mX=Dg@mail.gmail.com>
@ 2018-07-15  8:21   ` 杨晔
       [not found]     ` <CAHckoCxefjEU9boiuB+-Z3Mp-ZzeoZtd-w7SQ8knJhK7n4xH=w@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: 杨晔 @ 2018-07-15  8:21 UTC (permalink / raw)
  To: Li Feng; +Cc: users

[-- 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òv—d¢¸\x0f¢Ë_‹\x1c"¶\x11\x1213ât\x1e5è=z\x11ú+ºÇ«±Ú]’ŠàJéõ䛥ÛM|×N=Óß´ÛM\x02\x11$ÑyÇ¢½ç[Êf¢—
õ\x7f`¢ˆ%yÊ&Â+aHÄωÛz¿«(ÛÏtómu¹û~Šî±êìv—d¢¸\x12º}y&évÓ_4׏t÷NôÐðÓ\f¢\fJ('jÛ«z

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] Why kickfd from qemu is zero in qemu-dpdk vhost-user architecture?
       [not found]     ` <CAHckoCxefjEU9boiuB+-Z3Mp-ZzeoZtd-w7SQ8knJhK7n4xH=w@mail.gmail.com>
@ 2018-07-15 10:16       ` 杨晔
  0 siblings, 0 replies; 3+ messages in thread
From: 杨晔 @ 2018-07-15 10:16 UTC (permalink / raw)
  To: Li Feng; +Cc: users

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" <fengli@smartx.com>
Sent Time:2018-07-15 16:49:08 (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?

I think you should add some logs at vhost initialization. And what's the error code when you call event fd?

2018年7月15日星期日,杨晔 <yangye@ict.ac.cn> 写道:



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)



--


Thanks,

Feng Li

  


手机:13401157876

Web:http://www.smartx.com/


地址:北京市海淀区科学院南路2号融科资讯中心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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-15 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-15  7:27 [dpdk-users] Why kickfd from qemu is zero in qemu-dpdk vhost-user architecture? 杨晔
     [not found] ` <CAHckoCyTtv4GCbG-e5ckOkYJt9DKNW0q5CtvbUMTghDA=mX=Dg@mail.gmail.com>
2018-07-15  8:21   ` 杨晔
     [not found]     ` <CAHckoCxefjEU9boiuB+-Z3Mp-ZzeoZtd-w7SQ8knJhK7n4xH=w@mail.gmail.com>
2018-07-15 10:16       ` 杨晔

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).