Re: [vpp-dev] VPP C API application compilation issue on using S and W functions

2020-06-30 Thread Chinmaya Aggarwal
Hi Ole,
As suggested by you, we are trying vapi for our SRv6 use case, we were able to 
generate sr.api.json for sr.api using src/tools/vppapigen/generate_json.py. We 
then generated sr.api.vapi.h using src/vpp-api/vapi/vapi_c_gen.py. On going 
through sr.api.vapi.h, we found a function 
*vapi_set_vapi_msg_sr_policies_details_event_cb* (for *sr_policies_details* 
message), at first it seems that it registers a callback function for events, 
but we couldn't figure out what kind of events. Could you please help us 
understand its significance?

Thanks and Regards,
Chinmaya Agarwal.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

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


Re: Private: Re: [vpp-dev] VPP C API application compilation issue on using S and W functions

2020-06-26 Thread Dave Barach via lists.fd.io
If you want to pinch code from vpp_api_test, please read and understand it:

/* W: wait for results, with timeout */
#define W(ret)  \
do {\
f64 timeout = vat_time_now (vam) + 1.0; \
socket_client_main_t *scm = vam->socket_client_main;  \
ret = -99;  \
\
if (scm && scm->socket_enable)  \
  vl_socket_client_read (5);  \
while (vat_time_now (vam) < timeout) {  \
if (vam->result_ready == 1) {   \
ret = vam->retval;  \
break;  \
}   \
vat_suspend (vam->vlib_main, 1e-5); \
}   \
} while(0);

So what does the “W” macro do? It causes the vpp_api_test main thread to block 
until vpp answers and the vpp_api_test rx pthread processes the reply, or a 
timeout occurs.

You’ll need to declare and initialize a clib_time_t, a vat_main_t, then supply 
the missing routines:

f64
vat_time_now (vat_main_t * vam)
{
  return clib_time_now (>clib_time);
}


void
vat_suspend (vlib_main_t * vm, f64 interval)
{
  /* do nothing to busy-wait, or call usleep, or call CLIB_PAUSE */
}

Given that you’re not using vpp_api_test, you might decide to use 
vat_helper_macros.h as a guide and fabricate something which seems more at home 
in your application.

HTH... Dave

From: Chinmaya Aggarwal 
Sent: Friday, June 26, 2020 7:59 AM
To: Dave Barach (dbarach) 
Subject: Private: Re: [vpp-dev] VPP C API application compilation issue on 
using S and W functions

Hi Dave,
We have our application (using VPP C API) running outside of VPP.  We linked 
vpp libs in our application (vatplugin, vppinfra, vlibmemoryclient, svm, 
vppapiclient). Attaching file vpp_connect_test.c that creates connection with 
VPP and calls VPP C API to modify a sr policy. We have used function S to send 
the message and W to wait for its reply. On compiling this C file we are 
getting the following error : -
root@ggnlabvm-hnsnfvsdn03:~/vpp_api_test# make
gcc  -Wall -g-c -o vpp_connect_test.o vpp_connect_test.c
gcc  -Wall -g  -I/usr/include/vpp_plugins -I/usr/include/ -o api_exec 
vpp_connect_test.o -Wl,--start-group  -lvatplugin -lvppinfra -lvlibmemoryclient 
-lsvm -lvppapiclient  -Wl,--end-group  -lpthread -lm -lrt -ldl
vpp_connect_test.o: In function `del_sl_pol2_index6':
/root/vpp_api_test/vpp_connect_test.c:97: undefined reference to `vat_time_now'
/root/vpp_api_test/vpp_connect_test.c:97: undefined reference to `vat_suspend'
/root/vpp_api_test/vpp_connect_test.c:97: undefined reference to `vat_time_now'
collect2: error: ld returned 1 exit status
Makefile:35: recipe for target 'api_exec' failed
make: *** [api_exec] Error 1

Is there any library that needs to be linked and we have missed it? If not, can 
we use S and W function in an external C application, in a way similar to how 
VPP uses it?

Thanks and Regards,
Chinmaya Agarwal.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16834): https://lists.fd.io/g/vpp-dev/message/16834
Mute This Topic: https://lists.fd.io/mt/75126256/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] VPP C API application compilation issue on using S and W functions

