Re: [vpp-dev] Failed to build vpp with vppsb

2017-09-27 Thread Burt Silverman
My bad, again. I commented stuff out and forgot to go back and try to fix
this file the way I did rtnl.c. This compiles -- not tested

burts@burtvb:~/vppsb/router/router$ git diff .
diff --git a/router/router/tap_inject_tap.c b/router/router/tap_inject_tap.c
index 9650323..a3ec9ff 100644
--- a/router/router/tap_inject_tap.c
+++ b/router/router/tap_inject_tap.c
@@ -30,7 +30,7 @@


 static clib_error_t *
-tap_inject_tap_read (unix_file_t * f)
+tap_inject_tap_read (clib_file_t * f)
 {
   vlib_main_t * vm = vlib_get_main ();
   tap_inject_main_t * im = tap_inject_get_main ();
@@ -52,7 +52,7 @@ tap_inject_tap_connect (vnet_hw_interface_t * hw)
   static const int one = 1;
   int fd;
   struct ifreq ifr;
-  unix_file_t template;
+  clib_file_t template;
   u32 tap_fd;
   u8 * name;

@@ -120,7 +120,7 @@ tap_inject_tap_connect (vnet_hw_interface_t * hw)
   template.read_function = tap_inject_tap_read;
   template.file_descriptor = tap_fd;

-  unix_file_add (_main, );
+  clib_file_add (_main, );

   tap_inject_insert_tap (sw->sw_if_index, tap_fd, ifr.ifr_ifindex);



On Wed, Sep 27, 2017 at 5:18 PM, Paweł Staszewski 
wrote:

> hmm
>
> another error
>
>  Building router in /git/vpp/build-root/build-vpp_debug-native/router
> 
> make[1]: Entering directory '/git/vpp/build-root/build-
> vpp_debug-native/router'
>   CC   router/tap_inject.lo
>   CC   router/tap_inject_netlink.lo
>   CC   router/tap_inject_node.lo
>   CC   router/tap_inject_tap.lo
> /git/vpp/build-data/../router/router/tap_inject_tap.c:33:22: error:
> unknown type name ‘unix_file_t’
>  tap_inject_tap_read (unix_file_t * f)
>   ^~~
> /git/vpp/build-data/../router/router/tap_inject_tap.c: In function
> ‘tap_inject_tap_connect’:
> /git/vpp/build-data/../router/router/tap_inject_tap.c:55:3: error:
> unknown type name ‘unix_file_t’
>unix_file_t template;
>^~~
> /git/vpp/build-data/../router/router/tap_inject_tap.c:120:11: error:
> request for member ‘read_function’ in something not a structure or union
>template.read_function = tap_inject_tap_read;
>^
> /git/vpp/build-data/../router/router/tap_inject_tap.c:120:28: error:
> ‘tap_inject_tap_read’ undeclared (first use in this function)
>template.read_function = tap_inject_tap_read;
> ^~~
> /git/vpp/build-data/../router/router/tap_inject_tap.c:120:28: note: each
> undeclared identifier is reported only once for each function it appears in
> /git/vpp/build-data/../router/router/tap_inject_tap.c:121:11: error:
> request for member ‘file_descriptor’ in something not a structure or union
>template.file_descriptor = tap_fd;
>^
> /git/vpp/build-data/../router/router/tap_inject_tap.c:123:3: error:
> implicit declaration of function ‘unix_file_add’ [-Werror=implicit-function-
> declaration]
>unix_file_add (_main, );
>^
> cc1: all warnings being treated as errors
> Makefile:476: recipe for target 'router/tap_inject_tap.lo' failed
> make[1]: *** [router/tap_inject_tap.lo] Error 1
> make[1]: *** Waiting for unfinished jobs
> make[1]: Leaving directory '/git/vpp/build-root/build-
> vpp_debug-native/router'
> Makefile:698: recipe for target 'router-build' failed
> make: *** [router-build] Error 2
>
>
>
> W dniu 2017-09-27 o 23:06, Paweł Staszewski pisze:
>
> After adding this patch other problem:)
>
>  Building netlink in /git/vpp/build-root/build-vpp_debug-native/netlink
> 
> make[1]: Entering directory '/git/vpp/build-root/build-
> vpp_debug-native/netlink'
>   CCLD librtnl.la
>   CC   test/test.lo
> ar: `u' modifier ignored since `D' is the default (see `U')
> /git/vpp/build-data/../netlink/test/test.c: In function
> ‘mapper_ns_add_command_fn’:
> /git/vpp/build-data/../netlink/test/test.c:125:14: error: implicit
> declaration of function ‘ip4_fib_index_from_table_id’
> [-Werror=implicit-function-declaration]
>u32 fib4 = ip4_fib_index_from_table_id(table_id);
>   ^~~
> /git/vpp/build-data/../netlink/test/test.c:126:14: error: implicit
> declaration of function ‘ip6_fib_index_from_table_id’
> [-Werror=implicit-function-declaration]
>u32 fib6 = ip6_fib_index_from_table_id(table_id);
>   ^~~
> cc1: all warnings being treated as errors
> Makefile:520: recipe for target 'test/test.lo' failed
> make[1]: *** [test/test.lo] Error 1
> make[1]: Leaving directory '/git/vpp/build-root/build-
> vpp_debug-native/netlink'
> Makefile:698: recipe for target 'netlink-build' failed
> make: *** [netlink-build] Error 2
>
>
>
> W dniu 2017-09-27 o 20:06, Burt Silverman pisze:
>
> Hi Michael,
>
> I came up with a patch that compiles, but I have not tested it. Hopefully
> it is this simple:
>
> burts@burtvb:~/vppsb/netlink/librtnl$ git diff .
> diff --git a/netlink/librtnl/rtnl.c b/netlink/librtnl/rtnl.c
> index 04f0440..fa31617 100644
> --- 

Re: [vpp-dev] Failed to build vpp with vppsb

2017-09-27 Thread Burt Silverman
My bad. I forgot to say that I had eliminated the testrtnl_plugin.la from
the Makefile.am; I assumed it was not needed. I guess that was laziness on
my part.

Burt

On Wed, Sep 27, 2017 at 5:17 PM, Paweł Staszewski 
wrote:

> ok added
>
> vnet/fib/ip4_fib.h
>
> vnet/fib/ip6_fib.h
>
> to test.c
>
> going next try:)
>
>
>
> W dniu 2017-09-27 o 23:06, Paweł Staszewski pisze:
>
> After adding this patch other problem:)
>
>  Building netlink in /git/vpp/build-root/build-vpp_debug-native/netlink
> 
> make[1]: Entering directory '/git/vpp/build-root/build-
> vpp_debug-native/netlink'
>   CCLD librtnl.la
>   CC   test/test.lo
> ar: `u' modifier ignored since `D' is the default (see `U')
> /git/vpp/build-data/../netlink/test/test.c: In function
> ‘mapper_ns_add_command_fn’:
> /git/vpp/build-data/../netlink/test/test.c:125:14: error: implicit
> declaration of function ‘ip4_fib_index_from_table_id’
> [-Werror=implicit-function-declaration]
>u32 fib4 = ip4_fib_index_from_table_id(table_id);
>   ^~~
> /git/vpp/build-data/../netlink/test/test.c:126:14: error: implicit
> declaration of function ‘ip6_fib_index_from_table_id’
> [-Werror=implicit-function-declaration]
>u32 fib6 = ip6_fib_index_from_table_id(table_id);
>   ^~~
> cc1: all warnings being treated as errors
> Makefile:520: recipe for target 'test/test.lo' failed
> make[1]: *** [test/test.lo] Error 1
> make[1]: Leaving directory '/git/vpp/build-root/build-
> vpp_debug-native/netlink'
> Makefile:698: recipe for target 'netlink-build' failed
> make: *** [netlink-build] Error 2
>
>
>
> W dniu 2017-09-27 o 20:06, Burt Silverman pisze:
>
> Hi Michael,
>
> I came up with a patch that compiles, but I have not tested it. Hopefully
> it is this simple:
>
> burts@burtvb:~/vppsb/netlink/librtnl$ git diff .
> diff --git a/netlink/librtnl/rtnl.c b/netlink/librtnl/rtnl.c
> index 04f0440..fa31617 100644
> --- a/netlink/librtnl/rtnl.c
> +++ b/netlink/librtnl/rtnl.c
> @@ -31,6 +31,7 @@
>
>  #include 
>  #include 
> +#include 
>
>  #undef DBL_MAX
>  #define DBL_MAX 10.0
> @@ -102,7 +103,7 @@ rtnl_cancel_timeout(rtnl_ns_t *ns)
>ns->timeout = DBL_MAX;
>  }
>
> -static clib_error_t *rtnl_read_cb(struct unix_file * f)
> +static clib_error_t *rtnl_read_cb(struct clib_file * f)
>  {
>rtnl_main_t *rm = _main;
>vlib_main_t *vm = vlib_get_main();
> @@ -138,7 +139,7 @@ int rtnl_dump_request(rtnl_ns_t *ns, int type, void
> *req, size_t len)
>
>  static void rtnl_socket_close(rtnl_ns_t *ns)
>  {
> -  unix_file_del(_main, _main.file_pool[ns->unix_index]);
> +  clib_file_del(_main, _main.file_pool[ns->unix_index]);
>close(ns->rtnl_socket);
>  }
>
> @@ -259,11 +260,11 @@ static int rtnl_socket_open(rtnl_ns_t *ns)
>  return -3;
>}
>
> -  unix_file_t template = {0};
> +  clib_file_t template = {0};
>template.read_function = rtnl_read_cb;
>template.file_descriptor = ns->rtnl_socket;
>template.private_data = (uword) (ns - rm->streams);
> -  ns->unix_index = unix_file_add (_main, );
> +  ns->unix_index = clib_file_add (_main, );
>return 0;
>  }
>
>
> On Wed, Sep 27, 2017 at 1:41 PM, Michael Borokhovich  > wrote:
>
>> Hi Burt, Pawel,
>>
>> Did you eventually manage to install the router plugin with the latest
>> VPP?
>>
>> Thanks,
>> Michael.
>>
>>
>> On Tue, Sep 19, 2017 at 6:05 PM, Burt Silverman  wrote:
>>
>>> Same problem here. I guess the vlib code was updated but the vppsb has
>>> not caught up.
>>>
>>> Burt
>>>
>>> On Mon, Sep 18, 2017 at 12:56 PM, Paweł Staszewski <
>>> pstaszew...@itcare.pl> wrote:
>>>
 Trying to add netlink from vppsb to the latest vpp git but :


  Building netlink in /git/vpp/build-root/build-vpp_debug-native/netlink
 
 make[1]: Entering directory '/git/vpp/build-root/build-vpp
 _debug-native/netlink'
   CC   librtnl/netns.lo
   CC   librtnl/rtnl.lo
   CC   librtnl/mapper.lo
   CC   test/test.lo
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:105:42: error: ‘struct
 unix_file’ declared inside parameter list will not be visible outside of
 this definition or declaration [-Werror]
  static clib_error_t *rtnl_read_cb(struct unix_file * f)
   ^
 /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
 ‘rtnl_read_cb’:
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:109:33: error:
 dereferencing pointer to incomplete type ‘struct unix_file’
