Re: [vpp-dev] how to apply a dpdk makefile patch?

2018-05-04 Thread Damjan Marion

Correct. dpdk is statically linked into dpdk_plugin.so.
-- 
Damjan

> On 4 May 2018, at 13:36, Yang, Zhiyong  wrote:
> 
> Damjan,
> Since dpdk is running as plugin in VPP, I misunderstood dpdk 
> was used in shared lib.
>  In fact,  dpdk is compiled as static lib firstly and dpdk_plugin call dpdk 
> functions, right?
>
> Thanks
> Zhiyong
>   <>
> From: Damjan Marion [mailto:dmarion.li...@gmail.com] 
> Sent: Friday, May 4, 2018 5:50 PM
> To: Yang, Zhiyong 
> Cc: vpp-dev@lists.fd.io
> Subject: Re: how to apply a dpdk makefile patch?
>
>
> if you build vpp out-of-tree (by invoking autotools configure/make from src/ 
> directly)
> you should be able to use shared libraries, but I would not be surprised that 
> minor fixing of autotools files will be needed knowing the fact
> that such scenario was not recently used.
>
> May I ask what are you trying to achieve with this particular patch and vpp?
>
> -- 
> Damjan
> 
> 
> On 2 May 2018, at 08:59, Yang, Zhiyong  > wrote:
>
> BTW,
>
> Because I want to test the following DPDK patch in VPP.
> http://www.dpdk.org/dev/patchwork/patch/39154/ 
> 
>
> thanks
> Zhiyong
>
> From: vpp-dev@lists.fd.io  
> [mailto:vpp-dev@lists.fd.io ] On Behalf Of 
> Zhiyong Yang
> Sent: Wednesday, May 2, 2018 1:36 PM
> To: dmarion.li...@gmail.com 
> Cc: vpp-dev@lists.fd.io 
> Subject: [vpp-dev] how to apply a dpdk makefile patch?
>
> Hi, folks,
> I try to apply a dpdk makefile patch to add an option to dpdk 
> shared lib, how can I enable it in VPP ?
>
> Thanks
> Zhiyong 
> 



Re: [vpp-dev] gcc version 4.3.3 use, compile error appear

2018-05-04 Thread Dave Barach
To be direct: please switch to a supported compiler. Making a large number of 
trivial changes to accommodate gcc-4 is the tip of the iceberg.

After that, you’ll notice that certain files take minutes to compile, and that 
the object code isn’t the best, either.

D.

From: vpp-dev@lists.fd.io  On Behalf Of xyxue
Sent: Thursday, May 3, 2018 10:53 PM
To: vpp-dev 
Subject: [vpp-dev] gcc version 4.3.3 use, compile error appear

Hi guys,

