DPDK usage discussions
 help / color / mirror / Atom feed
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 18:16:26 +0800 (GMT+08:00)	[thread overview]
Message-ID: <300424fb.16d13.1649d710261.Coremail.yangye@ict.ac.cn> (raw)
In-Reply-To: <CAHckoCxefjEU9boiuB+-Z3Mp-ZzeoZtd-w7SQ8knJhK7n4xH=w@mail.gmail.com>

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)

      parent reply	other threads:[~2018-07-15 10:16 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   ` 杨晔
     [not found]     ` <CAHckoCxefjEU9boiuB+-Z3Mp-ZzeoZtd-w7SQ8knJhK7n4xH=w@mail.gmail.com>
2018-07-15 10:16       ` 杨晔 [this message]

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=300424fb.16d13.1649d710261.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).