2020-06-26 Thread Ole Troan
Chinmaya,

I don't think linking in vatplugin is a "supported" interface. Meaning it can 
change or go away at no notice.
If you build a C application you'd likely be happier with using VAPI.

Cheers,
Ole

> On 26 Jun 2020, at 13:58, Chinmaya Aggarwal  wrote:
> 
> Hi Dave,
> We have our application (using VPP C API) running outside of VPP.  We linked 
> vpp libs in our application (vatplugin, vppinfra, vlibmemoryclient, svm, 
> vppapiclient). Attaching file vpp_connect_test.c that creates connection with 
> VPP and calls VPP C API to modify a sr policy. We have used function S to 
> send the message and W to wait for its reply. On compiling this C file we are 
> getting the following error : -
> root@ggnlabvm-hnsnfvsdn03:~/vpp_api_test# make
> gcc  -Wall -g-c -o vpp_connect_test.o vpp_connect_test.c
> gcc  -Wall -g  -I/usr/include/vpp_plugins -I/usr/include/ -o api_exec 
> vpp_connect_test.o -Wl,--start-group  -lvatplugin -lvppinfra 
> -lvlibmemoryclient -lsvm -lvppapiclient  -Wl,--end-group  -lpthread -lm -lrt 
> -ldl
> vpp_connect_test.o: In function `del_sl_pol2_index6':
> /root/vpp_api_test/vpp_connect_test.c:97: undefined reference to 
> `vat_time_now'
> /root/vpp_api_test/vpp_connect_test.c:97: undefined reference to `vat_suspend'
> /root/vpp_api_test/vpp_connect_test.c:97: undefined reference to 
> `vat_time_now'
> collect2: error: ld returned 1 exit status
> Makefile:35: recipe for target 'api_exec' failed
> make: *** [api_exec] Error 1
> 
> Is there any library that needs to be linked and we have missed it? If not, 
> can we use S and W function in an external C application, in a way similar to 
> how VPP uses it?
> 
> Thanks and Regards,
> Chinmaya Agarwal. 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16830): https://lists.fd.io/g/vpp-dev/message/16830
Mute This Topic: https://lists.fd.io/mt/75100285/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] VPP C API application compilation issue on using S and W functions

2020-06-26 Thread Chinmaya Aggarwal
Hi Dave,
We have our application (using VPP C API) running outside of VPP.  We linked 
vpp libs in our application ( vatplugin, vppinfra, vlibmemoryclient, svm, 
vppapiclient). Attaching file vpp_connect_test.c that creates connection with 
VPP and calls VPP C API to modify a sr policy. We have used function S to send 
the message and W to wait for its reply. On compiling this C file we are 
getting the following error : -
root@ggnlabvm-hnsnfvsdn03:~/vpp_api_test# make
gcc  -Wall -g    -c -o vpp_connect_test.o vpp_connect_test.c
gcc  -Wall -g  -I/usr/include/vpp_plugins -I/usr/include/ -o api_exec 
vpp_connect_test.o -Wl,--start-group  -lvatplugin -lvppinfra -lvlibmemoryclient 
-lsvm -lvppapiclient  -Wl,--end-group  -lpthread -lm -lrt -ldl
vpp_connect_test.o: In function `del_sl_pol2_index6':
/root/vpp_api_test/vpp_connect_test.c:97: undefined reference to `vat_time_now'
/root/vpp_api_test/vpp_connect_test.c:97: undefined reference to `vat_suspend'
/root/vpp_api_test/vpp_connect_test.c:97: undefined reference to `vat_time_now'
collect2: error: ld returned 1 exit status
Makefile:35: recipe for target 'api_exec' failed
make: *** [api_exec] Error 1

Is there any library that needs to be linked and we have missed it? If not, can 
we use S and W function in an external C application, in a way similar to how 
VPP uses it?

Thanks and Regards,
Chinmaya Agarwal.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16826): https://lists.fd.io/g/vpp-dev/message/16826
Mute This Topic: https://lists.fd.io/mt/75100285/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] VPP C API application compilation issue on using S and W functions

