[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-11 Thread Mcnamara, John
> -Original Message-
> From: Wang, Zhihong
> Sent: Wednesday, March 11, 2015 4:38 AM
> To: Kavanagh, Mark B; Mcnamara, John; Qiu, Michael; dev at dpdk.org; Panu
> Matilainen
> Subject: RE: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
> 
> 
> Add the "-mssse3" flag should be able to solve the 'implicit definition of
> function' error.
> BTW, current dpdk should compile with gcc 4.7.2, anything changed there
> that makes this flag mandatory?

H John,

DPDK does compile with gcc 4.7.2. The issue here is compiling OVS against DPDK 
HEAD. Passing -msse N to the OVS configure does fix the issue. 

John



[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-11 Thread Wang, Zhihong

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Kavanagh, Mark B  
> Sent: Tuesday, March 10, 2015 6:04 PM
> To: Mcnamara, John; Qiu, Michael; dev at dpdk.org; Panu Matilainen
> Subject: Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
> 
> 
> 
> >-Original Message-
> >From: Mcnamara, John
> >Sent: Tuesday, March 10, 2015 8:27 AM
> >To: Qiu, Michael; Kavanagh, Mark B; dev at dpdk.org; Panu Matilainen
> >Subject: RE: [dpdk-dev] rte_memcpy.h: additional cflags required with
> >OVS
> >
> >> -Original Message-
> >> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Qiu, Michael
> >> Sent: Tuesday, March 10, 2015 3:05 AM
> >> To: Kavanagh, Mark B; dev at dpdk.org
> >> Subject: Re: [dpdk-dev] rte_memcpy.h: additional cflags required with
> >> OVS
> >>
> >
> >> What's your gcc version? this should be an issue with old version
> >> gcc, and I'm working on this to solve this issue now.
> >
> >
> >Hi Michael,
> >
> >I see the issue with gcc 4.7.2 but not with 4.9.2.
> 
> I'm using gcc v4.8.3.
> 
> Just to clarify my initial post, there are two issues related to gcc intrinsic
> headers emmintrin.h, and tmmintrin.h:
>   - in former, a difference in parameter types for _mm_storeu_si128 is
> the issue. This is the primary issue observed.
>   - in tmmintrin.h, when __OPTIMIZE__ is not defined, function
> _mm_alignr_epi8 is also not defined, leading to an 'implicit definition of
> function' error.

Add the "-mssse3" flag should be able to solve the 'implicit definition of 
function' error.
BTW, current dpdk should compile with gcc 4.7.2, anything changed there that 
makes this flag mandatory?

Zhihong (John)

> I've only noticed this intermittently (even though I compile OVS with
> -O2 CFLAGS)
> 
> >
> >John


[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-10 Thread Kavanagh, Mark B


>-Original Message-
>From: Mcnamara, John
>Sent: Tuesday, March 10, 2015 8:27 AM
>To: Qiu, Michael; Kavanagh, Mark B; dev at dpdk.org; Panu Matilainen
>Subject: RE: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Qiu, Michael
>> Sent: Tuesday, March 10, 2015 3:05 AM
>> To: Kavanagh, Mark B; dev at dpdk.org
>> Subject: Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
>>
>
>> What's your gcc version? this should be an issue with old version gcc, and
>> I'm working on this to solve this issue now.
>
>
>Hi Michael,
>
>I see the issue with gcc 4.7.2 but not with 4.9.2.

I'm using gcc v4.8.3. 

Just to clarify my initial post, there are two issues related to gcc intrinsic 
headers emmintrin.h, and tmmintrin.h:
- in former, a difference in parameter types for _mm_storeu_si128 is 
the issue. This is the primary issue observed.
- in tmmintrin.h, when __OPTIMIZE__ is not defined, function 
_mm_alignr_epi8 is also not defined, leading to an 'implicit definition of 
function' error.
  I've only noticed this intermittently (even though I compile OVS with 
-O2 CFLAGS)

>
>John


[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-10 Thread Panu Matilainen
On 03/10/2015 05:04 AM, Qiu, Michael wrote:
> On 3/10/2015 12:44 AM, Kavanagh, Mark B wrote:
>> Hi,
>>
>> Compilation of Open vSwitch fails when linked against current HEAD of DPDK 
>> (f2552cd5).
>>
>> The source of this issue appears to be commit ID 9144d6b: "eal/x86: optimize 
>> memcpy for SSE and AVX", and can be resolved by passing an additional 
>> argument to OVS when building same (CFLAGS="-march=native").
>> It seems that without this flag, OVS doesn't pick up one or more SSE 
>> #defines in DPDK, and doesn't include a relevant intrinsic header 
>> (emmintrin.h), leading to an 'implicit declaration' error for instrinsic 
>> '_mm_storeu_si128'.
>
> What's your gcc version? this should be an issue with old version gcc,
> and I'm working on this to solve this issue now. If you want to solve
> this you should upgrade gcc or include them manually, and remove  header
> x86intrin.h .

At least gcc 4.8.2 (which is what RHEL-7 has) exhibits this, however gcc 
4.9 and 5 "just work". The workaround I used was adding -msse4.1 to the 
OVS CFLAGS manually.

- Panu -



[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-10 Thread Kavanagh, Mark B


>-Original Message-
>From: Mcnamara, John
>Sent: Tuesday, March 10, 2015 12:57 AM
>To: Mcnamara, John; Kavanagh, Mark B; dev at dpdk.org
>Subject: RE: rte_memcpy.h: additional cflags required with OVS
>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Mcnamara, John
>> Sent: Monday, March 9, 2015 5:51 PM
>> To: Kavanagh, Mark B; dev at dpdk.org
>> Subject: Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
>
>
>>> In the meantime the following might work for OVS:
>>>
>>> $ ./configure CFLAGS='-Wno-bad-function-cast -march=native' --with-
>>> dpdk=$DPDK_BUILD
>>> $ make
>>>
>>>
>
>
>Hi,
>
>It will also need a patch like the following to netdev-dpdk to account for 
>changes in the
>RSS flags:
>
Thanks John, both myself and Panu had already caught this :)
>$ git diff
>diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
>index 1ba8310..90dd06f 100644
>--- a/lib/netdev-dpdk.c
>+++ b/lib/netdev-dpdk.c
>@@ -97,8 +97,7 @@ static const struct rte_eth_conf port_conf = {
> .rx_adv_conf = {
> .rss_conf = {
> .rss_key = NULL,
>-.rss_hf = ETH_RSS_IPV4_TCP | ETH_RSS_IPV4 | ETH_RSS_IPV6
>-| ETH_RSS_IPV4_UDP | ETH_RSS_IPV6_TCP | ETH_RSS_IPV6_UDP,
>+.rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP,
> },
> },
> .txmode = {
>
>


[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-10 Thread Mcnamara, John
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Qiu, Michael
> Sent: Tuesday, March 10, 2015 3:05 AM
> To: Kavanagh, Mark B; dev at dpdk.org
> Subject: Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
> 

> What's your gcc version? this should be an issue with old version gcc, and
> I'm working on this to solve this issue now.


Hi Michael,

I see the issue with gcc 4.7.2 but not with 4.9.2.

John


[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-10 Thread Qiu, Michael
On 3/10/2015 12:44 AM, Kavanagh, Mark B wrote:
> Hi,
>
> Compilation of Open vSwitch fails when linked against current HEAD of DPDK 
> (f2552cd5).
>
> The source of this issue appears to be commit ID 9144d6b: "eal/x86: optimize 
> memcpy for SSE and AVX", and can be resolved by passing an additional 
> argument to OVS when building same (CFLAGS="-march=native").
> It seems that without this flag, OVS doesn't pick up one or more SSE #defines 
> in DPDK, and doesn't include a relevant intrinsic header (emmintrin.h), 
> leading to an 'implicit declaration' error for instrinsic '_mm_storeu_si128'.

What's your gcc version? this should be an issue with old version gcc,
and I'm working on this to solve this issue now. If you want to solve
this you should upgrade gcc or include them manually, and remove  header
x86intrin.h .

Thanks,
Michael
> Has anyone else observed this behavior?
>
> Thanks,
> Mark
>
>



[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-10 Thread Qiu, Michael
On 3/10/2015 8:57 AM, Mcnamara, John wrote:
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Mcnamara, John
>> Sent: Monday, March 9, 2015 5:51 PM
>> To: Kavanagh, Mark B; dev at dpdk.org
>> Subject: Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
>
>>> In the meantime the following might work for OVS:
>>>
>>> $ ./configure CFLAGS='-Wno-bad-function-cast -march=native' --with-
>>> dpdk=$DPDK_BUILD
>>> $ make
>>>
>>>
>
> Hi,
>
> It will also need a patch like the following to netdev-dpdk to account for 
> changes in the RSS flags:
>
> $ git diff
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 1ba8310..90dd06f 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -97,8 +97,7 @@ static const struct rte_eth_conf port_conf = {
>  .rx_adv_conf = {
>  .rss_conf = {
>  .rss_key = NULL,
> -.rss_hf = ETH_RSS_IPV4_TCP | ETH_RSS_IPV4 | ETH_RSS_IPV6
> -| ETH_RSS_IPV4_UDP | ETH_RSS_IPV6_TCP | ETH_RSS_IPV6_UDP,
> +.rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP,
>  },
>  },
>  .txmode = {
>
>  

Yes, otherwise will lead a compile failure.

Thanks,
Michael
>



[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-10 Thread Mcnamara, John
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Mcnamara, John
> Sent: Monday, March 9, 2015 5:51 PM
> To: Kavanagh, Mark B; dev at dpdk.org
> Subject: Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS


>> In the meantime the following might work for OVS:
>> 
>> $ ./configure CFLAGS='-Wno-bad-function-cast -march=native' --with-
>> dpdk=$DPDK_BUILD
>> $ make
>> 
>> 


Hi,

It will also need a patch like the following to netdev-dpdk to account for 
changes in the RSS flags:

$ git diff
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 1ba8310..90dd06f 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -97,8 +97,7 @@ static const struct rte_eth_conf port_conf = {
 .rx_adv_conf = {
 .rss_conf = {
 .rss_key = NULL,
-.rss_hf = ETH_RSS_IPV4_TCP | ETH_RSS_IPV4 | ETH_RSS_IPV6
-| ETH_RSS_IPV4_UDP | ETH_RSS_IPV6_TCP | ETH_RSS_IPV6_UDP,
+.rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP,
 },
 },
 .txmode = {




[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-09 Thread Mcnamara, John
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Kavanagh, Mark B
> Sent: Monday, March 9, 2015 4:44 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
> 
> Compilation of Open vSwitch fails when linked against current HEAD of DPDK
> (f2552cd5).
> 
> The source of this issue appears to be commit ID 9144d6b: "eal/x86:
> optimize memcpy for SSE and AVX", and can be resolved by passing an
> additional argument to OVS when building same (CFLAGS="-march=native").
> It seems that without this flag, OVS doesn't pick up one or more SSE
> #defines in DPDK, and doesn't include a relevant intrinsic header
> (emmintrin.h), leading to an 'implicit declaration' error for instrinsic
> '_mm_storeu_si128'.
> 
> Has anyone else observed this behavior?

Hi Mark,

I can confirm that behavior and that it was introduced by the new optimized 
memcpy. I'll look into how it might be mitigated, for Open VSwitch with DPDK.

In the meantime the following might work for OVS:

$ ./configure CFLAGS='-Wno-bad-function-cast -march=native' 
--with-dpdk=$DPDK_BUILD
$ make

But I'll look into it in more detail and update.

John
-- 




[dpdk-dev] rte_memcpy.h: additional cflags required with OVS

2015-03-09 Thread Kavanagh, Mark B
Hi,

Compilation of Open vSwitch fails when linked against current HEAD of DPDK 
(f2552cd5).

The source of this issue appears to be commit ID 9144d6b: "eal/x86: optimize 
memcpy for SSE and AVX", and can be resolved by passing an additional argument 
to OVS when building same (CFLAGS="-march=native").
It seems that without this flag, OVS doesn't pick up one or more SSE #defines 
in DPDK, and doesn't include a relevant intrinsic header (emmintrin.h), leading 
to an 'implicit declaration' error for instrinsic '_mm_storeu_si128'.

Has anyone else observed this behavior?

Thanks,
Mark