rtnl_ns_t *ns = >streams[f->private_data];
  ^~
 /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
 ‘rtnl_socket_close’:
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:141:3: error: implicit
 declaration of function ‘unix_file_del’ [-Werror=implicit-function-dec
 laration]
unix_file_del(_main, 

Re: [vpp-dev] Stable branch for 17.10 pulled

2017-09-27 Thread Luke, Chris
Great work, Florin!

Cheers,
Chris.

From: vpp-dev-boun...@lists.fd.io [mailto:vpp-dev-boun...@lists.fd.io] On 
Behalf Of Florin Coras
Sent: Wednesday, September 27, 2017 21:46
To: vpp-dev 
Subject: [vpp-dev] Stable branch for 17.10 pulled

Folks,

The release branch, stable/1710, for VPP 17.10 has now been pulled and tags 
have been laid. As a result, master is yet again open for all changes.

From this point onward, up until the release date on October 25th [1], we need 
to be disciplined with respect to bugfixes. Here is the traditional list of 
common-sense suggestions:

  • All bug fixes must be double-committed to the release throttle 
as well as to the master branch
  • Commit first to the release throttle, then "git 
cherry-pick" into master
  • Manual merges may be required, depending on the 
degree of divergence between throttle and master
  • All bug fixes need to have a Jira ticket
  • Please put Jira IDs into the commit messages.
  • Please use the same Jira ID

Regards,
Florin

[1] https://wiki.fd.io/view/Projects/vpp/Release_Plans/Release_Plan_17.10
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

[vpp-dev] How to get event using event api by C?

2017-09-27 Thread ????????
Hi,
   I write a simple event client by C. But the program is not all right. Can 
anyone tell me the step is right?

main.c
Description: Binary data


Makefile
Description: Binary data
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

[vpp-dev] Stable branch for 17.10 pulled

2017-09-27 Thread Florin Coras
Folks, 

The release branch, stable/1710, for VPP 17.10 has now been pulled and tags 
have been laid. As a result, master is yet again open for all changes. 

From this point onward, up until the release date on October 25th [1], we need 
to be disciplined with respect to bugfixes. Here is the traditional list of 
common-sense suggestions:

• All bug fixes must be double-committed to the release throttle as 
well as to the master branch
• Commit first to the release throttle, then "git cherry-pick" 
into master
• Manual merges may be required, depending on the degree of 
divergence between throttle and master
• All bug fixes need to have a Jira ticket
• Please put Jira IDs into the commit messages.
• Please use the same Jira ID

Regards, 
Florin

[1] https://wiki.fd.io/view/Projects/vpp/Release_Plans/Release_Plan_17.10 
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

[vpp-dev] ?????? ?????? ?????? How to get interface stats using C api?

2017-09-27 Thread ????????
Thank you very much! After reading this email, I understand the calling event 
api process. But in the step 3, i do not know call which function and how to 
call? In the test/ext/vapi_c_test.c, i can not find the function proto which in 
using. Can you write a simple client which get stat event by C ? Thank you very 
much!




--  --
??: "Klement Sekera -X (ksekera - PANTHEON TECHNOLOGIES at 
Cisco)";;
: 2017??9??27??(??) 3:15
??: ""<15803846...@qq.com>;"Keith Burns";
: "vpp-dev"; 
: Re: [vpp-dev] ?? ??  How to get interface stats using C api?



There are new C and C++ APIs added recently to vpp source code along
with test programs. You can take a look at test/ext/vapi_c_test.c and
vapi_cpp_test.cpp. Functions receiving stats are named test_stats_XXX().
These are there to verify that receiving events works. Functionally,
these are the same, they just test different ways of doing stuff.

At shared memory level it looks like this:

1.) client -> want_stats -> vpp
2.) vpp -> want_stats_reply -> client (confirms subscription)
3.) vpp ->  -> client (when timer fires)

in step 3.), client needs to read the shared memory queue in the
vpp->client direction (or use the appropriate XXX_read() function). Note
that stats take a few seconds to arrive (the test programs require
10-15 seconds of runtime to get some stats).

HTH,
Klement

Quoting  (2017-09-27 04:55:29)
>That is ok??
> Now I am research calling the plugin apis by C. Especially how to call
>the event apis. I would appreciate it if you can write a brief client.
>--  --
>??: "Keith Burns";;
>: 2017??9??27??(??) 10:47
>??: ""<15803846...@qq.com>;
>: "vpp-dev";
>: Re: ?? [vpp-dev] How to get interface stats using C api?
>Apologies,
>It's a callback.
>We probably need some decent literature written for how to consume the
>various C, C++, Python and Lua APIs
>If you have a preference for any of those languages I could write a brief
>client program for you and start work on documenting this stuff.
>On Sep 26, 2017 6:04 PM, "" <[1]15803846...@qq.com> wrote:
> 
>  Hi??
>Thank you for your detail information. After reading this, i can
>  understand. But after calling  "want_per_interface_simple_stats" with
>  enable_disable=1, num=1 and sw_ifs[4], i do not know how to receive this
>  stats. calling other function or variable? Can you tell me how to
>  receive stats in my c program?
> Thanks??
>  --  --
>  ??: "Keith Burns";<[2]alaga...@gmail.com>;
>  : 2017??9??27??(??) 6:39
>  ??: "??
>  ??"<[3]15803846...@qq.com>;"vpp-dev"<[4]vpp-dev@lists.fd.io>;
>  : Re: [vpp-dev] How to get interface stats using C api?
>  Hi there,
>  As of 17.10 you can now register for statistics on a per interface
>  level.
>  You need the sw_if_index of the interface you want stats for, but the
>  calls are in
>  [5]https://git.fd.io/vpp/tree/src/vpp/stats/stats.api
>  but as an example:
>  Register:
> 
>  autoreply define want_per_interface_simple_stats
>  {
>u32 client_index;
>u32 context;
>u32 enable_disable;
>u32 pid;
>u32 num;
>u32 sw_ifs[num];
> 
>  };
> 
>  So calling "want_per_interface_simple_stats" with enable_disable=1, num=1 
> and sw_ifs[4] will give you
> 
>  interface_simple_stats every 10sec for sw_if_index=4.
> 
>  The content of "interface_simple_stats" looks like:
> 
>  /** \brief Simple per interface stats counters structure
>  @param count - number of elements in message
>  @param timestamp - u32 vlib timestamp for control plane
>  @param data[count] - vl_api_vnet_simple_counter_t
> 
>  */
>  manual_print manual_endian define vnet_per_interface_simple_counters
>  {
>u32 count;
>u32 timestamp;
>vl_api_vnet_simple_counter_t data[count];
>  };
> 
>  Where each "vnet_simple_counter_t" looks like:
> 
>  [6]https://git.fd.io/vpp/tree/src/vnet/interface.api
> 
>  /** \brief Simple interface counter data type for 
> vnet_interface_simple_counters
>  @param sw_if_index - interface indexes for counters
>  @param drop - RX or TX drops due to buffer starvation
>  @param punt - used with VNET "punt" disposition
>  @param rx_ip4 - received IP4 packets
>  @param rx_ip6 - received IP6 packets
>  @param rx_no_buffer - no RX buffers available
>  @param rx_miss - receive misses
>  @param rx_error - receive errors
>  @param tx_error - transmit errors
>  @param rx_mpls - received MPLS packet
> 
>  */
>  typeonly manual_print manual_endian define vnet_simple_counter
>  {
>u32 sw_if_index;
>

Re: [vpp-dev] mprove Performance of Kube-proxy and GTP-U using VPP

2017-09-27 Thread Ni, Hongjun
Hi Tran,

Please see below configuration for gtpu-encap, which I used for test:

set int state TenGigabitEthernet5/0/0 up
set int ip table TenGigabitEthernet5/0/0 0
set int ip address TenGigabitEthernet5/0/0 192.168.50.72/24
ip route add 192.168.50.71/24 via 192.168.50.72 TenGigabitEthernet5/0/0
set ip arp TenGigabitEthernet5/0/0 192.168.50.71 90e2.ba48.7a71

set int state TenGigabitEthernet5/0/1 up
set int ip table TenGigabitEthernet5/0/1 0
set int ip address TenGigabitEthernet5/0/1 192.168.50.73/24
ip route add 192.168.50.74/24 via 192.168.50.73 TenGigabitEthernet5/0/1
set ip arp TenGigabitEthernet5/0/1 192.168.50.74 90e2.ba48.7a74

create gtpu tunnel src 192.168.50.72 dst 192.168.50.71 teid 9 encap-vrf-id 0

set int ip address gtpu_tunnel0 192.168.50.75/24
ip route add 192.168.50.70/24 via gtpu_tunnel0
set ip arp gtpu_tunnel0 192.168.50.70 90e2.ba48.7a70

Hope it helps.

-Hongjun

From: Tran Long [mailto:long...@gmail.com]
Sent: Wednesday, September 27, 2017 6:51 PM
To: Ni, Hongjun 
Subject: mprove Performance of Kube-proxy and GTP-U using VPP

Dear Mr Hongjun ni

I have read your slide Improve Performance of Kube-proxy and GTP-U using VPP. 
It's very useful for me. Thank you.

I am building the  vpp  gtp-u and still stuck on it. The packets don't go via 
gtpu-encap. Could you give me a setup guide of vpp gtp-u?

Thank you very much!

Best Regards

--
Tran Bao Long
Phone: (+84) 985 900 949
HaNoi - VietNam
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] Failed to build vpp with vppsb