2020-06-25 Thread Chinmaya Aggarwal
Ok, and how can we use S and W functions in our application to send request and 
wait for reply?
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16818): https://lists.fd.io/g/vpp-dev/message/16818
Mute This Topic: https://lists.fd.io/mt/75100285/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] VPP C API application compilation issue on using S and W functions

2020-06-25 Thread Dave Barach via lists.fd.io
Unless you’re doing vector processing, vlib is not useful.

Here is the CMakeLists.txt entry for vpp_api_test. It’s not likely that you’ll 
need libvatplugin.so, but you get the idea...


##
# vpp_api_test
##
add_vpp_executable(vpp_api_test ENABLE_EXPORTS
  SOURCES
  api_format.c
  main.c
  plugin.c
  json_format.c
  types.c
  ip_types_api.c
  ip_types.c
  protocols.def

  DEPENDS api_headers

  LINK_LIBRARIES
  vlibmemoryclient
  svm
  vatplugin
  vppinfra
  Threads::Threads
  rt m dl crypto
)

From: vpp-dev@lists.fd.io  On Behalf Of Chinmaya Aggarwal
Sent: Thursday, June 25, 2020 7:02 AM
To: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] VPP C API application compilation issue on using S and W 
functions

I am following fd.io wiki link https://wiki.fd.io/view/VPP/How_To_Use_The_C_API
It says so.
Are we not suppose to link vlib?
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16817): https://lists.fd.io/g/vpp-dev/message/16817
Mute This Topic: https://lists.fd.io/mt/75100285/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] VPP C API application compilation issue on using S and W functions

2020-06-25 Thread Chinmaya Aggarwal
I am following fd.io wiki link https://wiki.fd.io/view/VPP/How_To_Use_The_C_API
It says so.
Are we not suppose to link vlib?
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16816): https://lists.fd.io/g/vpp-dev/message/16816
Mute This Topic: https://lists.fd.io/mt/75100285/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] VPP C API application compilation issue on using S and W functions

2020-06-25 Thread Dave Barach via lists.fd.io
Why are you linking against vlib?

From: vpp-dev@lists.fd.io  On Behalf Of Chinmaya Aggarwal
Sent: Thursday, June 25, 2020 6:48 AM
To: vpp-dev@lists.fd.io
Subject: [vpp-dev] VPP C API application compilation issue on using S and W 
functions

Hi,
We are testing VPP C API for our use case. We have a scenario where we want to 
wait for the reply of our API request. For this, we are trying to use S and W 
functions defined in src/vlibapi/vat_helper_macros.h. But we get the following 
error on compiling our source code : -

root@ggnlabvm-hnsnfvsdn03:~/vpp_api_test# make
gcc  -Wall -g  -I/usr/include/vpp_plugins -I/usr/include/ -o vpp_api_test 
vpp_connect.o -Wl,--start-group  -lvatplugin -lvppinfra -lvlibmemoryclient 
-lsvm -lvlib -lvppapiclient  -Wl,--end-group  -lpthread -lm -lrt -ldl
vpp_connect.o: In function `del_sl_pol2_index6':
/root/vpp_api_test/vpp_connect.c:780: undefined reference to `vat_time_now'
/root/vpp_api_test/vpp_connect.c:780: undefined reference to `vat_suspend'
/root/vpp_api_test/vpp_connect.c:780: undefined reference to `vat_time_now'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libvlib.so: undefined 
reference to `stat_segment_register_gauge'
collect2: error: ld returned 1 exit status
Makefile:37: recipe for target 'vpp_api_test' failed
make: *** [vpp_api_test] Error 1

Can anyone please suggest what is wrong here?


Thanks and Regards,
Chinmaya Agarwal.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

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


[vpp-dev] VPP C API application compilation issue on using S and W functions

2020-06-25 Thread Chinmaya Aggarwal
Hi,
We are testing VPP C API for our use case. We have a scenario where we want to 
wait for the reply of our API request. For this, we are trying to use S and W 
functions defined in src/vlibapi/vat_helper_macros.h. But we get the following 
error on compiling our source code : -

root@ggnlabvm-hnsnfvsdn03:~/vpp_api_test# make
gcc  -Wall -g  -I/usr/include/vpp_plugins -I/usr/include/ -o vpp_api_test 
vpp_connect.o -Wl,--start-group  -lvatplugin -lvppinfra -lvlibmemoryclient 
-lsvm -lvlib -lvppapiclient  -Wl,--end-group  -lpthread -lm -lrt -ldl
vpp_connect.o: In function `del_sl_pol2_index6':
/root/vpp_api_test/vpp_connect.c:780: undefined reference to `vat_time_now'
/root/vpp_api_test/vpp_connect.c:780: undefined reference to `vat_suspend'
/root/vpp_api_test/vpp_connect.c:780: undefined reference to `vat_time_now'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libvlib.so: undefined 
reference to `stat_segment_register_gauge'
collect2: error: ld returned 1 exit status
Makefile:37: recipe for target 'vpp_api_test' failed
make: *** [vpp_api_test] Error 1

