Re: [vpp-dev] vpp query

2017-02-18 Thread Dave Barach (dbarach)
A bit more inline, see drb>>>

Thanks… Dave

-Original Message-
From: vpp-dev-boun...@lists.fd.io [mailto:vpp-dev-boun...@lists.fd.io] On 
Behalf Of Neale Ranns (nranns)
Sent: Saturday, February 18, 2017 3:52 PM
To: pxv3...@rit.edu; vpp-dev@lists.fd.io
Cc: Shailesh Vajpayee ; Arjun Dhuliya ; 
Minseok Kwon 
Subject: Re: [vpp-dev] vpp query


Hi Pragash,

Some answers inline @[NR]


From:  on behalf of Pragash Vijayaragavan 

Reply-To: "pxv3...@rit.edu" 
Date: Saturday, 18 February 2017 at 03:56
To: "vpp-dev@lists.fd.io" 
Cc: Shailesh Vajpayee , Arjun Dhuliya , 
Minseok Kwon 
Subject: [vpp-dev] vpp query

Hi,


We are working on a bloom Filter algorithm for ipv6 lookup in vpp and we have a 
few queries.
It would be great if someone could help us with the following queries.

1. from the code, ip6_forward.c file processes 2 packets at a time from the 
frame.
how are threads used in this. Is there a thread for each frame to be processed 
or a thread per packet.

[NR] there is one thread per frame. If multiple threads are used, then each 
thread will invoke ip6_lookup_inline will a different frame.
Processing two packets at once in the same thread is to improve d-cache 
performance.

drb>>> By default, the dual-loop pattern prefetches 2 packets ahead. It 
sometimes helps a bit to change the prefetch stride, e.g. to 3 or 4 ahead. Vpp 
runs with a measured instructions-per-clock > 2. Until the compiler runs out of 
registers, processing multiple packets at once helps the hardware exploit 
fine-grained parallelism. Simple story: packet i uses a set of registers to do 
. Packet i+1 uses a disjoint set of registers to do .

Selected routines benefit from quad-looping, processing 4 packets at a time. 
Take a look at dpdk_device_input(...) in .../src/vnet/devices/dpdk/node.c. 

2. A problem which we came across was synchronization for the lookup and 
filling of the filter, Dave suggested
we use 2 filters and swap between them to address this issue
Is there any limitation on the amount of memory to be used for the filter. 

[NR] the only limit is the heap size. This is (1<<30) bytes by default. You can 
change it;
 https://wiki.fd.io/view/VPP/Command-line_Arguments#.22heapsize.22_parameter

drb>>> Note that if you need a heap > 4gb, special arrangements are required. 
Ping me if you think you need to go there.

3. Also we are required to handle 2 threads for our filter, one is to fill up 
the filter using the fib entries
and the other is for lookup
- the ip6_forward.c -> ip6_lookup_inline function does the lookup part. From 
our understanding this function
is processing the packets and checking if the destination ip is in the fib. But 
we are required to fill our filter
with all fib entries dynamically as well, we understand this is also similar to 
the mtrie code, but we are not able to 
get how it works and threading is done here.

[NR]
there’s a brief into the thread models here:
  https://wiki.fd.io/view/VPP/Using_VPP_In_A_Multi-thread_Model

in multi-thread mode worker threads invoke ip6_lookup_inline, the main thread 
does the filing. In single thread mode the main thread does both.

The IPv6 FIB is composed of 2 tables (where a table in this context means a DB 
keyed by prefix); forwarding and non-forwarding.
The non-forwarding table contains ALL the prefixes that VPP is aware of – a 
lookup in this table will result in a fib_entry_t.
The forwarding table contains the sub-set of prefixes that can be used for 
forwarding – a lookup in this table will result in a load_balance_t.
I suspect you want to use bloom filters for the forwarding table. Additions and 
removals from this table are via ip6_fib_table_fwding_dpo_update and 
ip6_fib_table_fwding_dpo_remove respectively.

HTH,
neale

-- 
Thanks, 

Pragash Vijayaragavan (pxv3...@rit.edu)
ph : 585 764 4662



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

Re: [vpp-dev] Traceback Seen in invoke Python APIs with Parameters

2017-02-18 Thread Ole Troan (otroan)
Hi Hang,

You have to use named arguments. 
Change in 17.01. 

Best regards,
Ole