2017-09-27 Thread Paweł Staszewski

hmm

another error

 Building router in 
/git/vpp/build-root/build-vpp_debug-native/router 
make[1]: Entering directory 
'/git/vpp/build-root/build-vpp_debug-native/router'

  CC   router/tap_inject.lo
  CC   router/tap_inject_netlink.lo
  CC   router/tap_inject_node.lo
  CC   router/tap_inject_tap.lo
/git/vpp/build-data/../router/router/tap_inject_tap.c:33:22: error: 
unknown type name ‘unix_file_t’

 tap_inject_tap_read (unix_file_t * f)
  ^~~
/git/vpp/build-data/../router/router/tap_inject_tap.c: In function 
‘tap_inject_tap_connect’:
/git/vpp/build-data/../router/router/tap_inject_tap.c:55:3: error: 
unknown type name ‘unix_file_t’

   unix_file_t template;
   ^~~
/git/vpp/build-data/../router/router/tap_inject_tap.c:120:11: error: 
request for member ‘read_function’ in something not a structure or union

   template.read_function = tap_inject_tap_read;
   ^
/git/vpp/build-data/../router/router/tap_inject_tap.c:120:28: error: 
‘tap_inject_tap_read’ undeclared (first use in this function)

   template.read_function = tap_inject_tap_read;
    ^~~
/git/vpp/build-data/../router/router/tap_inject_tap.c:120:28: note: each 
undeclared identifier is reported only once for each function it appears in
/git/vpp/build-data/../router/router/tap_inject_tap.c:121:11: error: 
request for member ‘file_descriptor’ in something not a structure or union

   template.file_descriptor = tap_fd;
   ^
/git/vpp/build-data/../router/router/tap_inject_tap.c:123:3: error: 
implicit declaration of function ‘unix_file_add’ 
[-Werror=implicit-function-declaration]

   unix_file_add (_main, );
   ^
cc1: all warnings being treated as errors
Makefile:476: recipe for target 'router/tap_inject_tap.lo' failed
make[1]: *** [router/tap_inject_tap.lo] Error 1
make[1]: *** Waiting for unfinished jobs
make[1]: Leaving directory 
'/git/vpp/build-root/build-vpp_debug-native/router'

Makefile:698: recipe for target 'router-build' failed
make: *** [router-build] Error 2



W dniu 2017-09-27 o 23:06, Paweł Staszewski pisze:


After adding this patch other problem:)

 Building netlink in 
/git/vpp/build-root/build-vpp_debug-native/netlink 
make[1]: Entering directory 
'/git/vpp/build-root/build-vpp_debug-native/netlink'

  CCLD librtnl.la
  CC   test/test.lo
ar: `u' modifier ignored since `D' is the default (see `U')
/git/vpp/build-data/../netlink/test/test.c: In function 
‘mapper_ns_add_command_fn’:
/git/vpp/build-data/../netlink/test/test.c:125:14: error: implicit 
declaration of function ‘ip4_fib_index_from_table_id’ 
[-Werror=implicit-function-declaration]

   u32 fib4 = ip4_fib_index_from_table_id(table_id);
  ^~~
/git/vpp/build-data/../netlink/test/test.c:126:14: error: implicit 
declaration of function ‘ip6_fib_index_from_table_id’ 
[-Werror=implicit-function-declaration]

   u32 fib6 = ip6_fib_index_from_table_id(table_id);
  ^~~
cc1: all warnings being treated as errors
Makefile:520: recipe for target 'test/test.lo' failed
make[1]: *** [test/test.lo] Error 1
make[1]: Leaving directory 
'/git/vpp/build-root/build-vpp_debug-native/netlink'

Makefile:698: recipe for target 'netlink-build' failed
make: *** [netlink-build] Error 2



W dniu 2017-09-27 o 20:06, Burt Silverman pisze:

Hi Michael,

I came up with a patch that compiles, but I have not tested it. 
Hopefully it is this simple:


burts@burtvb:~/vppsb/netlink/librtnl$ git diff .
diff --git a/netlink/librtnl/rtnl.c b/netlink/librtnl/rtnl.c
index 04f0440..fa31617 100644
--- a/netlink/librtnl/rtnl.c
+++ b/netlink/librtnl/rtnl.c
@@ -31,6 +31,7 @@
 #include 
 #include 
+#include 
 #undef DBL_MAX
 #define DBL_MAX 10.0
@@ -102,7 +103,7 @@ rtnl_cancel_timeout(rtnl_ns_t *ns)
   ns->timeout = DBL_MAX;
 }
-static clib_error_t *rtnl_read_cb(struct unix_file * f)
+static clib_error_t *rtnl_read_cb(struct clib_file * f)
 {
   rtnl_main_t *rm = _main;
   vlib_main_t *vm = vlib_get_main();
@@ -138,7 +139,7 @@ int rtnl_dump_request(rtnl_ns_t *ns, int type, 
void *req, size_t len)

 static void rtnl_socket_close(rtnl_ns_t *ns)
 {
-  unix_file_del(_main, _main.file_pool[ns->unix_index]);
+  clib_file_del(_main, _main.file_pool[ns->unix_index]);
   close(ns->rtnl_socket);
 }
@@ -259,11 +260,11 @@ static int rtnl_socket_open(rtnl_ns_t *ns)
     return -3;
   }
-  unix_file_t template = {0};
+  clib_file_t template = {0};
   template.read_function = rtnl_read_cb;
   template.file_descriptor = ns->rtnl_socket;
   template.private_data = (uword) (ns - rm->streams);
-  ns->unix_index = unix_file_add (_main, );
+  ns->unix_index = clib_file_add (_main, );
   return 0;
 }

On Wed, Sep 27, 2017 at 1:41 PM, Michael Borokhovich 
> wrote:


Hi Burt, Pawel,

Did you eventually manage to install the router plugin with the
latest 

Re: [vpp-dev] Failed to build vpp with vppsb

2017-09-27 Thread Paweł Staszewski

ok added

vnet/fib/ip4_fib.h

vnet/fib/ip6_fib.h

to test.c

going next try:)



W dniu 2017-09-27 o 23:06, Paweł Staszewski pisze:


After adding this patch other problem:)

 Building netlink in 
/git/vpp/build-root/build-vpp_debug-native/netlink 
make[1]: Entering directory 
'/git/vpp/build-root/build-vpp_debug-native/netlink'

  CCLD librtnl.la
  CC   test/test.lo
ar: `u' modifier ignored since `D' is the default (see `U')
/git/vpp/build-data/../netlink/test/test.c: In function 
‘mapper_ns_add_command_fn’:
/git/vpp/build-data/../netlink/test/test.c:125:14: error: implicit 
declaration of function ‘ip4_fib_index_from_table_id’ 
[-Werror=implicit-function-declaration]

   u32 fib4 = ip4_fib_index_from_table_id(table_id);
  ^~~
/git/vpp/build-data/../netlink/test/test.c:126:14: error: implicit 
declaration of function ‘ip6_fib_index_from_table_id’ 
[-Werror=implicit-function-declaration]

   u32 fib6 = ip6_fib_index_from_table_id(table_id);
  ^~~
cc1: all warnings being treated as errors
Makefile:520: recipe for target 'test/test.lo' failed
make[1]: *** [test/test.lo] Error 1
make[1]: Leaving directory 
'/git/vpp/build-root/build-vpp_debug-native/netlink'

Makefile:698: recipe for target 'netlink-build' failed
make: *** [netlink-build] Error 2



W dniu 2017-09-27 o 20:06, Burt Silverman pisze:

Hi Michael,

I came up with a patch that compiles, but I have not tested it. 
Hopefully it is this simple:


burts@burtvb:~/vppsb/netlink/librtnl$ git diff .
diff --git a/netlink/librtnl/rtnl.c b/netlink/librtnl/rtnl.c
index 04f0440..fa31617 100644
--- a/netlink/librtnl/rtnl.c
+++ b/netlink/librtnl/rtnl.c
@@ -31,6 +31,7 @@
 #include 
 #include 
+#include 
 #undef DBL_MAX
 #define DBL_MAX 10.0
@@ -102,7 +103,7 @@ rtnl_cancel_timeout(rtnl_ns_t *ns)
   ns->timeout = DBL_MAX;
 }
