Re: [vpp-dev] User Applications on VPP

2021-07-22 Thread Florin Coras
Hi Satish, 

You can set environment variables within the context of the command that you 
are executing as opposed to exporting them for the whole system. If you try 
running nginx as per the wiki page mentioned previously, you should be able to 
confirm LD_PRELOAD is not globally set after you execute the commands. 

Also, note that LDP is not guaranteed to work with all applications. 

Regards,
Florin

> On Jul 22, 2021, at 11:46 AM, satish amara  wrote:
> 
> Hi Florin,
>   Thank you for clarifying.  You said that when the LD_PRELOAD env variable 
> is set just before I start the application then only that application 
> syscalls are intercepted. Can you explain how is that mapping is done ( To 
> determine which application socket API needs to be intercepted) ? For 
> example, I have application A   started initially which is using standard 
> socket API.  Also, I have application B which I started after setting the 
> LD_PRELOAD variable and then I have application C which wants to use standard 
> socket API which I started after application B. So I unset the env variable.  
> Can you explain which system calls are intercepted and which are not...
> I would expect Application A to still used traditional socket API (not 
> intercepted) and even after setting the LD_PRELOAD variable and Application C 
> to use traditional socket API after unsetting the variable and Application B 
> to continue to use the LDP path (Socket calls intercepted).   Is it possible?
> 
> Thanks,
> Satish K Amara
> 
> On Thu, Jul 22, 2021 at 1:29 PM Florin Coras  > wrote:
> Hi Satish, 
> 
> If the LD_PRELOAD env variable is only set when starting the application, 
> only that application’s syscalls are intercepted. Also note that we don’t 
> intercept all syscalls (check ldp.c for more details). So yes, the 
> architecture in your diagram should be possible. 
> 
> Regards,
> Florin
> 
>> On Jul 22, 2021, at 9:35 AM, satish amara > > wrote:
>> 
>> Hi Florin,
>>Thanks!  It mentions setting some config files and env variables. The 
>> LDP_PATH sets the path  libvcl_ldpreload.so
>> I am trying to understand the logistics.  Once I do that does mean all 
>> networking applications on the host try to use LDP if they can.
>> I don't have any application-specific config. Please look into my attached 
>> diagram.  Do I have the ability to tell only specific apps to use LDP.  This 
>> is for cases where I don't want to rewrite the socket API.
>> 
>> Thanks,
>> Satish K Amara
>> 
>> 
>> 
>> On Thu, Jul 22, 2021 at 10:36 AM Florin Coras > > wrote:
>> Hi Satish, 
>>  
>> You can find an example of how to use Nginx with LDP here [1]. In general 
>> you can find host stack documentation here [2].
>>  
>> Regards,
>> Florin
>>  
>> [1] https://wiki.fd.io/view/VPP/HostStack/LDP/nginx 
>> 
>> [2] https://wiki.fd.io/view/VPP/HostStack 
>> 
>>  
>> 
>>> On Jul 22, 2021, at 7:27 AM, satish amara >> > wrote:
>>> 
>>> Hi,
>>>I see we have a couple of options for user applications to use the VPP 
>>> TCP/IP stack. Either by VCL or LD_PRELOAD. I am trying to understand if we 
>>> can selectively intercept syscalls and injects them into VLS for specific 
>>> applications. Is LD_PRELOAD can application specific. If so what is the 
>>> procedure?
>>> 
>>> Thanks,
>> 
>> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19853): https://lists.fd.io/g/vpp-dev/message/19853
Mute This Topic: https://lists.fd.io/mt/84380120/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] User Applications on VPP

2021-07-22 Thread satish amara
Hi Florin,
  Thank you for clarifying.  You said that when the LD_PRELOAD env variable
is set just before I start the application then only that application
syscalls are intercepted. Can you explain how is that mapping is done ( To
determine which application socket API needs to be intercepted)
? For example, I have application A   started initially which is using
standard socket API.  Also, I have application B which I started after
setting the LD_PRELOAD variable and then I have application C which wants
to use standard socket API which I started after application B. So I unset
the env variable.  Can you explain which system calls are intercepted and
which are not...
I would expect Application A to still used traditional socket API (not
intercepted) and even after setting the LD_PRELOAD variable and Application
C to use traditional socket API after unsetting the variable and
Application B to continue to use the LDP path (Socket calls intercepted).
 Is it possible?

Thanks,
Satish K Amara

On Thu, Jul 22, 2021 at 1:29 PM Florin Coras  wrote:

> Hi Satish,
>
> If the LD_PRELOAD env variable is only set when starting the application,
> only that application’s syscalls are intercepted. Also note that we don’t
> intercept all syscalls (check ldp.c for more details). So yes, the
> architecture in your diagram should be possible.
>
> Regards,
> Florin
>
> On Jul 22, 2021, at 9:35 AM, satish amara  wrote:
>
> Hi Florin,
>Thanks!  It mentions setting some config files and env variables. The
> LDP_PATH sets the path  libvcl_ldpreload.so
> I am trying to understand the logistics.  Once I do that does mean all
> networking applications on the host try to use LDP if they can.
> I don't have any application-specific config. Please look into my attached
> diagram.  Do I have the ability to tell only specific apps to use LDP.
> This is for cases where I don't want to rewrite the socket API.
>
> Thanks,
> Satish K Amara
>
>
>
> On Thu, Jul 22, 2021 at 10:36 AM Florin Coras 
> wrote:
>
>> Hi Satish,
>>
>> You can find an example of how to use Nginx with LDP here [1]. In general
>> you can find host stack documentation here [2].
>>
>> Regards,
>> Florin
>>
>> [1] https://wiki.fd.io/view/VPP/HostStack/LDP/nginx
>> [2] https://wiki.fd.io/view/VPP/HostStack
>>
>>
>> On Jul 22, 2021, at 7:27 AM, satish amara  wrote:
>>
>> Hi,
>>I see we have a couple of options for user applications to use the VPP
>> TCP/IP stack. Either by VCL or LD_PRELOAD. I am trying to understand if we
>> can selectively intercept syscalls and injects them into VLS for
>> specific applications. Is LD_PRELOAD can application specific. If so
>> what is the procedure?
>>
>> Thanks,
>>
>>
>> 
>
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19852): https://lists.fd.io/g/vpp-dev/message/19852
Mute This Topic: https://lists.fd.io/mt/84380120/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] User Applications on VPP

2021-07-22 Thread Florin Coras
Hi Satish, 

If the LD_PRELOAD env variable is only set when starting the application, only 
that application’s syscalls are intercepted. Also note that we don’t intercept 
all syscalls (check ldp.c for more details). So yes, the architecture in your 
diagram should be possible. 

Regards,
Florin

> On Jul 22, 2021, at 9:35 AM, satish amara  wrote:
> 
> Hi Florin,
>Thanks!  It mentions setting some config files and env variables. The 
> LDP_PATH sets the path  libvcl_ldpreload.so
> I am trying to understand the logistics.  Once I do that does mean all 
> networking applications on the host try to use LDP if they can.
> I don't have any application-specific config. Please look into my attached 
> diagram.  Do I have the ability to tell only specific apps to use LDP.  This 
> is for cases where I don't want to rewrite the socket API.
> 
> Thanks,
> Satish K Amara
> 
> 
> 
> On Thu, Jul 22, 2021 at 10:36 AM Florin Coras  > wrote:
> Hi Satish, 
>  
> You can find an example of how to use Nginx with LDP here [1]. In general you 
> can find host stack documentation here [2].
>  
> Regards,
> Florin
>  
> [1] https://wiki.fd.io/view/VPP/HostStack/LDP/nginx 
> 
> [2] https://wiki.fd.io/view/VPP/HostStack 
> 
>  
> 
>> On Jul 22, 2021, at 7:27 AM, satish amara > > wrote:
>> 
>> Hi,
>>I see we have a couple of options for user applications to use the VPP 
>> TCP/IP stack. Either by VCL or LD_PRELOAD. I am trying to understand if we 
>> can selectively intercept syscalls and injects them into VLS for specific 
>> applications. Is LD_PRELOAD can application specific. If so what is the 
>> procedure?
>> 
>> Thanks,
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19851): https://lists.fd.io/g/vpp-dev/message/19851
Mute This Topic: https://lists.fd.io/mt/84380120/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] VCL app with multiple TCP sessions handling in single worker

2021-07-22 Thread Florin Coras
Hi Sastry, 

VCL is a library applications link against to consume the session layer in vpp 
via apis that are posix-like. So vcl is executed within the application’s 
context. As for data exchanges between vcl and vpp, those are done without a 
worker barrier. 

Regards,
Florin 

> On Jul 22, 2021, at 4:04 AM, Sastry Sista  wrote:
> 
> Hi Florin,
>  Is it that VCL is going to be executed in the 
> context of main thread as its being connected to VPP main.
> 
> Do you see any issue with thread barrier if I send huge data? I know it is 
> going to impact.
> 
> With Regards
> Sastry 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19849): https://lists.fd.io/g/vpp-dev/message/19849
Mute This Topic: https://lists.fd.io/mt/82992940/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] User Applications on VPP

2021-07-22 Thread Florin Coras
Hi Satish, 
 
You can find an example of how to use Nginx with LDP here [1]. In general you 
can find host stack documentation here [2].
 
Regards,
Florin
 
[1] https://wiki.fd.io/view/VPP/HostStack/LDP/nginx
[2] https://wiki.fd.io/view/VPP/HostStack
 