Can anyone please suggest what is wrong here?

Thanks and Regards,
Chinmaya Agarwal.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16814): https://lists.fd.io/g/vpp-dev/message/16814
Mute This Topic: https://lists.fd.io/mt/75100285/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] VPP C API difference between VPP v20.05 and v 20.01

2020-06-11 Thread Ole Troan
> We are trying to use VPP C API in our C application to call VPP functionality 
> in our system. Our system has different sub systems running different VPP 
> versions. We want to have single C application interacting with different 
> versions of VPP. We started with reading SRv6 policy and steering policy data 
> using VPP C API's sr_steering_pol_dump and sr_policies_dump structures. But, 
> while testing with different version, we found differences during data 
> reading in handler functions. 
>  
> Till VPP v20.01, fields in structures sr_policies_details and 
> sr_steering_pol_details are as shown below : -  
> define sr_policies_details
> {
>   u32 context;
>   vl_api_srv6_sid_t bsid;
>   u8 type;
>   u8 is_encap;
>   u32 fib_table;
>   u8 num_sid_lists;
>   vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
> };
>  
> define sr_steering_pol_details
> {
>   u32 context;
>   u8 traffic_type;
>   u32 fib_table;
>   u8 prefix_addr[16];
>   u32 mask_width;
>   u32 sw_if_index;
>   vl_api_srv6_sid_t bsid;
> };
>  
> From VPP v20.05, fields in structures sr_policies_details and 
> sr_steering_pol_details are as shown below : - 
> define sr_policies_details
> {
>   u32 context;
>   vl_api_ip6_address_t bsid;
>   bool is_spray;
>   bool is_encap;
>   u32 fib_table;
>   u8 num_sid_lists;
>   vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
> };
> define sr_steering_pol_details
> {
>   u32 context;
>   vl_api_sr_steer_t traffic_type;
>   u32 fib_table;
>   vl_api_prefix_t prefix;
>   vl_api_interface_index_t sw_if_index;
>   vl_api_ip6_address_t bsid;
> };
>  
> Our handler functions has following signatures : -
> static void 
> vl_api_sr_steering_pol_details_t_handler(vl_api_sr_steering_pol_details_t * 
> mp)
> static void vl_api_sr_policies_details_t_handler(vl_api_sr_policies_details_t 
> * mp)
> 
> Is there a way to abstract this difference and use the same piece of code for 
> both versions of VPP?

Yes, but you would have to build your own wrapper.

Cheers,
Ole-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

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


[vpp-dev] VPP C API difference between VPP v20.05 and v 20.01

2020-06-10 Thread Chinmaya Aggarwal
We are trying to use VPP C API in our C application to call VPP functionality 
in our system. Our system has different sub systems running different VPP 
versions. We want to have single C application interacting with different 
versions of VPP. We started with reading SRv6 policy and steering policy data 
using VPP C API's sr_steering_pol_dump and sr_policies_dump structures. But, 
while testing with different version, we found differences during data reading 
in handler functions.

Till VPP v20.01, fields in structures sr_policies_details and 
sr_steering_pol_details are as shown below : -
define sr_policies_details
{
u32 context;
vl_api_srv6_sid_t bsid;
u8 type;
u8 is_encap;
u32 fib_table;
u8 num_sid_lists;
vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
};