-static clib_error_t *rtnl_read_cb(struct unix_file * f)
+static clib_error_t *rtnl_read_cb(struct clib_file * f)
 {
   rtnl_main_t *rm = _main;
   vlib_main_t *vm = vlib_get_main();
@@ -138,7 +139,7 @@ int rtnl_dump_request(rtnl_ns_t *ns, int type, 
void *req, size_t len)

 static void rtnl_socket_close(rtnl_ns_t *ns)
 {
-  unix_file_del(_main, _main.file_pool[ns->unix_index]);
+  clib_file_del(_main, _main.file_pool[ns->unix_index]);
   close(ns->rtnl_socket);
 }
@@ -259,11 +260,11 @@ static int rtnl_socket_open(rtnl_ns_t *ns)
     return -3;
   }
-  unix_file_t template = {0};
+  clib_file_t template = {0};
   template.read_function = rtnl_read_cb;
   template.file_descriptor = ns->rtnl_socket;
   template.private_data = (uword) (ns - rm->streams);
-  ns->unix_index = unix_file_add (_main, );
+  ns->unix_index = clib_file_add (_main, );
   return 0;
 }

On Wed, Sep 27, 2017 at 1:41 PM, Michael Borokhovich 
> wrote:


Hi Burt, Pawel,

Did you eventually manage to install the router plugin with the
latest VPP?

Thanks,
Michael.


On Tue, Sep 19, 2017 at 6:05 PM, Burt Silverman > wrote:

Same problem here. I guess the vlib code was updated but the
vppsb has not caught up.

Burt

On Mon, Sep 18, 2017 at 12:56 PM, Paweł Staszewski
> wrote:

Trying to add netlink from vppsb to the latest vpp git but :


 Building netlink in
/git/vpp/build-root/build-vpp_debug-native/netlink 
make[1]: Entering directory
'/git/vpp/build-root/build-vpp_debug-native/netlink'
  CC   librtnl/netns.lo
  CC   librtnl/rtnl.lo
  CC   librtnl/mapper.lo
  CC   test/test.lo
/git/vpp/build-data/../netlink/librtnl/rtnl.c:105:42:
error: ‘struct unix_file’ declared inside parameter list
will not be visible outside of this definition or
declaration [-Werror]
 static clib_error_t *rtnl_read_cb(struct unix_file * f)
^
/git/vpp/build-data/../netlink/librtnl/rtnl.c: In
function ‘rtnl_read_cb’:
/git/vpp/build-data/../netlink/librtnl/rtnl.c:109:33:
error: dereferencing pointer to incomplete type ‘struct
unix_file’
   rtnl_ns_t *ns = >streams[f->private_data];
^~
/git/vpp/build-data/../netlink/librtnl/rtnl.c: In
function ‘rtnl_socket_close’:
/git/vpp/build-data/../netlink/librtnl/rtnl.c:141:3:
error: implicit declaration of function ‘unix_file_del’
[-Werror=implicit-function-declaration]
   unix_file_del(_main,
_main.file_pool[ns->unix_index]);
   ^
/git/vpp/build-data/../netlink/librtnl/rtnl.c:141:39:
error: ‘unix_main_t {aka struct }’ has no
member 

Re: [vpp-dev] Failed to build vpp with vppsb

2017-09-27 Thread Michael Borokhovich
Thanks a lot, Burt! I will try this.

On Wed, Sep 27, 2017 at 4:04 PM, Burt Silverman  wrote:

> The basic "include-what-you-use" philosophy would say that it is *smart*
> (vs. necessary) to add the #include you added, Michael, but on the other
> hand, I believe vppinfra/file.h is included in vlib/unix/unix.h is included
> in rtnl.c, so I do not understand why you got that compiler error. Oh,
> maybe you tried to build something partial without following the "plan"
> spelled out in vppsb/router/README.md. I mean to say, (one more try,) it
> appears that the README.md in vppsb/router is more reliable than the
> README.md in vppsb/netlink: the reliable README.md will make certain that
> the header files get installed as needed into vpp/build-root/install-vpp-
> native/vpp/include/
>
> Burt
>
> On Wed, Sep 27, 2017 at 2:50 PM, Michael Borokhovich  > wrote:
>
>> Thanks, Burt!
>>
>> I've realized that I also need to add #include  to the
>> rtnl.c
>>
>> However it says: "*fatal error: *vppinfra/file.h: No such file or
>> directory"
>>
>> Do you have any suggestions for this? Otherwise, I will try to figure it
>> out.
>>
>> Michael.
>>
>>
>>
>>
>>
>> On Wed, Sep 27, 2017 at 2:06 PM, Burt Silverman  wrote:
>>
>>> Hi Michael,
>>>
>>> I came up with a patch that compiles, but I have not tested it.
>>> Hopefully it is this simple:
>>>
>>> burts@burtvb:~/vppsb/netlink/librtnl$ git diff .
>>> diff --git a/netlink/librtnl/rtnl.c b/netlink/librtnl/rtnl.c
>>> index 04f0440..fa31617 100644
>>> --- a/netlink/librtnl/rtnl.c
>>> +++ b/netlink/librtnl/rtnl.c
>>> @@ -31,6 +31,7 @@
>>>
>>>  #include 
>>>  #include 
>>> +#include 
>>>
>>>  #undef DBL_MAX
>>>  #define DBL_MAX 10.0
>>> @@ -102,7 +103,7 @@ rtnl_cancel_timeout(rtnl_ns_t *ns)
>>>ns->timeout = DBL_MAX;
>>>  }
>>>
>>> -static clib_error_t *rtnl_read_cb(struct unix_file * f)
>>> +static clib_error_t *rtnl_read_cb(struct clib_file * f)
>>>  {
>>>rtnl_main_t *rm = _main;
>>>vlib_main_t *vm = vlib_get_main();
>>> @@ -138,7 +139,7 @@ int rtnl_dump_request(rtnl_ns_t *ns, int type, void
>>> *req, size_t len)
>>>
>>>  static void rtnl_socket_close(rtnl_ns_t *ns)
>>>  {
>>> -  unix_file_del(_main, _main.file_pool[ns->unix_index]);
>>> +  clib_file_del(_main, _main.file_pool[ns->unix_index]);
>>>close(ns->rtnl_socket);
>>>  }
>>>
>>> @@ -259,11 +260,11 @@ static int rtnl_socket_open(rtnl_ns_t *ns)
>>>  return -3;
>>>}
>>>
>>> -  unix_file_t template = {0};
>>> +  clib_file_t template = {0};
>>>template.read_function = rtnl_read_cb;
>>>template.file_descriptor = ns->rtnl_socket;
>>>template.private_data = (uword) (ns - rm->streams);
>>> -  ns->unix_index = unix_file_add (_main, );
>>> +  ns->unix_index = clib_file_add (_main, );
>>>return 0;
>>>  }
>>>
>>>
>>> On Wed, Sep 27, 2017 at 1:41 PM, Michael Borokhovich <
>>> michael...@gmail.com> wrote:
>>>
 Hi Burt, Pawel,

 Did you eventually manage to install the router plugin with the latest
 VPP?

 Thanks,
 Michael.


 On Tue, Sep 19, 2017 at 6:05 PM, Burt Silverman 
 wrote:

> Same problem here. I guess the vlib code was updated but the vppsb has
> not caught up.
>
> Burt
>
> On Mon, Sep 18, 2017 at 12:56 PM, Paweł Staszewski <
> pstaszew...@itcare.pl> wrote:
>
>> Trying to add netlink from vppsb to the latest vpp git but :
>>
>>
>>  Building netlink in 
>> /git/vpp/build-root/build-vpp_debug-native/netlink
>> 
>> make[1]: Entering directory '/git/vpp/build-root/build-vpp
>> _debug-native/netlink'
>>   CC   librtnl/netns.lo
>>   CC   librtnl/rtnl.lo
>>   CC   librtnl/mapper.lo
>>   CC   test/test.lo
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:105:42: error: ‘struct
>> unix_file’ declared inside parameter list will not be visible outside of
>> this definition or declaration [-Werror]
>>  static clib_error_t *rtnl_read_cb(struct unix_file * f)
>>   ^
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
>> ‘rtnl_read_cb’:
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:109:33: error:
>> dereferencing pointer to incomplete type ‘struct unix_file’
>>rtnl_ns_t *ns = >streams[f->private_data];
>>  ^~
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
>> ‘rtnl_socket_close’:
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:141:3: error: implicit
>> declaration of function ‘unix_file_del’ [-Werror=implicit-function-dec
>> laration]
>>unix_file_del(_main, _main.file_pool[ns->unix_index]);
>>^
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:141:39: error:
>> ‘unix_main_t {aka struct }’ has no member named ‘file_pool’
>>unix_file_del(_main, 

Re: [vpp-dev] Failed to build vpp with vppsb

2017-09-27 Thread Michael Borokhovich
Thanks, Burt!

I've realized that I also need to add #include  to the
rtnl.c

However it says: "*fatal error: *vppinfra/file.h: No such file or directory"

Do you have any suggestions for this? Otherwise, I will try to figure it
out.

Michael.





On Wed, Sep 27, 2017 at 2:06 PM, Burt Silverman  wrote:

> Hi Michael,
>
> I came up with a patch that compiles, but I have not tested it. Hopefully
> it is this simple:
>
> burts@burtvb:~/vppsb/netlink/librtnl$ git diff .
> diff --git a/netlink/librtnl/rtnl.c b/netlink/librtnl/rtnl.c
> index 04f0440..fa31617 100644
> --- a/netlink/librtnl/rtnl.c
> +++ b/netlink/librtnl/rtnl.c
> @@ -31,6 +31,7 @@
>
>  #include 
>  #include 
> +#include 
>
>  #undef DBL_MAX
>  #define DBL_MAX 10.0
> @@ -102,7 +103,7 @@ rtnl_cancel_timeout(rtnl_ns_t *ns)
>ns->timeout = DBL_MAX;
>  }
>
> -static clib_error_t *rtnl_read_cb(struct unix_file * f)
> +static clib_error_t *rtnl_read_cb(struct clib_file * f)
>  {
>rtnl_main_t *rm = _main;
>vlib_main_t *vm = vlib_get_main();
> @@ -138,7 +139,7 @@ int rtnl_dump_request(rtnl_ns_t *ns, int type, void
> *req, size_t len)
>
>  static void rtnl_socket_close(rtnl_ns_t *ns)
>  {
> -  unix_file_del(_main, _main.file_pool[ns->unix_index]);
> +  clib_file_del(_main, _main.file_pool[ns->unix_index]);
>close(ns->rtnl_socket);
>  }
>
> @@ -259,11 +260,11 @@ static int rtnl_socket_open(rtnl_ns_t *ns)
>  return -3;
>}
>
> -  unix_file_t template = {0};
> +  clib_file_t template = {0};
>template.read_function = rtnl_read_cb;
>template.file_descriptor = ns->rtnl_socket;
>template.private_data = (uword) (ns - rm->streams);
> -  ns->unix_index = unix_file_add (_main, );
> +  ns->unix_index = clib_file_add (_main, );
>return 0;
>  }
>
>
> On Wed, Sep 27, 2017 at 1:41 PM, Michael Borokhovich  > wrote:
>
>> Hi Burt, Pawel,
>>
>> Did you eventually manage to install the router plugin with the latest
>> VPP?
>>
>> Thanks,
>> Michael.
>>
>>
>> On Tue, Sep 19, 2017 at 6:05 PM, Burt Silverman  wrote:
>>
>>> Same problem here. I guess the vlib code was updated but the vppsb has
>>> not caught up.
>>>
>>> Burt
>>>
>>> On Mon, Sep 18, 2017 at 12:56 PM, Paweł Staszewski <
>>> pstaszew...@itcare.pl> wrote:
>>>
 Trying to add netlink from vppsb to the latest vpp git but :


  Building netlink in /git/vpp/build-root/build-vpp_debug-native/netlink
 
 make[1]: Entering directory '/git/vpp/build-root/build-vpp
 _debug-native/netlink'
   CC   librtnl/netns.lo
   CC   librtnl/rtnl.lo
   CC   librtnl/mapper.lo
   CC   test/test.lo
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:105:42: error: ‘struct
 unix_file’ declared inside parameter list will not be visible outside of
 this definition or declaration [-Werror]
  static clib_error_t *rtnl_read_cb(struct unix_file * f)
   ^
 /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
 ‘rtnl_read_cb’:
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:109:33: error:
 dereferencing pointer to incomplete type ‘struct unix_file’
rtnl_ns_t *ns = >streams[f->private_data];
  ^~
 /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
 ‘rtnl_socket_close’:
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:141:3: error: implicit
 declaration of function ‘unix_file_del’ [-Werror=implicit-function-dec
 laration]
unix_file_del(_main, _main.file_pool[ns->unix_index]);
^
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:141:39: error:
 ‘unix_main_t {aka struct }’ has no member named ‘file_pool’
unix_file_del(_main, _main.file_pool[ns->unix_index]);
^
 /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
 ‘rtnl_socket_open’:
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:262:3: error: unknown
 type name ‘unix_file_t’
unix_file_t template = {0};
^~~
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:263:11: error: request
 for member ‘read_function’ in something not a structure or union
template.read_function = rtnl_read_cb;
^
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:264:11: error: request
 for member ‘file_descriptor’ in something not a structure or union
template.file_descriptor = ns->rtnl_socket;
^
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:265:11: error: request
 for member ‘private_data’ in something not a structure or union
template.private_data = (uword) (ns - rm->streams);
^
 /git/vpp/build-data/../netlink/librtnl/rtnl.c:266:20: error: implicit
 declaration of function ‘unix_file_add’ [-Werror=implicit-function-dec
 laration]
ns->unix_index = unix_file_add (_main, );

Re: [vpp-dev] Failed to use vcl_test_client

2017-09-27 Thread John Lo (loj)
I am able to use memfd with 14.04 by updating its kernel to 3.19 (my 14.04 
kernel was 3.13 before the update).

I also had to add the following to /usr/include/x86_64-linux-gnu/asm/unistd_64.h
#define __NR_memfd_create 319

Hope this works for you,
John

From: vpp-dev-boun...@lists.fd.io [mailto:vpp-dev-boun...@lists.fd.io] On 
Behalf Of Florin Coras
Sent: Wednesday, September 27, 2017 10:46 AM
To: 薛欣颖 
Cc: vpp-dev 
Subject: Re: [vpp-dev] Failed to use vcl_test_client

Hi xyxue,

VPP now has a dependency on memfd which is not available in 14.04. 
Unfortunately, that means you’ll have to switch to ubuntu 16.04.

Florin

On Sep 27, 2017, at 1:34 AM, 薛欣颖 
> wrote:

Hi Florin,

There is a compile error:not support ‘__NR_memfd_create’
/home/vpp_communication/vpp/build-root/../src/vppinfra/linux/syscall.h:45:19: 
error: '__NR_memfd_create' undeclared (first use in this function)
   return syscall (__NR_memfd_create, name, flags);

Is the kernel version of the problem ?  What is your kernel version?

The Kernel version of mine:
root@ubuntu:/home/vpp_communication/vppsb/vcl-ldpreload/src# uname -a
Linux ubuntu 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 
2016 x86_64 x86_64 x86_64 GNU/Linux

 If I change ‘return syscall (__NR_memfd_create, name, flags);’ to ‘return 0’.
 Will the vcl function  be affected?

Thanks,
xyxue

From: Florin Coras
Date: 2017-09-20 13:05
To: 薛欣颖
CC: dwallacelf; vpp-dev
Subject: Re: [vpp-dev] Failed to use vcl_test_client
Hi xyxue,

I just tested the stack with linux and everything seems to be working fine. I 
tested the stack with linux using uri_tcp_test and nc and the cut-through path 
with the vcl test tools. How are you running the server?

Florin

On Sep 19, 2017, at 8:29 PM, 薛欣颖 
> wrote:

Hi Florin,

The server is started on the peer vpp . And through  
'sock_test_client/sock_test_server' can be normal communication.

Thanks,
xyxue

From: Florin Coras
Date: 2017-09-20 10:52
To: 薛欣颖
CC: dwallacelf; vpp-dev
Subject: Re: [vpp-dev] Failed to use vcl_test_client
Hi xyxue,

What you’re getting is a connect fail because, I assume from trace, the server 
is not started on the peer vpp. Because the server is not started, i.e., bind 
wasn’t called, when the peer vpp receives the syn it replies with a reset. That 
reset finally results in a connect fail notify.

As for your other questions:

1. Obviously, the one in vpp is for handling connect requests from applications 
while the one in vppcom is for cut-through session. That is, vpp acts as 
introduction mechanism for the two apps which afterwards exchange data via 
shared memory fifos.
2. For exchanging control messages, e.g., bind, connect, accept, they use the 
binary api. For exchanging data, that is, moving data from vpp to vcl and 
vice-versa, they use shared memory fifos.
3. That message is a notification from vpp to the application (vcl in this 
case) regarding a previous connect attempt. As you’ve discovered, if is_fail=1, 
the connect attempt failed.

Hope this helps,
Florin

On Sep 19, 2017, at 7:30 PM, 薛欣颖 
> wrote:


Hi ,

There are still problems:
root@ubuntu:/home/vpp_communication/vpp/build-root/install-vpp-native/vpp/bin# 
./vcl_test_client -U 1.1.1.2 22000

CLIENT: Connecting to server...
vl_api_connect_session_reply_t_handler:697: [9478] connect failed: Session 
failed to connect (-115)


Breakpoint 1, send_session_connected_callback (app_index=1, api_context=0, 
s=0x0, is_fail=1 '\001')
at 
/home/vpp_communication/vpp/build-data/../src/vnet/session/session_api.c:157
157 {
(gdb) bt
#0  send_session_connected_callback (app_index=1, api_context=0, s=0x0, 
is_fail=1 '\001')
at 
/home/vpp_communication/vpp/build-data/../src/vnet/session/session_api.c:157
#1  0x7f35c658459c in stream_session_connect_notify (tc=0x7f358585e3f8, 
is_fail=,
is_fail@entry=1 '\001') at 
/home/vpp_communication/vpp/build-data/../src/vnet/session/session.c:489
#2  0x7f35c6456972 in tcp_connection_reset (tc=tc@entry=0x7f358585e3f8)
at /home/vpp_communication/vpp/build-data/../src/vnet/tcp/tcp.c:258
#3  0x7f35c6429977 in tcp46_syn_sent_inline (is_ip4=1, 
from_frame=, node=,
vm=) at 
/home/vpp_communication/vpp/build-data/../src/vnet/tcp/tcp_input.c:2023
#4  tcp4_syn_sent (vm=, node=, 
from_frame=)
at /home/vpp_communication/vpp/build-data/../src/vnet/tcp/tcp_input.c:2184
#5  0x7f35c6962d14 in dispatch_node (last_time_stamp=204974335045786, 
frame=0x7f35858596c0,
dispatch_state=VLIB_NODE_STATE_POLLING, type=VLIB_NODE_TYPE_INTERNAL, 
node=0x7f3584da06c0,




code segment:
int

Re: [vpp-dev] Failed to build vpp with vppsb

2017-09-27 Thread Burt Silverman
Hi Michael,

I came up with a patch that compiles, but I have not tested it. Hopefully
it is this simple:

burts@burtvb:~/vppsb/netlink/librtnl$ git diff .
diff --git a/netlink/librtnl/rtnl.c b/netlink/librtnl/rtnl.c
index 04f0440..fa31617 100644
--- a/netlink/librtnl/rtnl.c
+++ b/netlink/librtnl/rtnl.c
@@ -31,6 +31,7 @@

 #include 
 #include 
+#include 

 #undef DBL_MAX
 #define DBL_MAX 10.0
@@ -102,7 +103,7 @@ rtnl_cancel_timeout(rtnl_ns_t *ns)
   ns->timeout = DBL_MAX;
 }

-static clib_error_t *rtnl_read_cb(struct unix_file * f)
+static clib_error_t *rtnl_read_cb(struct clib_file * f)
 {
   rtnl_main_t *rm = _main;
   vlib_main_t *vm = vlib_get_main();
@@ -138,7 +139,7 @@ int rtnl_dump_request(rtnl_ns_t *ns, int type, void
*req, size_t len)

 static void rtnl_socket_close(rtnl_ns_t *ns)
 {
-  unix_file_del(_main, _main.file_pool[ns->unix_index]);
+  clib_file_del(_main, _main.file_pool[ns->unix_index]);
   close(ns->rtnl_socket);
 }

@@ -259,11 +260,11 @@ static int rtnl_socket_open(rtnl_ns_t *ns)
 return -3;
   }

-  unix_file_t template = {0};
+  clib_file_t template = {0};
   template.read_function = rtnl_read_cb;
   template.file_descriptor = ns->rtnl_socket;
   template.private_data = (uword) (ns - rm->streams);
-  ns->unix_index = unix_file_add (_main, );
+  ns->unix_index = clib_file_add (_main, );
   return 0;
 }


On Wed, Sep 27, 2017 at 1:41 PM, Michael Borokhovich 
wrote:

> Hi Burt, Pawel,
>
> Did you eventually manage to install the router plugin with the latest VPP?
>
> Thanks,
> Michael.
>
>
> On Tue, Sep 19, 2017 at 6:05 PM, Burt Silverman  wrote:
>
>> Same problem here. I guess the vlib code was updated but the vppsb has
>> not caught up.
>>
>> Burt
>>
>> On Mon, Sep 18, 2017 at 12:56 PM, Paweł Staszewski > > wrote:
>>
>>> Trying to add netlink from vppsb to the latest vpp git but :
>>>
>>>
>>>  Building netlink in /git/vpp/build-root/build-vpp_debug-native/netlink
>>> 
>>> make[1]: Entering directory '/git/vpp/build-root/build-vpp
>>> _debug-native/netlink'
>>>   CC   librtnl/netns.lo
>>>   CC   librtnl/rtnl.lo
>>>   CC   librtnl/mapper.lo
>>>   CC   test/test.lo
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:105:42: error: ‘struct
>>> unix_file’ declared inside parameter list will not be visible outside of
>>> this definition or declaration [-Werror]
>>>  static clib_error_t *rtnl_read_cb(struct unix_file * f)
>>>   ^
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
>>> ‘rtnl_read_cb’:
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:109:33: error:
>>> dereferencing pointer to incomplete type ‘struct unix_file’
>>>rtnl_ns_t *ns = >streams[f->private_data];
>>>  ^~
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
>>> ‘rtnl_socket_close’:
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:141:3: error: implicit
>>> declaration of function ‘unix_file_del’ [-Werror=implicit-function-dec
>>> laration]
>>>unix_file_del(_main, _main.file_pool[ns->unix_index]);
>>>^
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:141:39: error:
>>> ‘unix_main_t {aka struct }’ has no member named ‘file_pool’
>>>unix_file_del(_main, _main.file_pool[ns->unix_index]);
>>>^
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
>>> ‘rtnl_socket_open’:
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:262:3: error: unknown
>>> type name ‘unix_file_t’
>>>unix_file_t template = {0};
>>>^~~
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:263:11: error: request
>>> for member ‘read_function’ in something not a structure or union
>>>template.read_function = rtnl_read_cb;
>>>^
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:264:11: error: request
>>> for member ‘file_descriptor’ in something not a structure or union
>>>template.file_descriptor = ns->rtnl_socket;
>>>^
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:265:11: error: request
>>> for member ‘private_data’ in something not a structure or union
>>>template.private_data = (uword) (ns - rm->streams);
>>>^
>>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:266:20: error: implicit
>>> declaration of function ‘unix_file_add’ [-Werror=implicit-function-dec
>>> laration]
>>>ns->unix_index = unix_file_add (_main, );
>>> ^
>>> cc1: all warnings being treated as errors
>>> Makefile:520: recipe for target 'librtnl/rtnl.lo' failed
>>> make[1]: *** [librtnl/rtnl.lo] Error 1
>>> make[1]: *** Waiting for unfinished jobs
>>> /git/vpp/build-data/../netlink/test/test.c: In function
>>> ‘mapper_ns_add_command_fn’:
>>> /git/vpp/build-data/../netlink/test/test.c:125:14: error: implicit
>>> declaration of function ‘ip4_fib_index_from_table_id’
>>> [-Werror=implicit-function-declaration]
>>>   

Re: [vpp-dev] Failed to build vpp with vppsb

2017-09-27 Thread Michael Borokhovich
Hi Burt, Pawel,

Did you eventually manage to install the router plugin with the latest VPP?

Thanks,
Michael.


On Tue, Sep 19, 2017 at 6:05 PM, Burt Silverman  wrote:

> Same problem here. I guess the vlib code was updated but the vppsb has not
> caught up.
>
> Burt
>
> On Mon, Sep 18, 2017 at 12:56 PM, Paweł Staszewski 
> wrote:
>
>> Trying to add netlink from vppsb to the latest vpp git but :
>>
>>
>>  Building netlink in /git/vpp/build-root/build-vpp_debug-native/netlink
>> 
>> make[1]: Entering directory '/git/vpp/build-root/build-vpp
>> _debug-native/netlink'
>>   CC   librtnl/netns.lo
>>   CC   librtnl/rtnl.lo
>>   CC   librtnl/mapper.lo
>>   CC   test/test.lo
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:105:42: error: ‘struct
>> unix_file’ declared inside parameter list will not be visible outside of
>> this definition or declaration [-Werror]
>>  static clib_error_t *rtnl_read_cb(struct unix_file * f)
>>   ^
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
>> ‘rtnl_read_cb’:
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:109:33: error:
>> dereferencing pointer to incomplete type ‘struct unix_file’
>>rtnl_ns_t *ns = >streams[f->private_data];
>>  ^~
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
>> ‘rtnl_socket_close’:
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:141:3: error: implicit
>> declaration of function ‘unix_file_del’ [-Werror=implicit-function-dec
>> laration]
>>unix_file_del(_main, _main.file_pool[ns->unix_index]);
>>^
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:141:39: error:
>> ‘unix_main_t {aka struct }’ has no member named ‘file_pool’
>>unix_file_del(_main, _main.file_pool[ns->unix_index]);
>>^
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c: In function
>> ‘rtnl_socket_open’:
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:262:3: error: unknown type
>> name ‘unix_file_t’
>>unix_file_t template = {0};
>>^~~
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:263:11: error: request for
>> member ‘read_function’ in something not a structure or union
>>template.read_function = rtnl_read_cb;
>>^
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:264:11: error: request for
>> member ‘file_descriptor’ in something not a structure or union
>>template.file_descriptor = ns->rtnl_socket;
>>^
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:265:11: error: request for
>> member ‘private_data’ in something not a structure or union
>>template.private_data = (uword) (ns - rm->streams);
>>^
>> /git/vpp/build-data/../netlink/librtnl/rtnl.c:266:20: error: implicit
>> declaration of function ‘unix_file_add’ [-Werror=implicit-function-dec
>> laration]
>>ns->unix_index = unix_file_add (_main, );
>> ^
>> cc1: all warnings being treated as errors
>> Makefile:520: recipe for target 'librtnl/rtnl.lo' failed
>> make[1]: *** [librtnl/rtnl.lo] Error 1
>> make[1]: *** Waiting for unfinished jobs
>> /git/vpp/build-data/../netlink/test/test.c: In function
>> ‘mapper_ns_add_command_fn’:
>> /git/vpp/build-data/../netlink/test/test.c:125:14: error: implicit
>> declaration of function ‘ip4_fib_index_from_table_id’
>> [-Werror=implicit-function-declaration]
>>u32 fib4 = ip4_fib_index_from_table_id(table_id);
>>   ^~~
>> /git/vpp/build-data/../netlink/test/test.c:126:14: error: implicit
>> declaration of function ‘ip6_fib_index_from_table_id’
>> [-Werror=implicit-function-declaration]
>>u32 fib6 = ip6_fib_index_from_table_id(table_id);
>>   ^~~
>> cc1: all warnings being treated as errors
>> Makefile:520: recipe for target 'test/test.lo' failed
>> make[1]: *** [test/test.lo] Error 1
>> make[1]: Leaving directory '/git/vpp/build-root/build-vpp
>> _debug-native/netlink'
>> Makefile:698: recipe for target 'netlink-build' failed
>> make: *** [netlink-build] Error 2
>>
>>
>>
>>
>>
>> W dniu 2017-09-17 o 16:27, Paweł Staszewski pisze:
>>
>> Also latest vpp from git without including vppsb
>>>
>>> Sep 17 16:28:02 ubuntu systemd[1]: vpp.service: Service hold-off time
>>> over, scheduling restart.
>>> Sep 17 16:28:02 ubuntu systemd[1]: Stopped vector packet processing
>>> engine.
>>> Sep 17 16:28:02 ubuntu systemd[1]: Starting vector packet processing
>>> engine...
>>> Sep 17 16:28:02 ubuntu systemd[1]: Started vector packet processing
>>> engine.
>>> Sep 17 16:28:02 ubuntu vpp[1557]: vlib_plugin_early_init:356: plugin
>>> path /usr/lib/vpp_plugins
>>> Sep 17 16:28:02 ubuntu vpp[1557]: load_one_plugin:184: Loaded plugin:
>>> acl_plugin.so (Access Control Lists)
>>> Sep 17 16:28:02 ubuntu vpp[1557]: load_one_plugin:142:
>>> /usr/lib/vpp_plugins/dpdk_plugin.so: undefined symbol:
>>> 

