Re: [vpp-dev] Where could I find the example of vcl.conf

2018-08-17 Thread wylandrea
Thanks! Got it!

/Yalei

Florin Coras  于2018年8月17日周五 上午12:00写道:

> Hi Yalei,
>
> Great! For now, I’m planning on keeping both the condvars and eventfds, at
> least until we completely understand the performance implications.
>
> As for your second question, the session layer will probably at one point
> start requesting that all attachments be done over the socket transport of
> the binary api. Note however that the socket transport is only used for
> bootstrapping the memfd shared memory segments and exchanging file
> descriptors. In other words, binary api exchanges between vcl/apps and vpp
> are still done over shared memory event queues.
>
> Cheers,
> Florin
>
> On Aug 16, 2018, at 4:12 AM, 汪亚雷  wrote:
>
> 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  于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, 汪亚雷  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  于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 = 0x7fffe010, size 268435456
>>> (0x1000)
>>> 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 0x7fffd700 (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 0x7fffd700 (LWP 23474)]
>>> 0x7510a403 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  0x7510a403 in svm_msg_q_set_consumer_eventfd
>>> (mq=0x204005440, fd=0) at
>>> /home/wenjiang/vpp/build-data/../src/svm/message_queue.c:242
>>> #1  0x74fede84 in vl_api_application_attach_reply_t_handler
>>> (mp=0x30066c40) at /home/wenjiang/vpp/build-data/../src/vcl/vcl_bapi.c:119
>>> #2  0x75111bba in msg_handler_internal (am=0x75360880
>>> , 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  0x75111e1a in vl_msg_api_handler (the_msg=0x30066c40) at
>>> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:551
>>> #4  0x75113344 in vl_msg_api_queue_handler (q=0x30207ec0) at
>>> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:762
>>> #5  0x75117f4e in rx_thread_fn (arg=0x0) at
>>> /home/wenjiang/vpp/build-data/../src/vlibmemory/memory_client.c:94
>>> #6  0x7763ce25 in start_thread (arg=0x7fffd700) at
>>> pthread_create.c:308
>>> #7  0x7715ebad 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 :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 400
>>>   #tx-fifo-size 400
>>>   app-scope-local
>>>   app-scope-global
>>>   #api-socket-name 

Re: [vpp-dev] Where could I find the example of vcl.conf

2018-08-16 Thread Florin Coras
Hi Yalei, 

Great! For now, I’m planning on keeping both the condvars and eventfds, at 
least until we completely understand the performance implications. 

As for your second question, the session layer will probably at one point start 
requesting that all attachments be done over the socket transport of the binary 
api. Note however that the socket transport is only used for bootstrapping the 
memfd shared memory segments and exchanging file descriptors. In other words, 
binary api exchanges between vcl/apps and vpp are still done over shared memory 
event queues. 

Cheers, 
Florin

> On Aug 16, 2018, at 4:12 AM, 汪亚雷  wrote:
> 
> 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 mailto: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, 汪亚雷 > > 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 mailto: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 = 0x7fffe010, size 268435456 (0x1000)
>> 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 0x7fffd700 (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 0x7fffd700 (LWP 23474)]
>> 0x7510a403 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  0x7510a403 in svm_msg_q_set_consumer_eventfd (mq=0x204005440, 
>> fd=0) at /home/wenjiang/vpp/build-data/../src/svm/message_queue.c:242
>> #1  0x74fede84 in vl_api_application_attach_reply_t_handler 
>> (mp=0x30066c40) at /home/wenjiang/vpp/build-data/../src/vcl/vcl_bapi.c:119
>> #2  0x75111bba in msg_handler_internal (am=0x75360880 
>> , 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  0x75111e1a in vl_msg_api_handler (the_msg=0x30066c40) at 
>> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:551
>> #4  0x75113344 in vl_msg_api_queue_handler (q=0x30207ec0) at 
>> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:762
>> #5  0x75117f4e in rx_thread_fn (arg=0x0) at 
>> /home/wenjiang/vpp/build-data/../src/vlibmemory/memory_client.c:94
>> #6  0x7763ce25 in start_thread (arg=0x7fffd700) at 
>> pthread_create.c:308
>> #7  0x7715ebad 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 :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 400
>>   #tx-fifo-size 400
>>   app-scope-local
>>   app-scope-global
>>   

Re: [vpp-dev] Where could I find the example of vcl.conf

2018-08-16 Thread wylandrea
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  于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, 汪亚雷  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  于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 = 0x7fffe010, size 268435456
>> (0x1000)
>> 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 0x7fffd700 (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 0x7fffd700 (LWP 23474)]
>> 0x7510a403 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  0x7510a403 in svm_msg_q_set_consumer_eventfd (mq=0x204005440,
>> fd=0) at /home/wenjiang/vpp/build-data/../src/svm/message_queue.c:242
>> #1  0x74fede84 in vl_api_application_attach_reply_t_handler
>> (mp=0x30066c40) at /home/wenjiang/vpp/build-data/../src/vcl/vcl_bapi.c:119
>> #2  0x75111bba in msg_handler_internal (am=0x75360880
>> , 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  0x75111e1a in vl_msg_api_handler (the_msg=0x30066c40) at
>> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:551
>> #4  0x75113344 in vl_msg_api_queue_handler (q=0x30207ec0) at
>> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:762
>> #5  0x75117f4e in rx_thread_fn (arg=0x0) at
>> /home/wenjiang/vpp/build-data/../src/vlibmemory/memory_client.c:94
>> #6  0x7763ce25 in start_thread (arg=0x7fffd700) at
>> pthread_create.c:308
>> #7  0x7715ebad 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 :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 400
>>   #tx-fifo-size 400
>>   app-scope-local
>>   app-scope-global
>>   #api-socket-name /run/vpp-api.sock
>>   use-mq-eventfd
>> }
>>
>>
>>
>>
>>
>>
>> Florin Coras  于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 400
>>>   tx-fifo-size 400
>>>   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 