define sr_steering_pol_details
{
u32 context;
u8 traffic_type;
u32 fib_table;
u8 prefix_addr[16];
u32 mask_width;
u32 sw_if_index;
vl_api_srv6_sid_t bsid;
};

>From VPP v20.05, fields in structures sr_policies_details and 
>sr_steering_pol_details are as shown below : -
define sr_policies_details
{
u32 context;
vl_api_ip6_address_t bsid;
bool is_spray;
bool is_encap;
u32 fib_table;
u8 num_sid_lists;
vl_api_srv6_sid_list_t sid_lists[num_sid_lists];
};
define sr_steering_pol_details
{
u32 context;
vl_api_sr_steer_t traffic_type;
u32 fib_table;
vl_api_prefix_t prefix;
vl_api_interface_index_t sw_if_index;
vl_api_ip6_address_t bsid;
};

Our handler functions has following signatures : -
static void 
vl_api_sr_steering_pol_details_t_handler(vl_api_sr_steering_pol_details_t * mp)
static void vl_api_sr_policies_details_t_handler(vl_api_sr_policies_details_t * 
mp)

Is there a way to abstract this difference and use the same piece of code for 
both versions of VPP?
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16709): https://lists.fd.io/g/vpp-dev/message/16709
Mute This Topic: https://lists.fd.io/mt/74796193/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] VPP C++ API

2018-07-04 Thread Klement Sekera via Lists.Fd.Io
Hi,

this should fix your issue

https://gerrit.fd.io/r/#/c/13349/

Thanks,
Klement

