DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
@ 2015-03-09 16:44 Kavanagh, Mark B
  2015-03-09 17:51 ` Mcnamara, John
  2015-03-10  3:04 ` Qiu, Michael
  0 siblings, 2 replies; 11+ messages in thread
From: Kavanagh, Mark B @ 2015-03-09 16:44 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-09 16:44 [dpdk-dev] rte_memcpy.h: additional cflags required with OVS Kavanagh, Mark B
@ 2015-03-09 17:51 ` Mcnamara, John
  2015-03-10  0:57   ` Mcnamara, John
  2015-03-10  3:04 ` Qiu, Michael
  1 sibling, 1 reply; 11+ messages in thread
From: Mcnamara, John @ 2015-03-09 17:51 UTC (permalink / raw)
  To: Kavanagh, Mark B, dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Kavanagh, Mark B
> Sent: Monday, March 9, 2015 4:44 PM
> To: dev@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
-- 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-09 17:51 ` Mcnamara, John
@ 2015-03-10  0:57   ` Mcnamara, John
  2015-03-10  3:00     ` Qiu, Michael
  2015-03-10  9:16     ` Kavanagh, Mark B
  0 siblings, 2 replies; 11+ messages in thread
From: Mcnamara, John @ 2015-03-10  0:57 UTC (permalink / raw)
  To: Mcnamara, John, Kavanagh, Mark B, dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John
> Sent: Monday, March 9, 2015 5:51 PM
> To: Kavanagh, Mark B; dev@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 = {

 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-10  0:57   ` Mcnamara, John
@ 2015-03-10  3:00     ` Qiu, Michael
  2015-03-10  9:16     ` Kavanagh, Mark B
  1 sibling, 0 replies; 11+ messages in thread
From: Qiu, Michael @ 2015-03-10  3:00 UTC (permalink / raw)
  To: Mcnamara, John, Kavanagh, Mark B, dev

On 3/10/2015 8:57 AM, Mcnamara, John wrote:
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John
>> Sent: Monday, March 9, 2015 5:51 PM
>> To: Kavanagh, Mark B; dev@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
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-09 16:44 [dpdk-dev] rte_memcpy.h: additional cflags required with OVS Kavanagh, Mark B
  2015-03-09 17:51 ` Mcnamara, John
@ 2015-03-10  3:04 ` Qiu, Michael
  2015-03-10  7:52   ` Panu Matilainen
  2015-03-10  8:27   ` Mcnamara, John
  1 sibling, 2 replies; 11+ messages in thread
From: Qiu, Michael @ 2015-03-10  3:04 UTC (permalink / raw)
  To: Kavanagh, Mark B, dev

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
>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-10  3:04 ` Qiu, Michael
@ 2015-03-10  7:52   ` Panu Matilainen
  2015-03-10  8:27   ` Mcnamara, John
  1 sibling, 0 replies; 11+ messages in thread
From: Panu Matilainen @ 2015-03-10  7:52 UTC (permalink / raw)
  To: dev

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 -

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-10  3:04 ` Qiu, Michael
  2015-03-10  7:52   ` Panu Matilainen
@ 2015-03-10  8:27   ` Mcnamara, John
  2015-03-10 10:03     ` Kavanagh, Mark B
  1 sibling, 1 reply; 11+ messages in thread
From: Mcnamara, John @ 2015-03-10  8:27 UTC (permalink / raw)
  To: Qiu, Michael, Kavanagh, Mark B, dev, Panu Matilainen

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiu, Michael
> Sent: Tuesday, March 10, 2015 3:05 AM
> To: Kavanagh, Mark B; dev@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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-10  0:57   ` Mcnamara, John
  2015-03-10  3:00     ` Qiu, Michael
@ 2015-03-10  9:16     ` Kavanagh, Mark B
  1 sibling, 0 replies; 11+ messages in thread
From: Kavanagh, Mark B @ 2015-03-10  9:16 UTC (permalink / raw)
  To: Mcnamara, John, dev



>-----Original Message-----
>From: Mcnamara, John
>Sent: Tuesday, March 10, 2015 12:57 AM
>To: Mcnamara, John; Kavanagh, Mark B; dev@dpdk.org
>Subject: RE: rte_memcpy.h: additional cflags required with OVS
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John
>> Sent: Monday, March 9, 2015 5:51 PM
>> To: Kavanagh, Mark B; dev@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 = {
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-10  8:27   ` Mcnamara, John
@ 2015-03-10 10:03     ` Kavanagh, Mark B
  2015-03-11  4:37       ` Wang, Zhihong
  0 siblings, 1 reply; 11+ messages in thread
From: Kavanagh, Mark B @ 2015-03-10 10:03 UTC (permalink / raw)
  To: Mcnamara, John, Qiu, Michael, dev, Panu Matilainen



>-----Original Message-----
>From: Mcnamara, John
>Sent: Tuesday, March 10, 2015 8:27 AM
>To: Qiu, Michael; Kavanagh, Mark B; dev@dpdk.org; Panu Matilainen
>Subject: RE: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiu, Michael
>> Sent: Tuesday, March 10, 2015 3:05 AM
>> To: Kavanagh, Mark B; dev@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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-10 10:03     ` Kavanagh, Mark B
@ 2015-03-11  4:37       ` Wang, Zhihong
  2015-03-11  8:06         ` Mcnamara, John
  0 siblings, 1 reply; 11+ messages in thread
From: Wang, Zhihong @ 2015-03-11  4:37 UTC (permalink / raw)
  To: Kavanagh, Mark B, Mcnamara, John, Qiu, Michael, dev, Panu Matilainen


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Kavanagh, Mark B	
> Sent: Tuesday, March 10, 2015 6:04 PM
> To: Mcnamara, John; Qiu, Michael; dev@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@dpdk.org; Panu Matilainen
> >Subject: RE: [dpdk-dev] rte_memcpy.h: additional cflags required with
> >OVS
> >
> >> -----Original Message-----
> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiu, Michael
> >> Sent: Tuesday, March 10, 2015 3:05 AM
> >> To: Kavanagh, Mark B; dev@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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] rte_memcpy.h: additional cflags required with OVS
  2015-03-11  4:37       ` Wang, Zhihong
@ 2015-03-11  8:06         ` Mcnamara, John
  0 siblings, 0 replies; 11+ messages in thread
From: Mcnamara, John @ 2015-03-11  8:06 UTC (permalink / raw)
  To: Wang, Zhihong, Kavanagh, Mark B, Qiu, Michael, dev, Panu Matilainen

> -----Original Message-----
> From: Wang, Zhihong
> Sent: Wednesday, March 11, 2015 4:38 AM
> To: Kavanagh, Mark B; Mcnamara, John; Qiu, Michael; dev@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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-03-11  8:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 16:44 [dpdk-dev] rte_memcpy.h: additional cflags required with OVS Kavanagh, Mark B
2015-03-09 17:51 ` Mcnamara, John
2015-03-10  0:57   ` Mcnamara, John
2015-03-10  3:00     ` Qiu, Michael
2015-03-10  9:16     ` Kavanagh, Mark B
2015-03-10  3:04 ` Qiu, Michael
2015-03-10  7:52   ` Panu Matilainen
2015-03-10  8:27   ` Mcnamara, John
2015-03-10 10:03     ` Kavanagh, Mark B
2015-03-11  4:37       ` Wang, Zhihong
2015-03-11  8:06         ` Mcnamara, John

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).