> On Jul 22, 2021, at 7:27 AM, satish amara  wrote:
> 
> Hi,
>I see we have a couple of options for user applications to use the VPP 
> TCP/IP stack. Either by VCL or LD_PRELOAD. I am trying to understand if we 
> can selectively intercept syscalls and injects them into VLS for specific 
> applications. Is LD_PRELOAD can application specific. If so what is the 
> procedure?
> 
> Thanks,


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19848): https://lists.fd.io/g/vpp-dev/message/19848
Mute This Topic: https://lists.fd.io/mt/84380120/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[vpp-dev] User Applications on VPP

2021-07-22 Thread satish amara
Hi,
   I see we have a couple of options for user applications to use the VPP
TCP/IP stack. Either by VCL or LD_PRELOAD. I am trying to understand if we
can selectively intercept syscalls and injects them into VLS for specific
applications. Is LD_PRELOAD can application specific. If so what is the
procedure?

Thanks,
Satish K Amara

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19847): https://lists.fd.io/g/vpp-dev/message/19847
Mute This Topic: https://lists.fd.io/mt/84380120/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] Having trouble disabling optimization

2021-07-22 Thread Dave Barach
>From the root of your workspace, “make build” will generate -g -o0 binaries…

> On Jul 22, 2021, at 8:56 AM, Ivaylo Handjiiski  wrote:
> 
> 
> Hello, 
> 
> I am trying to debug the VPP code using gdb but when I am examining or 
> printing variables most of them are .
> 
> I've built vpp with -O0 flags. I am using a vagrant vm as a building 
> environment and my build process is as follows:
> 
> make TAG=vpp_debug install-dep
> make TAG=vpp_debug pkg-deb
> 
> TAG=vpp_debug does not seem to be appropriate here, so I manually replaced 
> -O2 entries with -O0 in build-data/platforms/vpp.mk
> Then I send and install the newly created .deb files to my device running vpp 
> and start to debug locally using gdb's attach command.
> 
> Running "make pkg-deb" shows this output regarding flags:
> 
> C flags : -Wno-address-of-packed-member -march=corei7 
> -mtune=corei7-avx -O0 -g -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Wall 
> -Werror -fno-common
> Linker flags: -O0 -g -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Wall 
> -Werror -fno-common -pie
> 
> But variable values are still .
> 
> Any help would be much appreciated! Thanks in advance.
> 
> Best Regards,
> Ivaylo
> 
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19846): https://lists.fd.io/g/vpp-dev/message/19846
Mute This Topic: https://lists.fd.io/mt/84378138/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[vpp-dev] Having trouble disabling optimization

2021-07-22 Thread Ivaylo Handjiiski
Hello,

I am trying to debug the VPP code using gdb but when I am examining or printing 
variables most of them are .

I've built vpp with -O0 flags. I am using a vagrant vm as a building 
environment and my build process is as follows:

make TAG=vpp_debug install-dep
make TAG=vpp_debug pkg-deb

TAG=vpp_debug does not seem to be appropriate here, so I manually replaced -O2 
entries with -O0 in build-data/platforms/vpp.mk
Then I send and install the newly created .deb files to my device running vpp 
and start to debug locally using gdb's attach command.

Running "make pkg-deb" shows this output regarding flags:

C flags : -Wno-address-of-packed-member -march=corei7 
-mtune=corei7-avx -O0 -g -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Wall 
-Werror -fno-common
Linker flags: -O0 -g -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Wall 
-Werror -fno-common -pie

But variable values are still .

Any help would be much appreciated! Thanks in advance.

Best Regards,
Ivaylo

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19845): https://lists.fd.io/g/vpp-dev/message/19845
Mute This Topic: https://lists.fd.io/mt/84378138/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] VCL app with multiple TCP sessions handling in single worker

2021-07-22 Thread Sastry Sista
Hi Florin,
Is it that VCL is going to be executed in the context of main thread as its 
being connected to VPP main.

Do you see any issue with thread barrier if I send huge data? I know it is 
going to impact.

With Regards
Sastry

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19844): https://lists.fd.io/g/vpp-dev/message/19844
Mute This Topic: https://lists.fd.io/mt/82992940/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-dev : How does the ping works from vppctl when we have 2 entries for the same Dest Addr with different sw_if_index

2021-07-22 Thread Sastry Sista
Hi Neale and Alex,

Thank you for the inputs and Yes, its due to entries in neighbor table.

With Regards
Sastry

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19843): https://lists.fd.io/g/vpp-dev/message/19843
Mute This Topic: https://lists.fd.io/mt/83818702/21656
Mute #vpp-dev:https://lists.fd.io/g/vpp-dev/mutehashtag/vpp-dev
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-