On Mon, 2018-07-02 at 13:57 +0300, Alexander Gryanko wrote:
> Stack trace for thread 2:
> 
> Thread 2 "main" received signal SIGABRT, Aborted.
> [Switching to Thread 0x7fffedbff700 (LWP 814141)]
> 0x7529c428 in __GI_raise (sig=sig@entry=6) at
> ../sysdeps/unix/sysv/linux/raise.c:54
> 54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> (gdb) bt
> #0  0x7529c428 in __GI_raise (sig=sig@entry=6) at
> ../sysdeps/unix/sysv/linux/raise.c:54
> #1  0x7529e02a in __GI_abort () at abort.c:89
> #2  0x75294bd7 in __assert_fail_base (fmt=,
> assertion=assertion@entry=0x75bcb5f5 "id <=
> __vapi_metadata.count",
> file=file@entry=0x75bcb530
> "/place/home/xpahos/git/vpp/build-data/../src/vpp-api/vapi/vapi.c",
> line=line@entry=696, function=function@entry=0x75bcb6f0
> <__PRETTY_FUNCTION__.39669> "vapi_msg_is_with_context") at
> assert.c:92
> #3  0x75294c82 in __GI___assert_fail
> (assertion=assertion@entry=0x75bcb5f5
> "id <= __vapi_metadata.count", file=file@entry=0x75bcb530
> "/place/home/xpahos/git/vpp/build-data/../src/vpp-api/vapi/vapi.c",
> line=line@entry=696, function=function@entry=0x75bcb6f0
> <__PRETTY_FUNCTION__.39669> "vapi_msg_is_with_context") at
> assert.c:101
> #4  0x75bcac0b in vapi_msg_is_with_context (id=id@entry=32001
> 71710)
> at /place/home/xpahos/git/vpp/build-data/../src/vpp-
> api/vapi/vapi.c:696
> #5  0x7646f2a0 in vapi::Connection::dispatch (time=5,
> limit=0x0,
> this=0x61109500) at
> /place/home/xpahos/git/vpp/build-root/install-vpp-
> native/vpp/include/vapi/vapi.hpp:270
> #6  VOM::HW::cmd_q::rx_run (this=0x61007d40) at
> /place/home/xpahos/git/vpp/build-data/../extras/vom/vom/hw.cpp:45
> #7  0x758ffc80 in ?? () from
> /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> #8  0x750516ba in start_thread (arg=0x7fffedbff700) at
> pthread_create.c:333
> #9  0x7536e41d in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
> 
> Values:
> 
> Thread 2 "main" hit Breakpoint 1, vapi_msg_is_with_context (id=id@ent
> ry=130)
> at /place/home/xpahos/git/vpp/build-data/../src/vpp-
> api/vapi/vapi.c:696
> 696   assert (id <= __vapi_metadata.count);
> (gdb) print id
> $1 = 130
> (gdb) c
> Continuing.
> Mon Jul  2 13:52:37 2018 [debug]rpc_cmd.hpp:120 operator()() itf-
> events 0
> Started
> 
> Thread 2 "main" hit Breakpoint 1, vapi_msg_is_with_context
> (id=id@entry=3200171710)
> at /place/home/xpahos/git/vpp/build-data/../src/vpp-
> api/vapi/vapi.c:696
> 696   assert (id <= __vapi_metadata.count);
> (gdb) print id
> $2 = 3200171710
> 
> Shared memory message:
> 
> (gdb) print shm_data_size
> $3 = 10
> (gdb) print shm_data
> $4 = (void *) 0x30045a74
> (gdb) x/10h 0x30045a74
> 0x30045a74: 5376 0 0 0 0 0 0 0
> 0x30045a84: 0 0
> 
> On Mon, 2 Jul 2018 at 10:40, Klement Sekera 
> wrote:
> 
> > 
> > Hi,
> > 
> > can you please run in gdb (or open core) and pass us a stack trace?
> > 
> > Thanks,
> > Klement
> > 
> > On Sun, 2018-07-01 at 19:36 -0700, xpa...@gmail.com wrote:
> > > 
> > > Hello,
> > > I'm trying to understand how works VOM wrapper for C++ API.
> > > VOM manager header: https://pastebin.com/BgG7td5s
> > > VOM manager cpp: https://pastebin.com/890jjUJm
> > > main.cpp:
> > > 
> > > int main() {
> > > TVppManager manager;
> > > std::cout << "Starting\n";
> > > manager.Start();
> > > 
> > > sleep(60);
> > > 
> > > manager.Stop();
> > > }
> > > 
> > > When I'm trying to run sudo ./main a I got error:
> > > Starting
> > > Calling connect
> > > Manager is connected
> > > Mon Jul  2 05:33:55 2018 [debug]hw.cpp:129 write() itf-events
> > > Mon Jul  2 05:33:55 2018 [debug]rpc_cmd.hpp:120 operator()() itf-
> > > events 0
> > > Started
> > > main: /place/home/xpahos/git/vpp/build-data/../src/vpp-
> > > api/vapi/vapi.c:696: vapi_msg_is_with_context: Assertion `id <=
> > > __vapi_metadata.count' failed.
> > > Aborted
> > > 
> > > I found that id looks like unsigned value overflow. How can I
> > > debug
> > > this? I don't see anything in trace dump.
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > > Links: You receive all messages sent to this group.
> > > 
> > > View/Reply Online (#9753): https://lists.fd.io/g/vpp-dev/message/
> > > 9753
> > > Mute This Topic: https://lists.fd.io/mt/22999158/675704
> > > Group Owner: vpp-dev+ow...@lists.fd.io
> > > Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [ksekera@cisco.
> > > com]
> > > -=-=-=-=-=-=-=-=-=-=-=-
> 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#9777): https://lists.fd.io/g/vpp-dev/message/9777
Mute This Topic: https://lists.fd.io/mt/22999158/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] VPP C++ API

2018-07-02 Thread chetan bhasin
Hi,

I also faced this type of issue,  there is a keep alive message,  which VPP
keep on sending to its client,  and if you don't have it's registration,
client app crashes.

Can you print the message id and you can refer various VPP CLI

show api messag
show api client
show api ring

etc

Regards,
Chetan Bhasin

On Mon, Jul 2, 2018, 13:10 Klement Sekera via Lists.Fd.Io  wrote:

> Hi,
>
> can you please run in gdb (or open core) and pass us a stack trace?
>
> Thanks,
> Klement
>
> On Sun, 2018-07-01 at 19:36 -0700, xpa...@gmail.com wrote:
> > Hello,
> > I'm trying to understand how works VOM wrapper for C++ API.
> > VOM manager header: https://pastebin.com/BgG7td5s
> > VOM manager cpp: https://pastebin.com/890jjUJm
> > main.cpp:
> >
> > int main() {
> > TVppManager manager;
> > std::cout << "Starting\n";
> > manager.Start();
> >
> > sleep(60);
> >
> > manager.Stop();
> > }
> >
> > When I'm trying to run sudo ./main a I got error:
> > Starting
> > Calling connect
> > Manager is connected
> > Mon Jul  2 05:33:55 2018 [debug]hw.cpp:129 write() itf-events
> > Mon Jul  2 05:33:55 2018 [debug]rpc_cmd.hpp:120 operator()() itf-
> > events 0
> > Started
> > main: /place/home/xpahos/git/vpp/build-data/../src/vpp-
> > api/vapi/vapi.c:696: vapi_msg_is_with_context: Assertion `id <=
> > __vapi_metadata.count' failed.
> > Aborted
> >
> > I found that id looks like unsigned value overflow. How can I debug
> > this? I don't see anything in trace dump.
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> >
> > View/Reply Online (#9753): https://lists.fd.io/g/vpp-dev/message/9753
> > Mute This Topic: https://lists.fd.io/mt/22999158/675704
> > Group Owner: vpp-dev+ow...@lists.fd.io
> > Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [ksek...@cisco.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
>
> View/Reply Online (#9755): https://lists.fd.io/g/vpp-dev/message/9755
> Mute This Topic: https://lists.fd.io/mt/22999158/856484
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [
> chetan.bhasin...@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#9769): https://lists.fd.io/g/vpp-dev/message/9769
Mute This Topic: https://lists.fd.io/mt/22999158/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] VPP C++ API

2018-07-02 Thread Klement Sekera via Lists.Fd.Io
Hi,

can you please run in gdb (or open core) and pass us a stack trace?

Thanks,
Klement

On Sun, 2018-07-01 at 19:36 -0700, xpa...@gmail.com wrote:
> Hello,
> I'm trying to understand how works VOM wrapper for C++ API.
> VOM manager header: https://pastebin.com/BgG7td5s
> VOM manager cpp: https://pastebin.com/890jjUJm
> main.cpp: 
> 
> int main() {
>     TVppManager manager;
>     std::cout << "Starting\n";
>     manager.Start();
>  
>     sleep(60);
>  
>     manager.Stop();
> }
> 
> When I'm trying to run sudo ./main a I got error:
> Starting
> Calling connect
> Manager is connected
> Mon Jul  2 05:33:55 2018 [debug]hw.cpp:129 write() itf-events
> Mon Jul  2 05:33:55 2018 [debug]rpc_cmd.hpp:120 operator()() itf-
> events 0
> Started
> main: /place/home/xpahos/git/vpp/build-data/../src/vpp-
> api/vapi/vapi.c:696: vapi_msg_is_with_context: Assertion `id <=
> __vapi_metadata.count' failed.
> Aborted
> 
> I found that id looks like unsigned value overflow. How can I debug
> this? I don't see anything in trace dump.
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#9753): https://lists.fd.io/g/vpp-dev/message/9753
> Mute This Topic: https://lists.fd.io/mt/22999158/675704
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [ksek...@cisco.com]
> -=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

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


[vpp-dev] VPP C++ API

2018-07-01 Thread xpahos
Hello,
I'm trying to understand how works VOM wrapper for C++ API.
VOM manager header: https://pastebin.com/BgG7td5s
VOM manager cpp: https://pastebin.com/890jjUJm
main.cpp: 

int main() {
    TVppManager manager;
    std::cout << "Starting\n";
    manager.Start();
 
    sleep(60);
 
    manager.Stop();
}

When I'm trying to run sudo ./main a I got error:
Starting
Calling connect
Manager is connected
Mon Jul  2 05:33:55 2018 [debug]hw.cpp:129 write() itf-events
Mon Jul  2 05:33:55 2018 [debug]rpc_cmd.hpp:120 operator()() itf-events 0
Started
main: /place/home/xpahos/git/vpp/build-data/../src/vpp-api/vapi/vapi.c:696: 
vapi_msg_is_with_context: Assertion `id <= __vapi_metadata.count' failed.
Aborted

I found that id looks like unsigned value overflow. How can I debug this? I 
don't see anything in trace dump.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

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