Re: [vpp-dev] Where could I find the example of vcl.conf

2018-08-15 Thread Florin Coras
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, 汪亚雷  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 mailto: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 = 0x7fffe010, size 268435456 (0x1000)
> 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 0x7fffd700 (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 0x7fffd700 (LWP 23474)]
> 0x7510a403 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  0x7510a403 in svm_msg_q_set_consumer_eventfd (mq=0x204005440, 
> fd=0) at /home/wenjiang/vpp/build-data/../src/svm/message_queue.c:242
> #1  0x74fede84 in vl_api_application_attach_reply_t_handler 
> (mp=0x30066c40) at /home/wenjiang/vpp/build-data/../src/vcl/vcl_bapi.c:119
> #2  0x75111bba in msg_handler_internal (am=0x75360880 , 
> 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  0x75111e1a in vl_msg_api_handler (the_msg=0x30066c40) at 
> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:551
> #4  0x75113344 in vl_msg_api_queue_handler (q=0x30207ec0) at 
> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:762
> #5  0x75117f4e in rx_thread_fn (arg=0x0) at 
> /home/wenjiang/vpp/build-data/../src/vlibmemory/memory_client.c:94
> #6  0x7763ce25 in start_thread (arg=0x7fffd700) at 
> pthread_create.c:308
> #7  0x7715ebad 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 :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 400
>   #tx-fifo-size 400
>   app-scope-local
>   app-scope-global
>   #api-socket-name /run/vpp-api.sock
>   use-mq-eventfd
> }
> 
> 
> 
> 
> 
> 
> Florin Coras mailto: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 400
>   tx-fifo-size 400
>   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, 汪亚雷  > > wrote:
> > 
> > Hi Florin,
> > 
> > 

Re: [vpp-dev] Where could I find the example of vcl.conf

2018-08-15 Thread wylandrea
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  于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 = 0x7fffe010, size 268435456
> (0x1000)
> 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 0x7fffd700 (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 0x7fffd700 (LWP 23474)]
> 0x7510a403 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  0x7510a403 in svm_msg_q_set_consumer_eventfd (mq=0x204005440,
> fd=0) at /home/wenjiang/vpp/build-data/../src/svm/message_queue.c:242
> #1  0x74fede84 in vl_api_application_attach_reply_t_handler
> (mp=0x30066c40) at /home/wenjiang/vpp/build-data/../src/vcl/vcl_bapi.c:119
> #2  0x75111bba in msg_handler_internal (am=0x75360880
> , 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  0x75111e1a in vl_msg_api_handler (the_msg=0x30066c40) at
> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:551
> #4  0x75113344 in vl_msg_api_queue_handler (q=0x30207ec0) at
> /home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:762
> #5  0x75117f4e in rx_thread_fn (arg=0x0) at
> /home/wenjiang/vpp/build-data/../src/vlibmemory/memory_client.c:94
> #6  0x7763ce25 in start_thread (arg=0x7fffd700) at
> pthread_create.c:308
> #7  0x7715ebad 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 :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 400
>   #tx-fifo-size 400
>   app-scope-local
>   app-scope-global
>   #api-socket-name /run/vpp-api.sock
>   use-mq-eventfd
> }
>
>
>
>
>
>
> Florin Coras  于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 400
>>   tx-fifo-size 400
>>   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, 汪亚雷  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
> 

Re: [vpp-dev] Where could I find the example of vcl.conf

2018-08-14 Thread wylandrea
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 = 0x7fffe010, size 268435456 (0x1000)
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 0x7fffd700 (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 0x7fffd700 (LWP 23474)]
0x7510a403 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  0x7510a403 in svm_msg_q_set_consumer_eventfd (mq=0x204005440,
fd=0) at /home/wenjiang/vpp/build-data/../src/svm/message_queue.c:242
#1  0x74fede84 in vl_api_application_attach_reply_t_handler
(mp=0x30066c40) at /home/wenjiang/vpp/build-data/../src/vcl/vcl_bapi.c:119
#2  0x75111bba in msg_handler_internal (am=0x75360880
, 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  0x75111e1a in vl_msg_api_handler (the_msg=0x30066c40) at
/home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:551
#4  0x75113344 in vl_msg_api_queue_handler (q=0x30207ec0) at
/home/wenjiang/vpp/build-data/../src/vlibapi/api_shared.c:762
#5  0x75117f4e in rx_thread_fn (arg=0x0) at
/home/wenjiang/vpp/build-data/../src/vlibmemory/memory_client.c:94
#6  0x7763ce25 in start_thread (arg=0x7fffd700) at
pthread_create.c:308
#7  0x7715ebad 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 :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 400
  #tx-fifo-size 400
  app-scope-local
  app-scope-global
  #api-socket-name /run/vpp-api.sock
  use-mq-eventfd
}






Florin Coras  于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 400
>   tx-fifo-size 400
>   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, 汪亚雷  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/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Where could I find the example of vcl.conf

2018-08-14 Thread Florin Coras
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 400
  tx-fifo-size 400
  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, 汪亚雷  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 (#10147): https://lists.fd.io/g/vpp-dev/message/10147
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]
-=-=-=-=-=-=-=-=-=-=-=-