Re: [vpp-dev] How to use valgrind to check for memory errors in vpp?

2019-09-09 Thread Benoit Ganne (bganne) via Lists.Fd.Io
> Ben, the Address Sanitizer integration sounds very interesting, if you
> could share your WIP patches that would be great!

Here it is:
https://gerrit.fd.io/r/c/vpp/+/21937

Quick how-to from VPP source directory:
~# git review -d 21937
~# make -C build-root PLATFORM=vpp TAG=vpp_sanitize vpp-install CC=gcc-9
~# ASAN_OPTIONS=verify_asan_link_order=0:detect_leaks=0:abort_on_error=1 gdb 
--args $PWD/build-root/install-vpp_sanitize-native/vpp/bin/vpp "unix { 
interactive } plugins { plugin dpdk_plugin.so { disable } }"

It only supports gcc-8+ for now, and currently only the heap (including vectors 
& pool) is annotated, but it already catches bugs sometime (that I slowly 
push). We miss bihash and buffer pool support at least, and shared memory heap 
annotations is a bit flaky right now. Also, it should not be too hard to clang 
support in addition to gcc.
I am still trying to find an elegant way to have it merge someday, as it is 
quite invasive right now :/

Let me know how it goes.

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

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


[vpp-dev] API change on master - rebase needed

2019-09-09 Thread Jan Gelety via Lists.Fd.Io
Hello,

VPP API change [0] has been merged.

All open VPP changes have to be rebased now to pass CRC and CSIT verification.

Thanks,
Jan

[0] https://gerrit.fd.io/r/c/vpp/+/21427

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

