Thanks Florin,

It works fine now. :)
And two more questions:
1. Will eventfd replace the condvar way? it will be the default way for
event queue?
2. Will socket api replace the vpe api in the future?

Thanks!

/Yalei

Florin Coras <fcoras.li...@gmail.com> 于2018年8月15日周三 下午11:29写道:

> Hi Yalei,
>
> You definitely need api-socket-name /run/vpp-api.sock, don’t comment that
> out :-). If that’s not enabled, you can’t exchange file descriptors.
>
> Florin
>
> On Aug 15, 2018, at 5:43 AM, 汪亚雷 <wyland...@gmail.com> wrote:
>
> looks like  APP not attach to the segment vpp created like /dev/shm/$pid
>
> I think maybe need add the related ssvm_segment_attach in L125
> in vl_api_application_attach_reply_t_handler, not sure, will test it.
>
> wylandrea <wyland...@gmail.com> 于2018年8月15日周三 下午12:10写道:
>
>> Thanks, Florin!  I tried, but unfortunately got segment fault like
>> below(pull from master today):
>>
>> The segfault caused by the mq=0x204005440, the addr could not be refered
>> in APP side,  looks like  the address is alloc in segment_manager_init
>> L293,
>>
>> I used the example vcl.conf you provided, just comments the line
>> "api-socket-name /run/vpp-api.sock".
>>
>> ==================================
>>
>> VCL<23469>: configured VCL debug level (4) from VCL_DEBUG!
>> VCL<23469>: allocated VCL heap = 0x7fffe0000010, size 268435456
>> (0x10000000)
>> VCL<23469>: configured app_scope_local (1)
>> VCL<23469>: configured app_scope_global (1)
>> VCL<23469>: configured with mq with eventfd
>> VCL<23469>: completed parsing vppcom config!
>> vppcom_connect_to_vpp:803: VCL<23469>: app (ldp-23469-app) connecting to
>> VPP api (/vpe-api)...
>> [New Thread 0x7fffdffff700 (LWP 23474)]
>> vppcom_connect_to_vpp:819: VCL<23469>: app (ldp-23469-app) is connected
>> to VPP!
>> [New Thread 0x7fffdf7fe700 (LWP 23475)]
>> vppcom_app_create:714: VCL<23469>: sending session enable
>> vppcom_app_create:724: VCL<23469>: sending app attach
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> [Switching to Thread 0x7fffdffff700 (LWP 23474)]
>> 0x00007ffff510a403 in svm_msg_q_set_consumer_eventfd (mq=0x204005440,
>> fd=0) at /home/wenjiang/vpp/build-data/../src/svm/message_queue.c:242
>> 242       mq->q->consumer_evtfd = fd;
>> Missing separate debuginfos, use: debuginfo-install dpdk-18.05-1.x86_64
>> libgcc-4.8.5-28.el7_5.1.x86_64 libstdc++-4.8.5-28.el7_5.1.x86_64
>> numactl-libs-2.0.9-7.el7.x86_64
>> (gdb) bt
>> #0  0x00007ffff510a403 in svm_msg_q_set_consumer_eventfd (mq=0x204005440,
>> fd=0) at /home/wenjiang/vpp/build-data/../src/svm/message_queue.c:242
>> #1  0x00007ffff4fede84 in vl_api_application_attach_reply_t_handler
>> (mp=0x30066c40) at /home/wenjiang/vpp/build-data/../src/vcl/vcl_bapi.c:119
>> #2  0x00007ffff5111bba in msg_handler_internal (am=0x7ffff5360880
>> <api_main>, the_msg=0x30066c40, trace_it=0, do_it=1, free_it=1) at
>> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:425
>> #3  0x00007ffff5111e1a in vl_msg_api_handler (the_msg=0x30066c40) at
>> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:551
>> #4  0x00007ffff5113344 in vl_msg_api_queue_handler (q=0x30207ec0) at
>> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:762
>> #5  0x00007ffff5117f4e in rx_thread_fn (arg=0x0) at
>> /home/wenjiang/vpp/build-data/../src/vlibmemory/memory_client.c:94
>> #6  0x00007ffff763ce25 in start_thread (arg=0x7fffdffff700) at
>> pthread_create.c:308
>> #7  0x00007ffff715ebad in clone () at
>> ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
>>
>> ============================
>>
>> startup.conf
>> root@192.168.122.252:/home/wenjiang/dmm/release/bin (master) $ cat
>> ~/startup.conf
>> unix {
>>   #nodaemon
>>   interactive
>>   log /var/log/vpp/vpp.log
>>   cli-listen localhost:5002
>>   full-coredump
>> }
>>
>> api-trace {
>>   on
>> }
>>
>>
>> dpdk {
>>   socket-mem 1024
>>   dev 0000:00:09.0
>> }
>>
>> session { evt_qs_memfd_seg  }
>> #socksvr { socket-name /run/vpp-api.sock }
>>
>> ==================================
>> root@192.168.122.252:/home/wenjiang/dmm/release/bin (master) $ cat
>> /etc/vpp/vcl.conf
>> vcl {
>>   #rx-fifo-size 4000000
>>   #tx-fifo-size 4000000
>>   app-scope-local
>>   app-scope-global
>>   #api-socket-name /run/vpp-api.sock
>>   use-mq-eventfd
>> }
>>
>>
>>
>>
>>
>>
>> Florin Coras <fcoras.li...@gmail.com> 于2018年8月14日周二 下午11:15写道:
>>
>>> Hi Yalei,
>>>
>>> You have an example of how to write a vcl.conf file in
>>> vcl/vcl_test.conf. It’s just an example, so if you want to try out eventfd,
>>> here’s what I’ve been recently using:
>>>
>>> vcl {
>>>   rx-fifo-size 4000000
>>>   tx-fifo-size 4000000
>>>   app-scope-local
>>>   app-scope-global
>>>   api-socket-name /run/vpp-api.sock
>>>   use-mq-eventfd
>>> }
>>>
>>> For this to work, vpp must come up with the binary api socket transport
>>> configured and the session layer event queues must be allocated in a memfd
>>> segment. So, add the following to your vpp startup conf:
>>>
>>> socksvr { socket-name /run/vpp-api.sock }
>>> session { evt_qs_memfd_seg  }
>>>
>>> Also, to have vcl read your config file, remember to do something like:
>>> "export VCL_CONFIG=/path/to/your/file”. Finally, this is still very much
>>> ongoing work so if you hit any issues, do let me know :-)
>>>
>>> Hope this helps,
>>> Florin
>>>
>>> > On Aug 14, 2018, at 5:38 AM, 汪亚雷 <wyland...@gmail.com> wrote:
>>> >
>>> > Hi Florin,
>>> >
>>> > vppcom_cfg_read_file will try to parse the vcl.conf, but where could I
>>> get the example?
>>> >
>>> > actually I want to have a try "use-mq-eventfd"
>>> >
>>> > Thanks!
>>> >
>>> > /yalei
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>>
>> View/Reply Online (#10153): https://lists.fd.io/g/vpp-dev/message/10153
>> Mute This Topic: https://lists.fd.io/mt/24524596/675329
>> Group Owner: vpp-dev+ow...@lists.fd.io
>> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [wyland...@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10185): https://lists.fd.io/g/vpp-dev/message/10185
Mute This Topic: https://lists.fd.io/mt/24524596/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to