Re: [vpp-dev] Failed to use vcl_test_client

2017-09-27 Thread Florin Coras
Hi xyxue, 

VPP now has a dependency on memfd which is not available in 14.04. 
Unfortunately, that means you’ll have to switch to ubuntu 16.04. 

Florin

> On Sep 27, 2017, at 1:34 AM, 薛欣颖  wrote:
> 
>> Hi Florin,
>> 
> There is a compile error:not support ‘__NR_memfd_create’
> /home/vpp_communication/vpp/build-root/../src/vppinfra/linux/syscall.h:45:19: 
> error: '__NR_memfd_create' undeclared (first use in this function)
>return syscall (__NR_memfd_create, name, flags);
>
> Is the kernel version of the problem ?  What is your kernel version?
>  
> The Kernel version of mine:
> root@ubuntu:/home/vpp_communication/vppsb/vcl-ldpreload/src# uname -a
> Linux ubuntu 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 
> 2016 x86_64 x86_64 x86_64 GNU/Linux
> 
>  If I change ‘return syscall (__NR_memfd_create, name, flags);’ to ‘return 0’.
>  Will the vcl function  be affected?
> 
> Thanks,
> xyxue
>  
> From: Florin Coras 
> Date: 2017-09-20 13:05
> To: 薛欣颖 
> CC: dwallacelf ; vpp-dev 
> 
> Subject: Re: [vpp-dev] Failed to use vcl_test_client
> Hi xyxue, 
> 
> I just tested the stack with linux and everything seems to be working fine. I 
> tested the stack with linux using uri_tcp_test and nc and the cut-through 
> path with the vcl test tools. How are you running the server?
> 
> Florin
> 
>> On Sep 19, 2017, at 8:29 PM, 薛欣颖 > > wrote:
>> 
>> Hi Florin,
>> 
>> The server is started on the peer vpp . And through  
>> 'sock_test_client/sock_test_server' can be normal communication.
>> 
>> Thanks,
>> xyxue
>>  
>> From: Florin Coras 
>> Date: 2017-09-20 10:52
>> To: 薛欣颖 
>> CC: dwallacelf ; vpp-dev 
>> 
>> Subject: Re: [vpp-dev] Failed to use vcl_test_client
>> Hi xyxue,
>> 
>> What you’re getting is a connect fail because, I assume from trace, the 
>> server is not started on the peer vpp. Because the server is not started, 
>> i.e., bind wasn’t called, when the peer vpp receives the syn it replies with 
>> a reset. That reset finally results in a connect fail notify. 
>> 
>> As for your other questions:
>> 
>> 1. Obviously, the one in vpp is for handling connect requests from 
>> applications while the one in vppcom is for cut-through session. That is, 
>> vpp acts as introduction mechanism for the two apps which afterwards 
>> exchange data via shared memory fifos. 
>> 2. For exchanging control messages, e.g., bind, connect, accept, they use 
>> the binary api. For exchanging data, that is, moving data from vpp to vcl 
>> and vice-versa, they use shared memory fifos. 
>> 3. That message is a notification from vpp to the application (vcl in this 
>> case) regarding a previous connect attempt. As you’ve discovered, if 
>> is_fail=1, the connect attempt failed. 
>> 
>> Hope this helps, 
>> Florin
>> 
>>> On Sep 19, 2017, at 7:30 PM, 薛欣颖 >> > wrote:
>>> 
>>> 
>>> Hi ,
>>> 
>>> There are still problems:
>>> root@ubuntu:/home/vpp_communication/vpp/build-root/install-vpp-native/vpp/bin#
>>>  ./vcl_test_client -U 1.1.1.2 22000
>>> 
>>> CLIENT: Connecting to server...
>>> vl_api_connect_session_reply_t_handler:697: [9478] connect failed: Session 
>>> failed to connect (-115)
>>> 
>>> Breakpoint 1, send_session_connected_callback (app_index=1, api_context=0, 
>>> s=0x0, is_fail=1 '\001')
>>> at 
>>> /home/vpp_communication/vpp/build-data/../src/vnet/session/session_api.c:157
>>> 157 {
>>> (gdb) bt
>>> #0  send_session_connected_callback (app_index=1, api_context=0, s=0x0, 
>>> is_fail=1 '\001')
>>> at 
>>> /home/vpp_communication/vpp/build-data/../src/vnet/session/session_api.c:157
>>> #1  0x7f35c658459c in stream_session_connect_notify (tc=0x7f358585e3f8, 
>>> is_fail=, 
>>> is_fail@entry=1 '\001') at 
>>> /home/vpp_communication/vpp/build-data/../src/vnet/session/session.c:489
>>> #2  0x7f35c6456972 in tcp_connection_reset (tc=tc@entry=0x7f358585e3f8)
>>> at /home/vpp_communication/vpp/build-data/../src/vnet/tcp/tcp.c:258
>>> #3  0x7f35c6429977 in tcp46_syn_sent_inline (is_ip4=1, 
>>> from_frame=, node=, 
>>> vm=) at 
>>> /home/vpp_communication/vpp/build-data/../src/vnet/tcp/tcp_input.c:2023
>>> #4  tcp4_syn_sent (vm=, node=, 
>>> from_frame=)
>>> at 
>>> /home/vpp_communication/vpp/build-data/../src/vnet/tcp/tcp_input.c:2184
>>> #5  0x7f35c6962d14 in dispatch_node (last_time_stamp=204974335045786, 
>>> frame=0x7f35858596c0, 
>>> dispatch_state=VLIB_NODE_STATE_POLLING, type=VLIB_NODE_TYPE_INTERNAL, 
>>> node=0x7f3584da06c0, 
>>> 
>>> 
>>> code segment:
>>> int
>>> send_session_connected_callback (u32 app_index, u32 api_context,
>>>  stream_session_t * s, u8 is_fail)
>>> {

[vpp-dev] problem with double tagged packet on host interface (af-packet-input)

2017-09-27 Thread Balaji Kn
Hello,

I am working on VPP 17.07.

I have created a sub-interface on host-interface with double tag (QinQ) and
exact match. Intention was to dedicate this sub-interface for processing
double tagged packets received on host interface with exact match.

*create sub-interface GigabitEthernet0/9/0 20 dot1ad 100 inner-dot1q 20
exact-match*

I have assigned IP for host-interface and sub-interface created on
host-interface and changed state to UP.

However exact match double tagged packets (received on af-packet-input) are
received only on base host-interface, but not on sub-interface created on
host interface.

Please can you let me know whether sub-interface is supported or not for
host interfaces? I am not seeing any issues with dpdk-input.

Regards,
Balaji
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] deadlock issue in VPP during DHCP packet processing

2017-09-27 Thread Balaji Kn
Hi John,

Applying the patch to 17.07 tree did not solved the issue.I am observing
many compilation issues with latest image of master and could not verify.

Am i missing anything?

Regards,
Balaji

On Tue, Sep 26, 2017 at 7:15 PM, John Lo (loj)  wrote:

> There was a patch recently merged in mater/17.10:
>
> https://gerrit.fd.io/r/#/c/8464/
>
>
>
> Can you try the latest image from master/17.10 or apply the patch it into
> your 17.07 tree and rebuild?
>
>
>
> Regards,
>
> John
>
>
>
> *From:* vpp-dev-boun...@lists.fd.io [mailto:vpp-dev-boun...@lists.fd.io] *On
> Behalf Of *Balaji Kn
> *Sent:* Tuesday, September 26, 2017 8:37 AM
> *To:* vpp-dev@lists.fd.io
> *Subject:* [vpp-dev] deadlock issue in VPP during DHCP packet processing
>
>
>
> Hello All,
>
>
>
> I am working on VPP 17.07 and using DHCP proxy functionality. CPU
> configuration provided as one main thread and one worker thread.
>
>
>
> cpu {
>
>   main-core 0
>
>   corelist-workers 1
>
> }
>
>
>
> Deadlock is observed while processing DHCP offer packet in VPP. However
> issue is not observed if i comment CPU configuration in startup.conf file
> (if running in single thread) and everything works smoothly.
>
>
>
> *Following message is displayed on console.*
>
> vlib_worker_thread_barrier_sync: worker thread deadlock
>
>
>
> *Backtrace from core file generated.*
>
> [New LWP 12792]
>
> [Thread debugging using libthread_db enabled]
>
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>
> Core was generated by `/usr/bin/vpp -c /etc/vpp/startup.conf'.
>
> Program terminated with signal SIGABRT, Aborted.
>
> #0  0x7f721ab0fc37 in __GI_raise (sig=sig@entry=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>
> 56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or
> directory.
>
> (gdb) bt
>
> #0  0x7f721ab0fc37 in __GI_raise (sig=sig@entry=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:56
>
> #1  0x7f721ab13028 in __GI_abort () at abort.c:89
>
> #2  0x00407073 in os_panic () at /root/vfe/fe-vfe/datapath/vpp/
> build-data/../src/vpp/vnet/main.c:263
>
> #3  0x7f721c0b5d5d in vlib_worker_thread_barrier_sync
> (vm=0x7f721c2e12e0 )
>
> at /root/vfe/fe-vfe/datapath/vpp/build-data/../src/vlib/threads.c:1192
>
> #4  0x7f721c2e973a in vl_msg_api_handler_with_vm_node 
> (am=am@entry=0x7f721c5063a0
> , the_msg=the_msg@entry=0x304bc6d4,
>
> vm=vm@entry=0x7f721c2e12e0 , node=node@entry=
> 0x7f71da6a8000)
>
> at /root/vfe/fe-vfe/datapath/vpp/build-data/../src/vlibapi/api_
> shared.c:501
>
> #5  0x7f721c2f34be in memclnt_process (vm=,
> node=0x7f71da6a8000, f=)
>
> at /root/vfe/fe-vfe/datapath/vpp/build-data/../src/vlibmemory/
> memory_vlib.c:544
>
> #6  0x7f721c08ec96 in vlib_process_bootstrap (_a=)
>
> at /root/vfe/fe-vfe/datapath/vpp/build-data/../src/vlib/main.c:1259
>
> #7  0x7f721b2ec858 in clib_calljmp () at /root/vfe/fe-vfe/datapath/vpp/
> build-data/../src/vppinfra/longjmp.S:110
>
> #8  0x7f71da9efe20 in ?? ()
>
> #9  0x7f721c090041 in vlib_process_startup (f=0x0, p=0x7f71da6a8000,
> vm=0x7f721c2e12e0 )
>
> at /root/vfe/fe-vfe/datapath/vpp/build-data/../src/vlib/main.c:1281
>
> #10 dispatch_process (vm=0x7f721c2e12e0 ,
> p=0x7f71da6a8000, last_time_stamp=58535483853222, f=0x0)
>
> at /root/vfe/fe-vfe/datapath/vpp/build-data/../src/vlib/main.c:1324
>
> #11 0x00d800d9 in ?? ()
>
>
>
> Any pointers would be appreciated.
>
>
>
> Regards,
>
> Balaji
>
>
>
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

[vpp-dev] NAT plugin -- Input ACL support before NAT and Multiple outside interfaces

2017-09-27 Thread st.linux.ily via vpp-dev
Hi Matus,

From https://lists.fd.io/pipermail/vpp-dev/2017-March/004393.html, I know it's 
support multiple outside interfaces. But how to make the taffic do the correct 
NAT action?

For example:
traffic to 192.168.20.22 will go to host-wan1 with 192.168.20.20 as new source 
ip;
traffic to 192.168.30.22 will go to host-wan2 with 192.168.30.20 as new source 
ip;

 vpp# show nat44 detail
NAT plugin mode: dynamic translations enabled
loop0 in
host-wan1 out
host-wan2 out
192.168.20.20
  tenant VRF independent
  0 busy udp ports
  0 busy tcp ports
  10 busy icmp ports
192.168.30.20
  tenant VRF independent
  0 busy udp ports
  0 busy tcp ports
  0 busy icmp ports

Requirement: Destination-based NAT scenarios where the same inside address 
needs to be translated to more than one outside address, depending on where the 
traffic is destined.

Thanks in advance!

BR,
xliao
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

[vpp-dev] VPP Python version policy

2017-09-27 Thread Ole Troan
In light of the recent debate on the C/C++ API patch and consequences of adding 
Python 3 tools for Linux distros.

Here is a VPP Python Version Policy Proposal. Or VPPPVPP for short. ;-)

- All Python tools used as part of the VPP build MUST use Python 2.
  (I include the automated unit testing here).

- All VPP Python packages made available to external Python applications MUST 
support both Python 2 and 3.

Comments?

Cheers,
Ole


signature.asc
Description: Message signed with OpenPGP
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

[vpp-dev] VPP @ Hackathon IETF 100

2017-09-27 Thread Ole Troan
All,

We have taken VPP to the IETF hackathon, and apart from winning, shown how 
useful it is for the IETF to have an open source data plane to ensure it's 
principle of "running code first".

In the past we have done Source Address Dependent Routing, ILA, SFC.

For IETF 100 I'm going to be there for the IPv4 to IPv6 translation project.

Does anyone have plans for VPP projects at the IETF hackathon?
Just register yourself and project here:

Hackathon info: https://www.ietf.org/hackathon/100-hackathon.html
Wiki with list of existing projects: 
https://www.ietf.org/registration/MeetingWiki/wiki/100hackathon

November 11-12. Singapore.

Best regards,
Ole


signature.asc
Description: Message signed with OpenPGP
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] 回复: 回复: How to get interface stats using C api?

2017-09-27 Thread Klement Sekera -X (ksekera - PANTHEON TECHNOLOGIES at Cisco)
There are new C and C++ APIs added recently to vpp source code along
with test programs. You can take a look at test/ext/vapi_c_test.c and
vapi_cpp_test.cpp. Functions receiving stats are named test_stats_XXX().
These are there to verify that receiving events works. Functionally,
these are the same, they just test different ways of doing stuff.

At shared memory level it looks like this:

1.) client -> want_stats -> vpp
2.) vpp -> want_stats_reply -> client (confirms subscription)
3.) vpp ->  -> client (when timer fires)

in step 3.), client needs to read the shared memory queue in the
vpp->client direction (or use the appropriate XXX_read() function). Note
that stats take a few seconds to arrive (the test programs require
10-15 seconds of runtime to get some stats).

HTH,
Klement

Quoting 重新开始 (2017-09-27 04:55:29)
>That is ok!
> Now I am research calling the plugin apis by C. Especially how to call
>the event apis. I would appreciate it if you can write a brief client.
>-- 原始邮件 --
>发件人: "Keith Burns";;
>发送时间: 2017年9月27日(星期三) 上午10:47
>收件人: "重新开始"<15803846...@qq.com>;
>抄送: "vpp-dev";
>主题: Re: 回复: [vpp-dev] How to get interface stats using C api?
>Apologies,
>It's a callback.
>We probably need some decent literature written for how to consume the
>various C, C++, Python and Lua APIs
>If you have a preference for any of those languages I could write a brief
>client program for you and start work on documenting this stuff.
>On Sep 26, 2017 6:04 PM, "重新开始" <[1]15803846...@qq.com> wrote:
> 
>  Hi,
>Thank you for your detail information. After reading this, i can
>  understand. But after calling  "want_per_interface_simple_stats" with
>  enable_disable=1, num=1 and sw_ifs[4], i do not know how to receive this
>  stats. calling other function or variable? Can you tell me how to
>  receive stats in my c program?
> Thanks!
>  -- 原始邮件 --
>  发件人: "Keith Burns";<[2]alaga...@gmail.com>;
>  发送时间: 2017年9月27日(星期三) 上午6:39
>  收件人: "重新开
>  始"<[3]15803846...@qq.com>;"vpp-dev"<[4]vpp-dev@lists.fd.io>;
>  主题: Re: [vpp-dev] How to get interface stats using C api?
>  Hi there,
>  As of 17.10 you can now register for statistics on a per interface
>  level.
>  You need the sw_if_index of the interface you want stats for, but the
>  calls are in
>  [5]https://git.fd.io/vpp/tree/src/vpp/stats/stats.api
>  but as an example:
>  Register:
> 
>  autoreply define want_per_interface_simple_stats
>  {
>u32 client_index;
>u32 context;
>u32 enable_disable;
>u32 pid;
>u32 num;
>u32 sw_ifs[num];
> 
>  };
> 
>  So calling "want_per_interface_simple_stats" with enable_disable=1, num=1 
> and sw_ifs[4] will give you
> 
>  interface_simple_stats every 10sec for sw_if_index=4.
> 
>  The content of "interface_simple_stats" looks like:
> 
>  /** \brief Simple per interface stats counters structure
>  @param count - number of elements in message
>  @param timestamp - u32 vlib timestamp for control plane
>  @param data[count] - vl_api_vnet_simple_counter_t
> 
>  */
>  manual_print manual_endian define vnet_per_interface_simple_counters
>  {
>u32 count;
>u32 timestamp;
>vl_api_vnet_simple_counter_t data[count];
>  };
> 
>  Where each "vnet_simple_counter_t" looks like:
> 
>  [6]https://git.fd.io/vpp/tree/src/vnet/interface.api
> 
>  /** \brief Simple interface counter data type for 
> vnet_interface_simple_counters
>  @param sw_if_index - interface indexes for counters
>  @param drop - RX or TX drops due to buffer starvation
>  @param punt - used with VNET "punt" disposition
>  @param rx_ip4 - received IP4 packets
>  @param rx_ip6 - received IP6 packets
>  @param rx_no_buffer - no RX buffers available
>  @param rx_miss - receive misses
>  @param rx_error - receive errors
>  @param tx_error - transmit errors
>  @param rx_mpls - received MPLS packet
> 
>  */
>  typeonly manual_print manual_endian define vnet_simple_counter
>  {
>u32 sw_if_index;
>u64 drop;
>u64 punt;
>u64 rx_ip4;
>u64 rx_ip6;
>u64 rx_no_buffer;
>u64 rx_miss;
>u64 rx_error;
>u64 tx_error;
>u64 rx_mpls;
>  };
> 
>  So you will get back an array of counter structs for each sw_if_index you 
> registered for.
> 
>  At the moment the impl sends on sw_if_index per reply but that is going to 
> change so that for each client we send as much in one message as possible.
> 
>  On Tue, Sep 26, 2017 at 4:50 AM 重新开始 <[7]15803846...@qq.com> wrote:
> 
>  Hi,  everyone!
>  How to get interface stats using C api?
>  For example, I want to know "GigabitEthernete/0/1" rx packets , what should 
> I do?
> 
>  Thanks
> 
>___
>vpp-dev mailing list
>