View/Reply Online (#13931): https://lists.fd.io/g/vpp-dev/message/13931
Mute This Topic: https://lists.fd.io/mt/34080551/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] How to use valgrind to check for memory errors in vpp?

2019-09-09 Thread Elias Rudberg
Thanks Dave and Ben for your kind replies.

Ben, the Address Sanitizer integration sounds very interesting, if you
could share your WIP patches that would be great!

Best regards,
Elias


On Mon, 2019-09-09 at 12:57 +, Benoit Ganne (bganne) via
Lists.Fd.Io wrote:
> Hi Elias,
> 
> As mentioned by Dave, running Valgrind on VPP is challenging because
> of speed and custom allocators.
> That being said, I am (slowly) working on integrating Address
> Sanitizer into VPP. I have some cleanup to do but I can share my WIP
> patches if interested.
> 
> Best
> ben
> 
> > -Original Message-
> > From: vpp-dev@lists.fd.io  On Behalf Of Dave
> > Barach
> > via Lists.Fd.Io
> > Sent: lundi 9 septembre 2019 14:20
> > To: Elias Rudberg ; vpp-dev@lists.fd.io
> > Cc: vpp-dev@lists.fd.io
> > Subject: Re: [vpp-dev] How to use valgrind to check for memory
> > errors in
> > vpp?
> > 
> > Dlmalloc [aka "Doug Lea Malloc"] is a lightly modified copy of the
> > allocator described here: 
> > http://gee.cs.oswego.edu/dl/html/malloc.html. If
> > you've managed to find an issue in it, please share the details.
> > Until
> > proven otherwise, I suspect the report rather than dlmalloc itself.
> > 
> > Vpp does indeed manage its own thread stacks. The so-called vpp
> > process
> > model [in truth: cooperative multi-tasking threads] uses
> > setjmp/longjmp to
> > switch stacks. The scheme is fundamental, and won't be changed to
> > accomodate valgrind.
> > 
> > Dlmalloc does not support valgrind. It's a waste of a huge number
> > of
> > cycles to run valgrind unless the memory allocator supports it. My
> > experience making vpp's previous memory allocator support valgrind
> > might
> > be worth sharing: it never worked very well. After > 15 years
> > working on
> > the code base, I've not felt the need to go back and make it work
> > in
> > detail.
> > 
> > Vpp uses multiple, independent heaps - some in shared memory - so
> > switching to vanilla malloc() seems like a non-starter.
> > 
> > Vpp's virtual space is larger than one might like - note the
> > difference
> > with none of the plugins loaded - but in terms of real memory
> > consumption
> > we often see RSS sizes in the 20-30mb range. A decent fraction of
> > the
> > virtual space is used to avoid expensive computations in device
> > drivers:
> > to facilitate virtual <--> physical address translation.
> > 
> > Any issues accidentally introduced into the memory allocator would
> > be a
> > severe nuisance. Folks would be well-advised not to tinker with it.
> > 
> > HTH... Dave
> > 
> > -Original Message-
> > From: vpp-dev@lists.fd.io  On Behalf Of Elias
> > Rudberg
> > Sent: Monday, September 9, 2019 4:43 AM
> > To: vpp-dev@lists.fd.io
> > Subject: [vpp-dev] How to use valgrind to check for memory errors
> > in vpp?
> > 
> > Hello,
> > 
> > I would like to use valgrind to check for memory errors in vpp.
> > 
> > I understand that running something through valgrind makes it very
> > very
> > slow so that it is not an option for real production usage of vpp.
> > However, valgrind is still very useful for finding errors even if
> > it's
> > only for very limited test runs, so I would very much like to make
> > that
> > work.
> > 
> > I know that vpp has some built-in checking for memory leaks, but
> > the
> > reason I want to use valgrind is not primarily to check for memory
> > leaks
> > but to check for other kinds of memory-access-related errors, like
> > the
> > "invalid read" and "invalid write" errors that valgrind can detect.
> > 
> > So far, what I have done is to build vpp (debug configuration)
> > according
> > to the instructions here: https://fdio-
> > vpp.readthedocs.io/en/latest/gettingstarted/developers/building.htm
> > l
> > Then I stopped the vpp service since I want to run vpp from the
> > command-
> > line through valgrind, and finally I run it like this:
> > 
> > sudo valgrind vpp -c /etc/vpp/startup.conf
> > 
> > That gave warnings about "client switching stacks?" and suggested
> > adding -
> > -max-stackframe=137286291952 so I did that:
> > 
> > sudo valgrind --max-stackframe=137286291936 vpp -c
> > /etc/vpp/startup.conf
> > 
> > Then valgrind gives a warning "Warning: set address range perms:
> > large
> > range" followed by some error reports of the type "Conditional jump
> > or
> > move depends on uninitialised value(s)" inside the mspace_malloc
> > routine
> > in dlmalloc.c.
> > 
> > I think these issues are probably related to the fact that vpp uses
> > its
> > own malloc implementation (in dlmalloc.c) instead of the default
> > malloc,
> > possibly combined with the fact that vpp uses very large (virual)
> > memory.
> > 
> > Questions:
> > 
> > - Are there ways to configure vpp to allow it to work together with
> > valgrind?
> > 
> > - Are there ways to make vpp use less memory? (currently "top"
> > shows
> > 0.205t VIRT memory usage for the vpp_main process)
> > 
> > - Is it possible to somehow configure vpp to use standard malloc
> > 

Re: [vpp-dev] How to use valgrind to check for memory errors in vpp?

2019-09-09 Thread Benoit Ganne (bganne) via Lists.Fd.Io
Hi Elias,

As mentioned by Dave, running Valgrind on VPP is challenging because of speed 
and custom allocators.
That being said, I am (slowly) working on integrating Address Sanitizer into 
VPP. I have some cleanup to do but I can share my WIP patches if interested.

Best
ben

> -Original Message-
> From: vpp-dev@lists.fd.io  On Behalf Of Dave Barach
> via Lists.Fd.Io
> Sent: lundi 9 septembre 2019 14:20
> To: Elias Rudberg ; vpp-dev@lists.fd.io
> Cc: vpp-dev@lists.fd.io
> Subject: Re: [vpp-dev] How to use valgrind to check for memory errors in
> vpp?
> 
> Dlmalloc [aka "Doug Lea Malloc"] is a lightly modified copy of the
> allocator described here: http://gee.cs.oswego.edu/dl/html/malloc.html. If
> you've managed to find an issue in it, please share the details. Until
> proven otherwise, I suspect the report rather than dlmalloc itself.
> 
> Vpp does indeed manage its own thread stacks. The so-called vpp process
> model [in truth: cooperative multi-tasking threads] uses setjmp/longjmp to
> switch stacks. The scheme is fundamental, and won't be changed to
> accomodate valgrind.
> 
> Dlmalloc does not support valgrind. It's a waste of a huge number of
> cycles to run valgrind unless the memory allocator supports it. My
> experience making vpp's previous memory allocator support valgrind might
> be worth sharing: it never worked very well. After > 15 years working on
> the code base, I've not felt the need to go back and make it work in
> detail.
> 
> Vpp uses multiple, independent heaps - some in shared memory - so
> switching to vanilla malloc() seems like a non-starter.
> 
> Vpp's virtual space is larger than one might like - note the difference
> with none of the plugins loaded - but in terms of real memory consumption
> we often see RSS sizes in the 20-30mb range. A decent fraction of the
> virtual space is used to avoid expensive computations in device drivers:
> to facilitate virtual <--> physical address translation.
> 
> Any issues accidentally introduced into the memory allocator would be a
> severe nuisance. Folks would be well-advised not to tinker with it.
> 
> HTH... Dave
> 
> -Original Message-
> From: vpp-dev@lists.fd.io  On Behalf Of Elias Rudberg
> Sent: Monday, September 9, 2019 4:43 AM
> To: vpp-dev@lists.fd.io
> Subject: [vpp-dev] How to use valgrind to check for memory errors in vpp?
> 
> Hello,
> 
> I would like to use valgrind to check for memory errors in vpp.
> 
> I understand that running something through valgrind makes it very very
> slow so that it is not an option for real production usage of vpp.
> However, valgrind is still very useful for finding errors even if it's
> only for very limited test runs, so I would very much like to make that
> work.
> 
> I know that vpp has some built-in checking for memory leaks, but the
> reason I want to use valgrind is not primarily to check for memory leaks
> but to check for other kinds of memory-access-related errors, like the
> "invalid read" and "invalid write" errors that valgrind can detect.
> 
> So far, what I have done is to build vpp (debug configuration) according
> to the instructions here: https://fdio-
> vpp.readthedocs.io/en/latest/gettingstarted/developers/building.html
> Then I stopped the vpp service since I want to run vpp from the command-
> line through valgrind, and finally I run it like this:
> 
> sudo valgrind vpp -c /etc/vpp/startup.conf
> 
> That gave warnings about "client switching stacks?" and suggested adding -
> -max-stackframe=137286291952 so I did that:
> 
> sudo valgrind --max-stackframe=137286291936 vpp -c /etc/vpp/startup.conf
> 
> Then valgrind gives a warning "Warning: set address range perms: large
> range" followed by some error reports of the type "Conditional jump or
> move depends on uninitialised value(s)" inside the mspace_malloc routine
> in dlmalloc.c.
> 
> I think these issues are probably related to the fact that vpp uses its
> own malloc implementation (in dlmalloc.c) instead of the default malloc,
> possibly combined with the fact that vpp uses very large (virual) memory.
> 
> Questions:
> 
> - Are there ways to configure vpp to allow it to work together with
> valgrind?
> 
> - Are there ways to make vpp use less memory? (currently "top" shows
> 0.205t VIRT memory usage for the vpp_main process)
> 
> - Is it possible to somehow configure vpp to use standard malloc instead
> of the dlmalloc.c implementation, perhaps sacrificing performance but
> making things work better with valgrind?
> 
> Best regards,
> Elias
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#13929): https://lists.fd.io/g/vpp-dev/message/13929
Mute This Topic: https://lists.fd.io/mt/34077527/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] How to use valgrind to check for memory errors in vpp?

2019-09-09 Thread Dave Barach via Lists.Fd.Io
Dlmalloc [aka "Doug Lea Malloc"] is a lightly modified copy of the allocator 
described here: http://gee.cs.oswego.edu/dl/html/malloc.html. If you've managed 
to find an issue in it, please share the details. Until proven otherwise, I 
suspect the report rather than dlmalloc itself.

Vpp does indeed manage its own thread stacks. The so-called vpp process model 
[in truth: cooperative multi-tasking threads] uses setjmp/longjmp to switch 
stacks. The scheme is fundamental, and won't be changed to accomodate valgrind.

Dlmalloc does not support valgrind. It's a waste of a huge number of cycles to 
run valgrind unless the memory allocator supports it. My experience making 
vpp's previous memory allocator support valgrind might be worth sharing: it 
never worked very well. After > 15 years working on the code base, I've not 
felt the need to go back and make it work in detail.

Vpp uses multiple, independent heaps - some in shared memory - so switching to 
vanilla malloc() seems like a non-starter. 

Vpp's virtual space is larger than one might like - note the difference with 
none of the plugins loaded - but in terms of real memory consumption we often 
see RSS sizes in the 20-30mb range. A decent fraction of the virtual space is 
used to avoid expensive computations in device drivers: to facilitate virtual 
<--> physical address translation. 

Any issues accidentally introduced into the memory allocator would be a severe 
nuisance. Folks would be well-advised not to tinker with it.

HTH... Dave

-Original Message-
From: vpp-dev@lists.fd.io  On Behalf Of Elias Rudberg
Sent: Monday, September 9, 2019 4:43 AM
To: vpp-dev@lists.fd.io
Subject: [vpp-dev] How to use valgrind to check for memory errors in vpp?

Hello,

I would like to use valgrind to check for memory errors in vpp.

I understand that running something through valgrind makes it very very slow so 
that it is not an option for real production usage of vpp. However, valgrind is 
still very useful for finding errors even if it's only for very limited test 
runs, so I would very much like to make that work.

I know that vpp has some built-in checking for memory leaks, but the reason I 
want to use valgrind is not primarily to check for memory leaks but to check 
for other kinds of memory-access-related errors, like the "invalid read" and 
"invalid write" errors that valgrind can detect.

So far, what I have done is to build vpp (debug configuration) according to the 
instructions here: 
https://fdio-vpp.readthedocs.io/en/latest/gettingstarted/developers/building.html
Then I stopped the vpp service since I want to run vpp from the command-line 
through valgrind, and finally I run it like this:

sudo valgrind vpp -c /etc/vpp/startup.conf

That gave warnings about "client switching stacks?" and suggested adding 
--max-stackframe=137286291952 so I did that:

sudo valgrind --max-stackframe=137286291936 vpp -c /etc/vpp/startup.conf

Then valgrind gives a warning "Warning: set address range perms: large range" 
followed by some error reports of the type "Conditional jump or move depends on 
uninitialised value(s)" inside the mspace_malloc routine in dlmalloc.c.

I think these issues are probably related to the fact that vpp uses its own 
malloc implementation (in dlmalloc.c) instead of the default malloc, possibly 
combined with the fact that vpp uses very large (virual) memory.

Questions:

- Are there ways to configure vpp to allow it to work together with valgrind?

- Are there ways to make vpp use less memory? (currently "top" shows 0.205t 
VIRT memory usage for the vpp_main process)

- Is it possible to somehow configure vpp to use standard malloc instead of the 
dlmalloc.c implementation, perhaps sacrificing performance but making things 
work better with valgrind?

Best regards,
Elias
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#13928): https://lists.fd.io/g/vpp-dev/message/13928
Mute This Topic: https://lists.fd.io/mt/34077527/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 dpdk crypto performance testing (VPP 19.01)

2019-09-09 Thread shi dave
Hi,

Using VPP+DPDK for Ipsec Security Gateway application, want to handle traffic 
(7Gbps uplink & decrypt + 28Gbps downlink & encrypt ) with below configuration, 
but there have many rx-miss errors in downlink interface, but the Vectors/Call 
for ipsec & dpdk crypto node is very low (only 3~4), and the traffic is 
balanced in all threads.

If only run 35Gbps downlink packets, there don't have rx-miss errors in 
downlink interface.

My initial test is using 16 worker cores, when I found the downlink rx-miss, I 
increased the worker cores to 32 cores, but the rx-miss are still there.

Have anyone know how to resolve the rx-miss issue?
and it seems the crypto scheduler doesn't work in this version.


configuration:

40G nic * 2
32 work cores

#./vppctl show hard detail

  NameIdx   Link  Hardware
FortyGigabitEthernet0/a/0  1 up   FortyGigabitEthernet0/a/0
  Link speed: 40 Gbps
  Ethernet address 3c:fd:fe:af:d6:f8
  Intel X710/XL710 Family
carrier up full duplex mtu 9206
flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum rx-ip4-cksum
rx: queues 32 (max 320), desc 4096 (min 64 max 4096 align 32)
tx: queues 32 (max 320), desc 4096 (min 64 max 4096 align 32)
tx burst function: i40e_xmit_pkts
rx burst function: i40e_recv_scattered_pkts_vec

tx frames ok  9958725523
tx bytes ok   11808362771488
rx frames ok  4714961077
rx bytes ok2234400127379


FortyGigabitEthernet0/b/0  2 up   FortyGigabitEthernet0/b/0
  Link speed: 40 Gbps
  Ethernet address 3c:fd:fe:af:e2:a0
  Intel X710/XL710 Family
carrier up full duplex mtu 9206
flags: admin-up pmd maybe-multiseg tx-offload intel-phdr-cksum rx-ip4-cksum
rx: queues 32 (max 320), desc 4096 (min 64 max 4096 align 32)
tx: queues 32 (max 320), desc 4096 (min 64 max 4096 align 32)
tx burst function: i40e_xmit_pkts
rx burst function: i40e_recv_scattered_pkts_vec

tx frames ok  4714839685
tx bytes ok1939591401104
rx frames ok  9959949511
rx bytes ok   11194675133398
rx missed1126523


startup.conf
cpu {
main-core 0
corelist-workers 1-32
}

dpdk {
socket-mem 16384
uio-driver igb_uio
num-mbufs 8388608
dev :00:0a.0 {
num-rx-queues 32
num-tx-queues 32
num-rx-desc 4096
num-tx-desc 4096
}
dev :00:0b.0 {
num-rx-queues 32
num-tx-queues 32
num-rx-desc 4096
num-tx-desc 4096
}
vdev cryptodev_aesni_mb_pmd0,socket_id=0
vdev cryptodev_aesni_mb_pmd1,socket_id=0
vdev cryptodev_aesni_mb_pmd2,socket_id=0
vdev cryptodev_aesni_mb_pmd3,socket_id=0
vdev cryptodev_aesni_mb_pmd4,socket_id=0
vdev cryptodev_aesni_mb_pmd5,socket_id=0
vdev cryptodev_aesni_mb_pmd6,socket_id=0
vdev cryptodev_aesni_mb_pmd7,socket_id=0
}

vpp# show dpdk crypto placement

Thread 1 (vpp_wk_0):
  cryptodev_aesni_mb_p dev-id  0 inbound-queue  0 outbound-queue  1

Thread 2 (vpp_wk_1):
  cryptodev_aesni_mb_p dev-id  0 inbound-queue  2 outbound-queue  3

Thread 3 (vpp_wk_2):
  cryptodev_aesni_mb_p dev-id  0 inbound-queue  4 outbound-queue  5

Thread 4 (vpp_wk_3):
  cryptodev_aesni_mb_p dev-id  0 inbound-queue  6 outbound-queue  7

Thread 5 (vpp_wk_4):
  cryptodev_aesni_mb_p dev-id  1 inbound-queue  0 outbound-queue  1

Thread 6 (vpp_wk_5):
  cryptodev_aesni_mb_p dev-id  1 inbound-queue  2 outbound-queue  3

..

Thread 31 (vpp_wk_30):
  cryptodev_aesni_mb_p dev-id  7 inbound-queue  4 outbound-queue  5
Thread 32 (vpp_wk_31):
  cryptodev_aesni_mb_p dev-id  7 inbound-queue  6 outbound-queue  7


vpp# show interface rx-placement
Thread 1 (vpp_wk_0):
  node dpdk-input:
FortyGigabitEthernet0/a/0 queue 0 (polling)
FortyGigabitEthernet0/b/0 queue 0 (polling)
Thread 2 (vpp_wk_1):
  node dpdk-input:
FortyGigabitEthernet0/a/0 queue 1 (polling)
FortyGigabitEthernet0/b/0 queue 1 (polling)
Thread 3 (vpp_wk_2):
  node dpdk-input:
FortyGigabitEthernet0/a/0 queue 2 (polling)
FortyGigabitEthernet0/b/0 queue 2 (polling)
Thread 4 (vpp_wk_3):
  node dpdk-input:
FortyGigabitEthernet0/a/0 queue 3 (polling)
FortyGigabitEthernet0/b/0 queue 3 (polling)

..

Thread 31 (vpp_wk_30):  
node 
dpdk-input: 

FortyGigabitEthernet0/a/0 queue 30 (polling)
  FortyGigabitEthernet0/b/0 queue 
30 (polling)
Thread 32 (vpp_wk_31):  

[vpp-dev] vpp dpdk crypto dev - are multiple crypto algorithms supported concurrently? #vpp

2019-09-09 Thread shi dave
Hi Sergio, Jitendra

Note that there is a bug in VPP device initialization where the scheduler needs 
to appear before the slaves in the config (easy to workaround it).


could you help tell me how to resolve this issue, I also found the crypto 
scheduler doesn't work, thanks!


Best Rregards

Dave


发件人: vpp-dev@lists.fd.io  代表 Sergio G.M. 

发送时间: 2019年5月6日 21:19
收件人: dmar...@me.com 
抄送: Jitendra Saini ; vpp-dev@lists.fd.io 

主题: Re: [vpp-dev] vpp dpdk crypto dev - are multiple crypto algorithms 
supported concurrently? #vpp

Hi Jitendra,

I have not followed DPDK Cryptodev development over the last year, but given my 
vague memory and latest VPP code, I reckon your configuration is not supported.
The cryptodev scheduler supports common cipher/auth algorithms among all 
slaves, which in your case is none.

Which VPP version are you using? I cannot reproduce with HEAD master branch 
(output below),

crypto_scheduler crypto_schedulerdown
  numa_node 0, max_queues 8
  Cipher:
  Auth:
  enqueue 0  dequeue 0  enqueue_err 0  dequeue_err 0
  free_resources 0 :
  used_resources 0 :

aesni_gcm0   crypto_aesni_gcmup
  numa_node 0, max_queues 2
  SYMMETRIC_CRYPTO, SYM_OPERATION_CHAINING, CPU_AVX2, CPU_AESNI, 
OOP_SGL_IN_LB_OUT, OOP_LB_IN_LB_OUT
  Cipher: aes-gcm-128, aes-gcm-192, aes-gcm-256
  Auth:
  enqueue 0  dequeue 0  enqueue_err 0  dequeue_err 0
  free_resources 1 :
 thr_id  -1 qp  1 inflight 0
  used_resources 1 :
 thr_id   0 qp  0 inflight 0

aesni_mb0crypto_aesni_mb up
  numa_node 0, max_queues 2
  SYMMETRIC_CRYPTO, SYM_OPERATION_CHAINING, CPU_AVX2, CPU_AESNI
  Cipher: aes-cbc-128, aes-cbc-192, aes-cbc-256, aes-ctr-128, aes-ctr-192, 
aes-ctr-256, aes-gcm-128, aes-gcm-192, aes-gcm-256
  Auth: md5-96, sha1-96, sha-256-96, sha-256-128, sha-384-192, sha-512-256
  enqueue 0  dequeue 0  enqueue_err 0  dequeue_err 0
  free_resources 1 :
 thr_id  -1 qp  1 inflight 0
  used_resources 1 :
 thr_id   0 qp  0 inflight 0

Note that there is a bug in VPP device initialization where the scheduler needs 
to appear before the slaves in the config (easy to workaround it).

My guess is that the issue you are seeing got fixed (not valid) at some point 
by DPDK.

HTH,
Sergio

On Fri, May 3, 2019 at 11:05 AM Damjan Marion via 
Lists.Fd.Io 
mailto:me@lists.fd.io>> wrote:

Majority of people who work on VPP actively (including me) are not very 
familiar about dpdk cryptodev which
probably explains why you are not getting any response.

Please note that there is currently undergoing big rework of ipsec / crypto 
where goals are  improvement of
native crypto, deprecating ipsec code inside dpdk plugin and implementation of 
native crypto scheduler.

―
Damjan


> On 2 May 2019, at 14:04, Jitendra Saini 
> mailto:sainijite...@gmail.com>> wrote:
>
> Hello,
>
> Sorry for repost.. I had posted this query 2 days ago but did not get any 
> update. Help from your side will be much useful.
>
> Context: Using dpdk + vpp for user plane packet processing
> Desired: want to use dpdk crypto-dev scheduler to have 2 cores dedicated for 
> crypto operations
> Issue: crypto devices of different types (AES_MB & AES_GCM) are not supported 
> concurrently.
> Query: Have anyone used crypto scheduler and able to support multiple crypto 
> device types? Any way to have such support enabled?
>
> Details:
> We want to use 4 cores in total for user plane processing with following 
> deployment
> Core-1: vpp worker thread - downlink
> Core-2 : vpp worker thread - uplink
> Core-3 : crypto-slave-1 (Cipher: aes-cbc-128)
> Core-4 : crypto-slave-2 (Cipher: aes-gcm-128)
>
> Configurations:
> vdev crypto_aesni_mb_pmd1,name=aesni_mb_1,socket_id=0
> vdev crypto_aesni_gcm_pmd1,name=aesni_gcm_1,socket_id=0
> vdev 
> crypto_scheduler,slave=aesni_mb_1,slave=aesni_gcm_1,mode=multi-core,corelist=3-4,ordering=enable,slave_buff_size=8192
>
> Query - Detail : with above log output, we see crypto-slaves aesni_mb_1 &  
> aesni_gcm_1 deployed on both worker threads but from Test Results we see 
> following -
> AES Traffic - works through crypto scehdular
> GCM Traffic - does not work. (Error - dpdk-esp-decryptFailed to 
> get crypto session)
>
> Can someone please help to understand this behavior / suggest if any approach 
> worked for you to support multiple crypto algorithms?
> Thanks in advance
>
> Log output below -
> vpp# sh dpdk crypto devices
> aesni_mb_1   crypto_aesni_mb up
>   numa_node 0, max_queues 8
>   free_resources 2, used_resources 2
>   SYMMETRIC_CRYPTO, SYM_OPERATION_CHAINING, CPU_AVX2, CPU_AESNI
>   Cipher: aes-cbc-128, aes-cbc-192, aes-cbc-256, aes-ctr-128, aes-ctr-192, 
> aes-ctr-256
>   Auth: md5-96, sha1-96, sha-256-128, sha-384-192, sha-512-256, 
> 

回复: [vpp-dev] Add ip route without next-hop-address

2019-09-09 Thread shi dave
Hi Neale,

I found a solution recently, create a virtual interface by 
VNET_HW_INTERFACE_CLASS (svti_hw_class), and add route like this:

vpp# show interface
  Name   IdxState  MTU (L3/IP4/IP6/MPLS) 
Counter  Count
GigabitEthernet0/a/0  1  up  9000/0/0/0 rx packets  
1058
rx bytes
   59654
tx packets  
   7
tx bytes
 530
drops   
 879
ip4 
 174
ip6 
   5
GigabitEthernet0/b/0  2  up  9000/0/0/0 rx packets  
1053
rx bytes
   59304
tx packets  
   7
tx bytes
 530
drops   
 876
ip4 
 174
ip6 
   2
local00 down  0/0/0/0
svti 3  up   0/0/0/0

vpp# ip route add 173.2.0.0/24 via svti




Best Rregards

Dave


发件人: Neale Ranns (nranns) 
发送时间: 2019年8月27日 15:18
收件人: shi dave ; vpp-dev@lists.fd.io 
主题: Re: [vpp-dev] Add ip route without next-hop-address




Hi Dave,



As with all IP routing, you need to configure the route with the nexthop on 
that interface’s subnet.

So :

  Ip route 173.2.0.0/24 via  GigEthx/y/z

Rather than

  Ip route 173.2.0.0/24 via  GigEthx/y/z



/neale



From: shi dave 
Date: Friday 23 August 2019 at 09:36
To: "Neale Ranns (nranns)" , "vpp-dev@lists.fd.io" 

Subject: [vpp-dev] Add ip route without next-hop-address



Hi Neale,

that's my desired flow, the actual flow is

00:04:08:057376: dpdk-input

  GigabitEthernet0/b/0 rx queue 0

  buffer 0xcc2f: current data 0, length 98, free-list 0, clone-count 0, 
totlen-nifb 0, trace 0x3

 ext-hdr-valid

 l4-cksum-computed l4-cksum-correct

  PKT MBUF: port 1, nb_segs 1, pkt_len 98

buf_len 2176, data_len 98, ol_flags 0x0, data_off 128, phys_addr 0x55330c40

packet_type 0x0 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0

rss 0x0 fdir.hi 0x0 fdir.lo 0x0

  IP4: 52:54:00:ce:64:f0 -> 52:54:00:e7:2a:c5

  ICMP: 173.10.10.10 -> 173.2.0.1

tos 0x00, ttl 64, length 84, checksum 0x5683

fragment id 0xc00e

  ICMP echo_reply checksum 0x15c2

00:04:08:057383: ethernet-input

  frame: flags 0x1, hw-if-index 2, sw-if-index 2

  IP4: 52:54:00:ce:64:f0 -> 52:54:00:e7:2a:c5

00:04:08:057386: ip4-input

  ICMP: 173.10.10.10 -> 173.2.0.1

tos 0x00, ttl 64, length 84, checksum 0x5683

fragment id 0xc00e

  ICMP echo_reply checksum 0x15c2

00:04:08:057397: ip4-lookup

  fib 0 dpo-idx 0 flow hash: 0x

  ICMP: 173.10.10.10 -> 173.2.0.1

tos 0x00, ttl 64, length 84, checksum 0x5683

fragment id 0xc00e

  ICMP echo_reply checksum 0x15c2

00:04:08:057416: ip4-glean

ICMP: 173.10.10.10 -> 173.2.0.1

  tos 0x00, ttl 64, length 84, checksum 0x5683

  fragment id 0xc00e

ICMP echo_reply checksum 0x15c2

00:04:08:057645: GigabitEthernet0/a/0-output

  GigabitEthernet0/a/0

  ARP: 52:54:00:90:bc:7e -> ff:ff:ff:ff:ff:ff

00:04:08:057651: error-drop

  ip4-glean: ARP requests sent


from the trace, it need the mac of 173.2.0.1, then the packet could be routed 
to GigabitEthernet0/a/0. I don't want this ARP request, the 173.2.0.1 is a 
inner ip, VPP may could not get that ARP response.


Best Rregards

Dave





发件人: Neale Ranns (nranns) 
发送时间: 2019年8月23日 15:18
收件人: shi dave ; vpp-dev@lists.fd.io 
主题: Re: 回复: 回复: 回复: [vpp-dev] Add ip route without next-hop-address





Hi Dave,



That flow would suggest the packet was correctly sent out of GigEth0/a/0 with 
the destination MAC of 172.16.3.1. was that not the case? Or was that your 
desired flow not the actual?



/neale



De : shi dave 
Date : vendredi 23 août 2019 à 09:11
À : "Neale Ranns (nranns)" , "vpp-dev@lists.fd.io" 

Objet : 回复: 回复: 回复: [vpp-dev] Add ip route without next-hop-address





Hi Neale,

sorry, clerical error, the flow is

dpdk-input
ip4-input (GigabitEthernet0/b/0)
ip4-lookup
ip4-rewrite (GigabitEthernet0/a/0)

Re: [vpp-dev] I want to construct some packets to be sent by a specified thread,what can I do?

2019-09-09 Thread Christian Hopps
https://fdio-vpp.readthedocs.io/en/latest/gettingstarted/developers/vlib.html#handing-off-buffers-between-threads

> On Sep 9, 2019, at 2:28 AM, wei_sky2...@163.com wrote:
> 
> our process mode need to construct some packets  which is to be sent by a 
> specified thread
> in A thread ,a node receive some packets ,when these packet deal finish,they 
> need to  be sent to another node which is belong to B thread,
> What can be done to meet this requirement?
> Thanks
>   -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#13922): https://lists.fd.io/g/vpp-dev/message/13922
> Mute This Topic: https://lists.fd.io/mt/34077019/1826170
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [cho...@chopps.org]
> -=-=-=-=-=-=-=-=-=-=-=-



signature.asc
Description: Message signed with OpenPGP
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

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


[vpp-dev] How to use valgrind to check for memory errors in vpp?

2019-09-09 Thread Elias Rudberg
Hello,

I would like to use valgrind to check for memory errors in vpp.

I understand that running something through valgrind makes it very very slow so 
that it is not an option for real production usage of vpp. However, valgrind is 
still very useful for finding errors even if it's only for very limited test 
runs, so I would very much like to make that work.

I know that vpp has some built-in checking for memory leaks, but the reason I 
want to use valgrind is not primarily to check for memory leaks but to check 
for other kinds of memory-access-related errors, like the "invalid read" and 
"invalid write" errors that valgrind can detect.

So far, what I have done is to build vpp (debug configuration) according to the 
instructions here: 
https://fdio-vpp.readthedocs.io/en/latest/gettingstarted/developers/building.html
Then I stopped the vpp service since I want to run vpp from the command-line 
through valgrind, and finally I run it like this:

sudo valgrind vpp -c /etc/vpp/startup.conf

That gave warnings about "client switching stacks?" and suggested adding 
--max-stackframe=137286291952 so I did that:

sudo valgrind --max-stackframe=137286291936 vpp -c /etc/vpp/startup.conf

Then valgrind gives a warning "Warning: set address range perms: large range" 
followed by some error reports of the type "Conditional jump or move depends on 
uninitialised value(s)" inside the mspace_malloc routine in dlmalloc.c.

I think these issues are probably related to the fact that vpp uses its own 
malloc implementation (in dlmalloc.c) instead of the default malloc, possibly 
combined with the fact that vpp uses very large (virual) memory.

Questions:

- Are there ways to configure vpp to allow it to work together with valgrind?

- Are there ways to make vpp use less memory? (currently "top" shows 0.205t 
VIRT memory usage for the vpp_main process)

- Is it possible to somehow configure vpp to use standard malloc instead of the 
dlmalloc.c implementation, perhaps sacrificing performance but making things 
work better with valgrind?

Best regards,
Elias
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

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


[vpp-dev] I want to construct some packets to be sent by a specified thread,what can I do?

2019-09-09 Thread wei_sky2008
our process mode need to construct some packets  which is to be sent by a 
specified thread
in A thread ,a node receive some packets ,when these packet deal finish,they 
need to  be sent to another node which is belong to B thread,
What can be done to meet this requirement?
Thanks
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

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