> On 18 Feb 2017, at 19:13, Hang Shi  wrote:
> 
> Hi, 
> 
> I am trying to use VPP python APIs and seeing the tracebacks (see below) for 
> Python APIs with parameters, while Python APIs without parameters are fine. 
> Will anyone help?  The APIs I tried is vpp.sw_interface_add_del_address.
> 
> below is the traceback and code snippets. Whole codes are attached as well. 
> 
> 
>  
> Traceback (most recent call last):
>   File "set_addr_test.py", line 53, in 
> main()
>   File "set_addr_test.py", line 45, in main
> loop = vpp.sw_interface_add_del_address(ifindex, 1, 1, 0, 16, addr)
> TypeError: () takes exactly 0 arguments (6 given)
> Cleaning up VPP on exit
>  
> 
> 
> 
>    
>   loop = vpp.create_loopback()
>   print(loop)
>   ifindex = loop.sw_if_index
>   print('{}'.format(ifindex))
> 
>   addr = str(IPv6Address(u'1::1').packed)
>   loop = vpp.sw_interface_add_del_address(ifindex, 1, 1, 0, 16, addr)
>   ...
>  
> 
> 
> The syntax from help  for this API: 
> 
> sw_interface_add_del_address(**kwargs)
> u16 _vl_msg_id, u32 client_index, u32 context, u32 sw_if_index, u8 
> is_add, u8 is_ipv6, u8 del_all, u8 address_length, u8 address
> 
> 
> 
> regards, 
> Hang
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ___
> vpp-dev mailing list
> vpp-dev@lists.fd.io
> https://lists.fd.io/mailman/listinfo/vpp-dev
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev


[vpp-dev] Traceback Seen in invoke Python APIs with Parameters

2017-02-18 Thread Hang Shi
Hi,

I am trying to use VPP python APIs and seeing the tracebacks (see below)
for Python APIs with parameters, while Python APIs without parameters are
fine. Will anyone help?  The APIs I tried is vpp.sw_interface_add_del_
address.

below is the traceback and code snippets. Whole codes are attached as well.



Traceback (most recent call last):
  File "set_addr_test.py", line 53, in 
main()
  File "set_addr_test.py", line 45, in main
loop = vpp.sw_interface_add_del_address(ifindex, 1, 1, 0, 16, addr)
TypeError: () takes exactly 0 arguments (6 given)
Cleaning up VPP on exit




  
  loop = vpp.create_loopback()
  print(loop)
  ifindex = loop.sw_if_index
  print('{}'.format(ifindex))

  addr = str(IPv6Address(u'1::1').packed)
  loop = vpp.sw_interface_add_del_address(ifindex, 1, 1, 0, 16, addr)
  ...



The syntax from help  for this API:

sw_interface_add_del_address(**kwargs)
u16 _vl_msg_id, u32 client_index, u32 context, u32 sw_if_index, u8
is_add, u8 is_ipv6, u8 del_all, u8 address_length, u8 address



regards,
Hang
#!/usr/bin/env python

from __future__ import print_function

import time
import struct
import os
import fnmatch
from ipaddress import *

import vpp_papi 
from vpp_papi import VPP

# first, construct a vpp instance from vpp json api files
# this will be a header for all python vpp scripts

# directory containing all the json api files.
# if vpp is installed on the system, these will be in /usr/share/vpp/api/

def main(*args):

# Note that there will be no vpp method available before vpp.connect()
  vpp = VPP()
  vpp.connect('test_papi')

# You're all set.
# You can check the list of available methods by calling dir(vpp)

  print('Interface Name   Index   State ')
  for intf in vpp.sw_interface_dump():
if intf.link_up_down == 1:
  updown = 'up'
else:
  updown = 'down'
print('{:20s} {:3d}   {:4s}'.format(intf.interface_name.decode(), intf.sw_if_index, updown))

  loop = vpp.create_loopback()
  print(loop)
  ifindex = loop.sw_if_index
  print('{}'.format(ifindex))
  
  addr = str(IPv6Address(u'1::1').packed)
  loop = vpp.sw_interface_add_del_address(ifindex, 1, 1, 0, 16, addr)
#  loop = vpp.sw_interface_add_del_address("loop1", "192.168.3.1/24")
# loop = vpp.sw_interface_add_del_address()
  print(loop)  
  exit(vpp.disconnect())


if __name__ == "__main__":
  main()

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

Re: [vpp-dev] How do I create a igb_uio module on Centos

2017-02-18 Thread Burt Silverman
OK, thanks Damjan and Billy. It turns out that my problem was more
fundamental. I have a bad vpp binary, as I built on an AMD processor, so
the binary complains that the CPU does not have SSE4.2 extensions.

Unfortunately when I "sudo service vpp start" there are no messages on the
screen, so I assumed things were AOK at that point. I have to either look
in /var/log/messages.log or issue "vpp" directly on the command line to see
the errors. I wonder if it is possible to have user friendly error messages
appear directly on screen when issuing "sudo service vpp start". Also I'll
have to troubleshoot to see if there is a workaround for the SSE4.2 issue,
unless somebody knows about AMD Phenom ii processors.

Burt
ps, in the past I used to just build code on a laptop and never tried
running it:-)

On Sat, Feb 18, 2017 at 8:04 AM, Billy McFall  wrote:

> I have been editing ../vpp/dpdk/Makefile, search for IGB_UIO and change
> the n to a y.
>
> Billy
>
> On Sat, Feb 18, 2017 at 6:31 AM, Damjan Marion 
> wrote:
>
>>
>> On 18 Feb 2017, at 05:48, Burt Silverman  wrote:
>>
>> Hi,
>>
>> I am trying to follow the procedures on https://wiki.fd.io/view/VPP
>> /Build,_install,_and_test_images and https://wiki.fd.io/view/VP
>> P/How_To_Connect_A_PCI_Interface_To_VPP but I end up with no igb_uio
>> module; so I cannot
>> # modprobe igb_uio
>>
>> and that seems to correspond to
>>
>>- *vpp-dpdk-dkms* - DKMS based DPDK kernel module package (only on
>>Debian/Ubuntu)
>>
>>
>> from https://wiki.fd.io/view/VPP/Build,_install,_and_test_images
>>
>> so what is the workflow when using Centos? The wiki indicates that no
>> special workflow is required for Centos other than using systemd commands
>> rather than upstart commands.
>>
>>
>> We never made this working on centos, as we use uio_pci_generic. Why do
>> you need igb_uio?
>>
>>
>> ___
>> vpp-dev mailing list
>> vpp-dev@lists.fd.io
>> https://lists.fd.io/mailman/listinfo/vpp-dev
>>
>
>
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] How do I create a igb_uio module on Centos

2017-02-18 Thread Billy McFall
I have been editing ../vpp/dpdk/Makefile, search for IGB_UIO and change the
n to a y.

Billy

On Sat, Feb 18, 2017 at 6:31 AM, Damjan Marion 
wrote:

>
> On 18 Feb 2017, at 05:48, Burt Silverman  wrote:
>
> Hi,
>
> I am trying to follow the procedures on https://wiki.fd.io/view/
> VPP/Build,_install,_and_test_images and https://wiki.fd.io/view/
> VPP/How_To_Connect_A_PCI_Interface_To_VPP but I end up with no igb_uio
> module; so I cannot
> # modprobe igb_uio
>
> and that seems to correspond to
>
>- *vpp-dpdk-dkms* - DKMS based DPDK kernel module package (only on
>Debian/Ubuntu)
>
>
> from https://wiki.fd.io/view/VPP/Build,_install,_and_test_images
>
> so what is the workflow when using Centos? The wiki indicates that no
> special workflow is required for Centos other than using systemd commands
> rather than upstart commands.
>
>
> We never made this working on centos, as we use uio_pci_generic. Why do
> you need igb_uio?
>
>
> ___
> vpp-dev mailing list
> vpp-dev@lists.fd.io
> https://lists.fd.io/mailman/listinfo/vpp-dev
>
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

[vpp-dev] vpp query

2017-02-18 Thread Pragash Vijayaragavan
Hi,


We are working on a bloom Filter algorithm for ipv6 lookup in vpp and we
have a few queries.
It would be great if someone could help us with the following queries.

1. from the code, ip6_forward.c file processes 2 packets at a time from the
frame.
how are threads used in this. Is there a thread for each frame to be
processed or a thread per packet.

2. A problem which we came across was synchronization for the lookup and
filling of the filter, Dave suggested
we use 2 filters and swap between them to address this issue
Is there any limitation on the amount of memory to be used for the filter.

3. Also we are required to handle 2 threads for our filter, one is to fill
up the filter using the fib entries
and the other is for lookup
- the ip6_forward.c -> ip6_lookup_inline function does the lookup part.
>From our understanding this function
is processing the packets and checking if the destination ip is in the fib.
But we are required to fill our filter
with all fib entries dynamically as well, we understand this is also
similar to the mtrie code, but we are not able to
get how it works and threading is done here.

-- 
Thanks,

Pragash Vijayaragavan (pxv3...@rit.edu)
ph : 585 764 4662
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] How do I create a igb_uio module on Centos

2017-02-18 Thread Damjan Marion
> 
> On 18 Feb 2017, at 05:48, Burt Silverman  wrote:
> 
> Hi,
> 
> I am trying to follow the procedures on 
> https://wiki.fd.io/view/VPP/Build,_install,_and_test_images 
>  and 
> https://wiki.fd.io/view/VPP/How_To_Connect_A_PCI_Interface_To_VPP 
>  but I end 
> up with no igb_uio module; so I cannot
> # modprobe igb_uio
> 
> and that seems to correspond to
> vpp-dpdk-dkms - DKMS based DPDK kernel module package (only on Debian/Ubuntu)
> 
> from https://wiki.fd.io/view/VPP/Build,_install,_and_test_images 
> 
> 
> so what is the workflow when using Centos? The wiki indicates that no special 
> workflow is required for Centos other than using systemd commands rather than 
> upstart commands.

We never made this working on centos, as we use uio_pci_generic. Why do you 
need igb_uio?

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