There is a union in fib_prefix_t but without a name, and the use of the union 
in 'add_port_range_adjacency' is shown below:
 union {
  ip46_address_t fp_addr;
  struct {
 mpls_label_t fp_label;
 mpls_eos_bit_t fp_eos;
 dpo_proto_t fp_payload_proto;
   };

 fib_prefix_t pfx =
 {
.fp_proto = FIB_PROTOCOL_IP4,
.fp_len = length,
.fp_addr =
{
.ip4 = *address,
},
};
When we use the gcc(version 4.3.3). There is some error info:
/home/vpp/build-data/../src/vnet/ip/ip4_source_and_port_range_check.c: In 
function 'add_port_range_adjacency':
/home/vpp/build-data/../src/vnet/ip/ip4_source_and_port_range_check.c:935: 
error: unknown field 'fp_addr' specified in initializer
/home/vpp/build-data/../src/vnet/ip/ip4_source_and_port_range_check.c:935: 
warning: braces around scalar initializer
/home/vpp/build-data/../src/vnet/ip/ip4_source_and_port_range_check.c:935: 
warning: (near initialization for 'pfx.fp_proto')
/home/vpp/build-data/../src/vnet/ip/ip4_source_and_port_range_check.c:936: 
error: field name not in record or union initializer
/home/vpp/build-data/../src/vnet/ip/ip4_source_and_port_range_check.c:936: 
error: (near initialization for 'pfx.fp_proto')
/home/vpp/build-data/../src/vnet/ip/ip4_source_and_port_range_check.c:936: 
error: incompatible types in initialization

We fix this problem by the method below,but it seems not a good method , 
because there are too many similar definitions in VPP.
Do you have any suggestion to solve it without updating the gcc version?

 fib_prefix_t pfx;
memset(,0,sizeof(fib_prefix_t));
pfx.fp_proto = FIB_PROTOCOL_IP4;
pfx.fp_len = length;
pfx.fp_addr.ip4 = *address;


Thanks,
Xyxue




Re: [vpp-dev] how to apply a dpdk makefile patch?

2018-05-04 Thread Zhiyong Yang
Damjan,
Since dpdk is running as plugin in VPP, I misunderstood dpdk 
was used in shared lib.
 In fact,  dpdk is compiled as static lib firstly and dpdk_plugin call dpdk 
functions, right?

Thanks
Zhiyong

From: Damjan Marion [mailto:dmarion.li...@gmail.com]
Sent: Friday, May 4, 2018 5:50 PM
To: Yang, Zhiyong 
Cc: vpp-dev@lists.fd.io
Subject: Re: how to apply a dpdk makefile patch?


if you build vpp out-of-tree (by invoking autotools configure/make from src/ 
directly)
you should be able to use shared libraries, but I would not be surprised that 
minor fixing of autotools files will be needed knowing the fact
that such scenario was not recently used.

May I ask what are you trying to achieve with this particular patch and vpp?

--
Damjan


On 2 May 2018, at 08:59, Yang, Zhiyong 
> wrote:

BTW,

Because I want to test the following DPDK patch in VPP.
http://www.dpdk.org/dev/patchwork/patch/39154/

thanks
Zhiyong

From: vpp-dev@lists.fd.io 
[mailto:vpp-dev@lists.fd.io] On Behalf Of Zhiyong Yang
Sent: Wednesday, May 2, 2018 1:36 PM
To: dmarion.li...@gmail.com
Cc: vpp-dev@lists.fd.io
Subject: [vpp-dev] how to apply a dpdk makefile patch?

Hi, folks,
I try to apply a dpdk makefile patch to add an option to dpdk 
shared lib, how can I enable it in VPP ?

Thanks
Zhiyong




Re: [vpp-dev] Nodes enabled on interface

2018-05-04 Thread Damjan Marion

You cannot have nodes attached to sw_if_index. But my guess is that you want to 
know which features are enabled on the specific interface.

That can be done with "show interface features".

-- 
Damjan

> On 4 May 2018, at 01:18, pradpate  wrote:
> 
> Team,
> While adding a node I am using following API:
>
> vnet_feature_enable_disable
>
> This api takes interface index(sw_if_index) as one of the parameter.
>
> Do we have a way to dump nodes attached to interfaces(sw_if_index)?
>
>
> Regards,
> Pradeep
> 



Re: [vpp-dev] Python API for specific VPP instance

2018-05-04 Thread Ole Troan
Justin,

> How can I "connect" to a specific instance of VPP through the python API ?
> 
> Each instance (together, they form a topology) is run as follow:
>  sudo vpp unix { log /tmp/vpp1.log cli-listen /run/vpp/cli-vpp1.sock } 
> api-segment { prefix vpp1 } plugins { plugin dpdk_plugin.so { disable } }
> 
> In python, usually, we do:
>  vpp = VPP(jsonfiles)
>  r = vpp.connect("xxx")
> 
> Is it possible to connect to a "prefix" (eg "vpp1") to only interact with a 
> specific instance ?
> Let's say, for instance, something like this:
>  r = vpp.connect("vpp1")

Yes. Set chroot_prefix.
r = vpp.connect('vpp1', chroot_prefix='name of shared address segment')

Cheers,
Ole


-=-=-=-=-=-=-=-=-=-=-=-
Links:

You receive all messages sent to this group.

View/Reply Online (#9174): https://lists.fd.io/g/vpp-dev/message/9174
View All Messages In Topic (2): https://lists.fd.io/g/vpp-dev/topic/18138970
Mute This Topic: https://lists.fd.io/mt/18138970/21656
New Topic: https://lists.fd.io/g/vpp-dev/post

Change Your Subscription: https://lists.fd.io/g/vpp-dev/editsub/21656
Group Home: https://lists.fd.io/g/vpp-dev
Contact Group Owner: vpp-dev+ow...@lists.fd.io
Terms of Service: https://lists.fd.io/static/tos
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub
-=-=-=-=-=-=-=-=-=-=-=-



signature.asc
Description: Message signed with OpenPGP


Re: [vpp-dev] Dynamically attach to a PCI device

2018-05-04 Thread Damjan Marion

Last time I was looking into dpdk hotplug, i was not under impression that it 
was very usable for our use case but that was long time ago so maybe things 
changed.

We can possibly work on that, but it will be major surgery in dpdk plugin code.

-- 
Damjan

> On 2 May 2018, at 13:46, Ray Kinsella  wrote:
> 
> Sorry Avi,
> 
> Let me clarify what I meant.
> 
> To the best of my knowledge, it is not supported with FD.io  
> VPP + DPDK Plugin at this time. You can achieve something similar with FD.io 
>  VPP and AF_PACKET but it won't be fast.
> 
> As you point out, DPDK does support hotput, so it is not a DPDK constraint 
> but I am not yet sure on the difficulty of implementing it.
> 
> Ray K
> 
> On 02/05/2018 08:30, Avi Cohen (A) wrote:
>> Ray
>> I know that with ovs-dpdk you can add/remove  a dpdk interface (physical or 
>> vhost-user) on runtime
>> Best Regards
>> Avi
>>> -Original Message-
>>> From: vpp-dev@lists.fd.io [mailto:vpp-dev@lists.fd.io] On Behalf Of Ray 
>>> Kinsella
>>> Sent: Tuesday, 01 May, 2018 5:41 PM
>>> To: Avi Cohen (A); vpp-dev@lists.fd.io
>>> Subject: Re: [vpp-dev] Dynamically attach to a PCI device
>>> 
>>> Hi Avi,
>>> 
>>> Good question - really depends on how you want to do it.
>>> 
>>> To my knowledge it is not supported with DPDK. You can achieve similar
>>> functionality using af_packet - but clearly it won't be anything like as 
>>> fast.
>>> 
>>> Ray K
>>> 
>>> On 01/05/2018 08:11, Avi Cohen (A) wrote:
 With Ovs-Dpdk this is supported
 If this is not supported in VPP I can implement it Avi
> -Original Message-
> From: Avi Cohen (A)
> Sent: Monday, 23 April, 2018 9:44 AM
> To: 'vpp-dev@lists.fd.io'
> Subject: RE: Dynamically attach to a PCI device
> 
> I'll clarify my question
> For a PCI device e.g. :04:00:0  - is it possible to add this
> device  to VPP on runtime with a specific cli command ?
> Currently I  only can add these kind of devices  by specifying it in
> the  while-list in startup.conf Best Regards Avi
> 
>> -Original Message-
>> From: Avi Cohen (A)
>> Sent: Monday, 16 April, 2018 10:48 AM
>> To: vpp-dev@lists.fd.io
>> Subject: Dynamically attach to a PCI device
>> 
>> Hello All
>> 
>> Currently I attach the physical NICs PCI devices by setting the
>> white list in the startup.conf How can I attach it dynamically in 
>> runtime ?
>> 
>> Best Regards
>> Avi
 
 
 
 
 
>>> 
>>> 
> 
> 



Re: [vpp-dev] how to apply a dpdk makefile patch?

2018-05-04 Thread Damjan Marion

if you build vpp out-of-tree (by invoking autotools configure/make from src/ 
directly)
you should be able to use shared libraries, but I would not be surprised that 
minor fixing of autotools files will be needed knowing the fact
that such scenario was not recently used.

May I ask what are you trying to achieve with this particular patch and vpp?

-- 
Damjan

> On 2 May 2018, at 08:59, Yang, Zhiyong  wrote:
> 
> BTW,
>
> Because I want to test the following DPDK patch in VPP.
> http://www.dpdk.org/dev/patchwork/patch/39154/ 
> 
>
> thanks
> Zhiyong
>   <>
> From: vpp-dev@lists.fd.io  
> [mailto:vpp-dev@lists.fd.io ] On Behalf Of 
> Zhiyong Yang
> Sent: Wednesday, May 2, 2018 1:36 PM
> To: dmarion.li...@gmail.com 
> Cc: vpp-dev@lists.fd.io 
> Subject: [vpp-dev] how to apply a dpdk makefile patch?
>
> Hi, folks,
> I try to apply a dpdk makefile patch to add an option to dpdk 
> shared lib, how can I enable it in VPP ?
>
> Thanks
> Zhiyong 
> 



Re: [vpp-dev] Set different QoS parameters for different pipes (different customers)

2018-05-04 Thread Damjan Marion

This raises general question about DPDK HQOS in VPP, I don't think we have 
anybody on this list who can help
with question like this one. Should be better to take it out than to keep 
something unmaintained, incomplete and untested?

-- 
Damjan

> On 1 May 2018, at 15:32, Reza Mirzaei  wrote:
> 
> Hi
> 
> I want to set up quality of service in vpp according to these commands 
> , but i 
> don't understand how can i distinguish between different customers from an 
> interface?? because it said here 
> 
>  that currently there is not an API to create a new HQoS pipe profile and 
> just one is created by default in the code, also it said here 
> 
>  that currently only one subport is supported, so it can be concluded that 
> only one pipe profile type could be created for an interface and we just can 
> distinguish between interfaces.
> 
> I want to be able to set different parameters (e.g. token_bucket_rate) for 
> different pipes on the same interface.
> 
> can you please help me in this matter?
> 
> Best regards
> 
> Reza
> 
> 



Re: [vpp-dev] segfault due to movaps unaligned access

2018-05-04 Thread Damjan Marion


I would suggest that instead of:

typedef struct
{
  u16 *resource_idx;
  struct rte_crypto_op **ops;
  u16 cipher_resource_idx[IPSEC_CRYPTO_N_ALG];
  u16 auth_resource_idx[IPSEC_INTEG_N_ALG];
CLIB_CACHE_LINE_ALIGN_MARK (pad);
} crypto_worker_main_t __attribute__ ((aligned (CLIB_CACHE_LINE_BYTES)));

We simply do:

typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
  u16 *resource_idx;
  struct rte_crypto_op **ops;
  u16 cipher_resource_idx[IPSEC_CRYPTO_N_ALG];
  u16 auth_resource_idx[IPSEC_INTEG_N_ALG];
} crypto_worker_main_t;

That will always automatically pad each element to the full cacheline. In 
conjunction with XXX_aligened macros it will always create data properly 
aligned.
Also, this is coding pattern we already do at many places and it helps to 
understand in GDB where the cacheline boundary is...

-- 
Damjan

> On 26 Apr 2018, at 18:08, Dave Barach  wrote:
> 
> Yes, it’s arguably a compiler bug.
>
> But, it makes no sense to vec_validate_aligned(…), pool_get_aligned(…) etc. 
> objects whose size is not a multiple of the alignment request. Only the first 
> element will be aligned to the specified boundary. 
>
> __attribute__((aligned(xxx))) is not the same thing as ensuring that objects 
> are sized correctly.
>
> D.
>
> From: vpp-dev@lists.fd.io   > On Behalf Of Radu Nicolau
> Sent: Thursday, April 26, 2018 4:54 AM
> To: Florin Coras >
> Cc: vpp-dev@lists.fd.io 
> Subject: Re: [vpp-dev] segfault due to movaps unaligned access
>
> Hi Florin,
>
> Thanks! The patch fixes the issue.
> Any idea why is it happening?
>
> Regards,
> Radu
>
>  <>From: vpp-dev@lists.fd.io  
> [mailto:vpp-dev@lists.fd.io ] On Behalf Of Florin 
> Coras
> Sent: Tuesday, April 24, 2018 11:25 PM
> To: Nicolau, Radu >
> Cc: vpp-dev@lists.fd.io 
> Subject: Re: [vpp-dev] segfault due to movaps unaligned access
>
> Hi Radu, 
>
> Making the crypto_worker_main_t a full cache line in size (see patch [1]) 
> seems to solve the issue. Could you confirm?
>
> Florin
>
> [1] https://gerrit.fd.io/r/#/c/12086/ 
>
> 
> On Apr 24, 2018, at 9:23 AM, Radu Nicolau  > wrote:
>
> Hello all,
>
> We’re seeing a weird issue, that is a segfault that looks to be caused by a 
> movaps instruction that is trying to access an address that is not 16 byte 
> aligned.
> The call originates from a vec_validate_init_empty_aligned that has the 
> argument aligned to 16 bytes.
> I have seen something like this in the past, we couldn’t find a root cause 
> and considered it a GCC bug (version 5 then), but now it pops up again on 
> version 7, so probably it isn’t.
> Any idea? A snapshot of the gdb screen below.
>
> gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
> https://postimg.cc/image/9jy4p38at/ 
>
> thanks and I will appreciate any help,
> Radu
>
>