DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/2] fixes to resolve meson build issues on Power systems
@ 2019-08-14 18:36 David Christensen
  2019-08-14 18:36 ` [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems David Christensen
  2019-08-14 18:36 ` [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting David Christensen
  0 siblings, 2 replies; 13+ messages in thread
From: David Christensen @ 2019-08-14 18:36 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie; +Cc: dev, David Christensen

Encountered a few issues while testing meson builds.  The first is related
to the gcc compiler used on RHEL 7.6 and how it interprets the "native" 
CPU type when running on a Power 9 system.  The second is a print format
warning error on Power systems.

David Christensen (2):
  config: fix RHEL7.6 build errors on Power 9 systems
  vhost: fix build error caused by 64bit print formatting

 config/ppc_64/meson.build     | 10 ++++++++++
 lib/librte_vhost/vhost_user.c |  9 +++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems
  2019-08-14 18:36 [dpdk-dev] [PATCH 0/2] fixes to resolve meson build issues on Power systems David Christensen
@ 2019-08-14 18:36 ` David Christensen
  2019-10-25 18:52   ` David Christensen
  2019-10-27 10:04   ` David Marchand
  2019-08-14 18:36 ` [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting David Christensen
  1 sibling, 2 replies; 13+ messages in thread
From: David Christensen @ 2019-08-14 18:36 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie; +Cc: dev, David Christensen

gcc 4.8.5 used on RHEL 7.6 can identify a Power 9 CPU but cannot generate
Power 9 code when the "-mcpu=native" command line argument is used. Test
whether the compiler can generate Power 9 code and adjust the machine
setting appropriately.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
 config/ppc_64/meson.build | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/config/ppc_64/meson.build b/config/ppc_64/meson.build
index 0e65f9d..495ef6f 100644
--- a/config/ppc_64/meson.build
+++ b/config/ppc_64/meson.build
@@ -7,6 +7,16 @@ endif
 dpdk_conf.set('RTE_ARCH', 'ppc_64')
 dpdk_conf.set('RTE_ARCH_PPC_64', 1)
 
+# RHEL 7.x uses gcc 4.8.X which doesn't generate code for Power 9 CPUs,
+# though it will detect a Power 9 CPU when the "-mcpu=native" argument
+# is used, resulting in a build failure.
+power9_supported = cc.has_argument('-mcpu=power9')
+if not power9_supported
+	machine = 'power8'
+	machine_args = ['-mcpu=power8', '-mtune=power8']
+  dpdk_conf.set('RTE_MACHINE','power8')
+endif
+
 # overrides specific to ppc64
 dpdk_conf.set('RTE_MAX_LCORE', 1536)
 dpdk_conf.set('RTE_MAX_NUMA_NODES', 32)
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting
  2019-08-14 18:36 [dpdk-dev] [PATCH 0/2] fixes to resolve meson build issues on Power systems David Christensen
  2019-08-14 18:36 ` [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems David Christensen
@ 2019-08-14 18:36 ` David Christensen
  2019-08-15  6:53   ` David Marchand
  2019-10-25  4:41   ` Tiwei Bie
  1 sibling, 2 replies; 13+ messages in thread
From: David Christensen @ 2019-08-14 18:36 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie; +Cc: dev, David Christensen

Use of %llx print formatting causes meson build error on Power systems with
RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.

Fixes: 9b62e2da1844 (vhost: register new regions with userfaultfd)
Cc: maxime.coquelin@redhat.com

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
 lib/librte_vhost/vhost_user.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 0b72648..6a6d694 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1086,10 +1086,11 @@
 				goto err_mmap;
 			}
 			RTE_LOG(INFO, VHOST_CONFIG,
-				"\t userfaultfd registered for range : %llx - %llx\n",
-				reg_struct.range.start,
-				reg_struct.range.start +
-				reg_struct.range.len - 1);
+				"\t userfaultfd registered for range : "
+				"%" PRIx64 " - %" PRIx64 "\n",
+				(uint64_t)reg_struct.range.start,
+				(uint64_t)reg_struct.range.start +
+				(uint64_t)reg_struct.range.len - 1);
 #else
 			goto err_mmap;
 #endif
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting
  2019-08-14 18:36 ` [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting David Christensen
@ 2019-08-15  6:53   ` David Marchand
  2019-08-15 16:16     ` David Christensen
  2019-10-25  4:41   ` Tiwei Bie
  1 sibling, 1 reply; 13+ messages in thread
From: David Marchand @ 2019-08-15  6:53 UTC (permalink / raw)
  To: David Christensen; +Cc: Maxime Coquelin, Tiwei Bie, dev

On Wed, Aug 14, 2019 at 8:37 PM David Christensen
<drc@linux.vnet.ibm.com> wrote:
>
> Use of %llx print formatting causes meson build error on Power systems with
> RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.
>
> Fixes: 9b62e2da1844 (vhost: register new regions with userfaultfd)
> Cc: maxime.coquelin@redhat.com
>
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---
>  lib/librte_vhost/vhost_user.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 0b72648..6a6d694 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -1086,10 +1086,11 @@
>                                 goto err_mmap;
>                         }
>                         RTE_LOG(INFO, VHOST_CONFIG,
> -                               "\t userfaultfd registered for range : %llx - %llx\n",
> -                               reg_struct.range.start,
> -                               reg_struct.range.start +
> -                               reg_struct.range.len - 1);
> +                               "\t userfaultfd registered for range : "
> +                               "%" PRIx64 " - %" PRIx64 "\n",
> +                               (uint64_t)reg_struct.range.start,
> +                               (uint64_t)reg_struct.range.start +
> +                               (uint64_t)reg_struct.range.len - 1);

struct uffdio_register {
        struct uffdio_range range;
...

struct uffdio_range {
        __u64 start;
        __u64 len;
};

You can drop those casts.


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting
  2019-08-15  6:53   ` David Marchand
@ 2019-08-15 16:16     ` David Christensen
  2019-08-19  8:40       ` David Marchand
  0 siblings, 1 reply; 13+ messages in thread
From: David Christensen @ 2019-08-15 16:16 UTC (permalink / raw)
  To: David Marchand; +Cc: Maxime Coquelin, Tiwei Bie, dev

>> Use of %llx print formatting causes meson build error on Power systems with
>> RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.
>>
>> +                               (uint64_t)reg_struct.range.start,
>> +                               (uint64_t)reg_struct.range.start +
>> +                               (uint64_t)reg_struct.range.len - 1);

I didn't need them when compiling on Power but it's the only way I could 
get x86 to build without any warning:

cc -Ilib/lib@@rte_vhost@sta -Ilib -I../lib -Ilib/librte_vhost 
-I../lib/librte_vhost -I. -I../ -Iconfig -I../config 
-Ilib/librte_eal/common/include -I../lib/librte_eal/common/include 
-I../lib/librte_eal/linux/eal/include -Ilib/librte_eal/common 
-I../lib/librte_eal/common -Ilib/librte_eal/common/include/arch/x86 
-I../lib/librte_eal/common/include/arch/x86 -Ilib/librte_eal 
-I../lib/librte_eal -Ilib/librte_kvargs -I../lib/librte_kvargs 
-Ilib/librte_ethdev -I../lib/librte_ethdev -Ilib/librte_net 
-I../lib/librte_net -Ilib/librte_mbuf -I../lib/librte_mbuf 
-Ilib/librte_mempool -I../lib/librte_mempool -Ilib/librte_ring 
-I../lib/librte_ring -Ilib/librte_meter -I../lib/librte_meter 
-Ilib/librte_cryptodev -I../lib/librte_cryptodev -Ilib/librte_hash 
-I../lib/librte_hash -Ilib/librte_pci -I../lib/librte_pci -pipe 
-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -include rte_config.h 
-Wunused-parameter -Wsign-compare -Wcast-qual -D_GNU_SOURCE -fPIC 
-march=native -fno-strict-aliasing -DALLOW_EXPERIMENTAL_API  -MD -MQ 
'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -MF 
'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o.d' -o 
'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -c 
../lib/librte_vhost/vhost_user.c
../lib/librte_vhost/vhost_user.c: In function ‘vhost_user_set_mem_table’:
../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects 
argument of type ‘long unsigned int’, but argument 4 has type ‘__u64’ 
[-Wformat=]
     RTE_LOG(INFO, VHOST_CONFIG,
     ^
../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects 
argument of type ‘long unsigned int’, but argument 5 has type ‘__u64’ 
[-Wformat=]

This system was also RHEL 7.6 with gcc 4.8.5-36
Dave

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

* Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting
  2019-08-15 16:16     ` David Christensen
@ 2019-08-19  8:40       ` David Marchand
  2019-08-19 11:41         ` Maxime Coquelin
  0 siblings, 1 reply; 13+ messages in thread
From: David Marchand @ 2019-08-19  8:40 UTC (permalink / raw)
  To: David Christensen, Maxime Coquelin, Tiwei Bie; +Cc: dev

On Thu, Aug 15, 2019 at 6:16 PM David Christensen
<drc@linux.vnet.ibm.com> wrote:
>
> >> Use of %llx print formatting causes meson build error on Power systems with
> >> RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.
> >>
> >> +                               (uint64_t)reg_struct.range.start,
> >> +                               (uint64_t)reg_struct.range.start +
> >> +                               (uint64_t)reg_struct.range.len - 1);
>
> I didn't need them when compiling on Power but it's the only way I could
> get x86 to build without any warning:
>
> cc -Ilib/lib@@rte_vhost@sta -Ilib -I../lib -Ilib/librte_vhost
> -I../lib/librte_vhost -I. -I../ -Iconfig -I../config
> -Ilib/librte_eal/common/include -I../lib/librte_eal/common/include
> -I../lib/librte_eal/linux/eal/include -Ilib/librte_eal/common
> -I../lib/librte_eal/common -Ilib/librte_eal/common/include/arch/x86
> -I../lib/librte_eal/common/include/arch/x86 -Ilib/librte_eal
> -I../lib/librte_eal -Ilib/librte_kvargs -I../lib/librte_kvargs
> -Ilib/librte_ethdev -I../lib/librte_ethdev -Ilib/librte_net
> -I../lib/librte_net -Ilib/librte_mbuf -I../lib/librte_mbuf
> -Ilib/librte_mempool -I../lib/librte_mempool -Ilib/librte_ring
> -I../lib/librte_ring -Ilib/librte_meter -I../lib/librte_meter
> -Ilib/librte_cryptodev -I../lib/librte_cryptodev -Ilib/librte_hash
> -I../lib/librte_hash -Ilib/librte_pci -I../lib/librte_pci -pipe
> -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -include rte_config.h
> -Wunused-parameter -Wsign-compare -Wcast-qual -D_GNU_SOURCE -fPIC
> -march=native -fno-strict-aliasing -DALLOW_EXPERIMENTAL_API  -MD -MQ
> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -MF
> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o.d' -o
> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -c
> ../lib/librte_vhost/vhost_user.c
> ../lib/librte_vhost/vhost_user.c: In function ‘vhost_user_set_mem_table’:
> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
> argument of type ‘long unsigned int’, but argument 4 has type ‘__u64’
> [-Wformat=]
>      RTE_LOG(INFO, VHOST_CONFIG,
>      ^
> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
> argument of type ‘long unsigned int’, but argument 5 has type ‘__u64’
> [-Wformat=]
>
> This system was also RHEL 7.6 with gcc 4.8.5-36

Ok, I run the same.
The catch is that I did not have RTE_LIBRTE_VHOST_POSTCOPY enabled in
my working environment (using make) while meson enables it as long as
userfaultd.h is present.

Maxime, Tiwei,

Can't we use uintXX_t instead of (what looks to me) kernel types __uXX ?


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting
  2019-08-19  8:40       ` David Marchand
@ 2019-08-19 11:41         ` Maxime Coquelin
  2019-10-24 19:27           ` David Marchand
  0 siblings, 1 reply; 13+ messages in thread
From: Maxime Coquelin @ 2019-08-19 11:41 UTC (permalink / raw)
  To: David Marchand, David Christensen, Tiwei Bie; +Cc: dev



On 8/19/19 10:40 AM, David Marchand wrote:
> On Thu, Aug 15, 2019 at 6:16 PM David Christensen
> <drc@linux.vnet.ibm.com> wrote:
>>
>>>> Use of %llx print formatting causes meson build error on Power systems with
>>>> RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.
>>>>
>>>> +                               (uint64_t)reg_struct.range.start,
>>>> +                               (uint64_t)reg_struct.range.start +
>>>> +                               (uint64_t)reg_struct.range.len - 1);
>>
>> I didn't need them when compiling on Power but it's the only way I could
>> get x86 to build without any warning:
>>
>> cc -Ilib/lib@@rte_vhost@sta -Ilib -I../lib -Ilib/librte_vhost
>> -I../lib/librte_vhost -I. -I../ -Iconfig -I../config
>> -Ilib/librte_eal/common/include -I../lib/librte_eal/common/include
>> -I../lib/librte_eal/linux/eal/include -Ilib/librte_eal/common
>> -I../lib/librte_eal/common -Ilib/librte_eal/common/include/arch/x86
>> -I../lib/librte_eal/common/include/arch/x86 -Ilib/librte_eal
>> -I../lib/librte_eal -Ilib/librte_kvargs -I../lib/librte_kvargs
>> -Ilib/librte_ethdev -I../lib/librte_ethdev -Ilib/librte_net
>> -I../lib/librte_net -Ilib/librte_mbuf -I../lib/librte_mbuf
>> -Ilib/librte_mempool -I../lib/librte_mempool -Ilib/librte_ring
>> -I../lib/librte_ring -Ilib/librte_meter -I../lib/librte_meter
>> -Ilib/librte_cryptodev -I../lib/librte_cryptodev -Ilib/librte_hash
>> -I../lib/librte_hash -Ilib/librte_pci -I../lib/librte_pci -pipe
>> -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -include rte_config.h
>> -Wunused-parameter -Wsign-compare -Wcast-qual -D_GNU_SOURCE -fPIC
>> -march=native -fno-strict-aliasing -DALLOW_EXPERIMENTAL_API  -MD -MQ
>> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -MF
>> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o.d' -o
>> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -c
>> ../lib/librte_vhost/vhost_user.c
>> ../lib/librte_vhost/vhost_user.c: In function ‘vhost_user_set_mem_table’:
>> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
>> argument of type ‘long unsigned int’, but argument 4 has type ‘__u64’
>> [-Wformat=]
>>      RTE_LOG(INFO, VHOST_CONFIG,
>>      ^
>> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
>> argument of type ‘long unsigned int’, but argument 5 has type ‘__u64’
>> [-Wformat=]
>>
>> This system was also RHEL 7.6 with gcc 4.8.5-36
> 
> Ok, I run the same.
> The catch is that I did not have RTE_LIBRTE_VHOST_POSTCOPY enabled in
> my working environment (using make) while meson enables it as long as
> userfaultd.h is present.
> 
> Maxime, Tiwei,
> 
> Can't we use uintXX_t instead of (what looks to me) kernel types __uXX ?
> 
> 

That actually comes from a kernel header (linux/userfaultfd.h), so I
would say no.

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

* Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting
  2019-08-19 11:41         ` Maxime Coquelin
@ 2019-10-24 19:27           ` David Marchand
  2019-10-25  4:38             ` Tiwei Bie
  0 siblings, 1 reply; 13+ messages in thread
From: David Marchand @ 2019-10-24 19:27 UTC (permalink / raw)
  To: Maxime Coquelin, Tiwei Bie; +Cc: David Christensen, dev

On Mon, Aug 19, 2019 at 1:41 PM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
> On 8/19/19 10:40 AM, David Marchand wrote:
> > On Thu, Aug 15, 2019 at 6:16 PM David Christensen
> > <drc@linux.vnet.ibm.com> wrote:
> >>
> >>>> Use of %llx print formatting causes meson build error on Power systems with
> >>>> RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.
> >>>>
> >>>> +                               (uint64_t)reg_struct.range.start,
> >>>> +                               (uint64_t)reg_struct.range.start +
> >>>> +                               (uint64_t)reg_struct.range.len - 1);
> >>
> >> I didn't need them when compiling on Power but it's the only way I could
> >> get x86 to build without any warning:
> >>
> >> cc -Ilib/lib@@rte_vhost@sta -Ilib -I../lib -Ilib/librte_vhost
> >> -I../lib/librte_vhost -I. -I../ -Iconfig -I../config
> >> -Ilib/librte_eal/common/include -I../lib/librte_eal/common/include
> >> -I../lib/librte_eal/linux/eal/include -Ilib/librte_eal/common
> >> -I../lib/librte_eal/common -Ilib/librte_eal/common/include/arch/x86
> >> -I../lib/librte_eal/common/include/arch/x86 -Ilib/librte_eal
> >> -I../lib/librte_eal -Ilib/librte_kvargs -I../lib/librte_kvargs
> >> -Ilib/librte_ethdev -I../lib/librte_ethdev -Ilib/librte_net
> >> -I../lib/librte_net -Ilib/librte_mbuf -I../lib/librte_mbuf
> >> -Ilib/librte_mempool -I../lib/librte_mempool -Ilib/librte_ring
> >> -I../lib/librte_ring -Ilib/librte_meter -I../lib/librte_meter
> >> -Ilib/librte_cryptodev -I../lib/librte_cryptodev -Ilib/librte_hash
> >> -I../lib/librte_hash -Ilib/librte_pci -I../lib/librte_pci -pipe
> >> -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -include rte_config.h
> >> -Wunused-parameter -Wsign-compare -Wcast-qual -D_GNU_SOURCE -fPIC
> >> -march=native -fno-strict-aliasing -DALLOW_EXPERIMENTAL_API  -MD -MQ
> >> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -MF
> >> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o.d' -o
> >> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -c
> >> ../lib/librte_vhost/vhost_user.c
> >> ../lib/librte_vhost/vhost_user.c: In function ‘vhost_user_set_mem_table’:
> >> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
> >> argument of type ‘long unsigned int’, but argument 4 has type ‘__u64’
> >> [-Wformat=]
> >>      RTE_LOG(INFO, VHOST_CONFIG,
> >>      ^
> >> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
> >> argument of type ‘long unsigned int’, but argument 5 has type ‘__u64’
> >> [-Wformat=]
> >>
> >> This system was also RHEL 7.6 with gcc 4.8.5-36
> >
> > Ok, I run the same.
> > The catch is that I did not have RTE_LIBRTE_VHOST_POSTCOPY enabled in
> > my working environment (using make) while meson enables it as long as
> > userfaultd.h is present.
> >
> > Maxime, Tiwei,
> >
> > Can't we use uintXX_t instead of (what looks to me) kernel types __uXX ?
> >
> >
>
> That actually comes from a kernel header (linux/userfaultfd.h), so I
> would say no.

Sorry, I had forgotten about this patch.
Seems fine to me then.
Maxime, Tiwei?


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting
  2019-10-24 19:27           ` David Marchand
@ 2019-10-25  4:38             ` Tiwei Bie
  0 siblings, 0 replies; 13+ messages in thread
From: Tiwei Bie @ 2019-10-25  4:38 UTC (permalink / raw)
  To: David Marchand; +Cc: Maxime Coquelin, David Christensen, dev

On Thu, Oct 24, 2019 at 09:27:38PM +0200, David Marchand wrote:
> On Mon, Aug 19, 2019 at 1:41 PM Maxime Coquelin
> <maxime.coquelin@redhat.com> wrote:
> > On 8/19/19 10:40 AM, David Marchand wrote:
> > > On Thu, Aug 15, 2019 at 6:16 PM David Christensen
> > > <drc@linux.vnet.ibm.com> wrote:
> > >>
> > >>>> Use of %llx print formatting causes meson build error on Power systems with
> > >>>> RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.
> > >>>>
> > >>>> +                               (uint64_t)reg_struct.range.start,
> > >>>> +                               (uint64_t)reg_struct.range.start +
> > >>>> +                               (uint64_t)reg_struct.range.len - 1);
> > >>
> > >> I didn't need them when compiling on Power but it's the only way I could
> > >> get x86 to build without any warning:
> > >>
> > >> cc -Ilib/lib@@rte_vhost@sta -Ilib -I../lib -Ilib/librte_vhost
> > >> -I../lib/librte_vhost -I. -I../ -Iconfig -I../config
> > >> -Ilib/librte_eal/common/include -I../lib/librte_eal/common/include
> > >> -I../lib/librte_eal/linux/eal/include -Ilib/librte_eal/common
> > >> -I../lib/librte_eal/common -Ilib/librte_eal/common/include/arch/x86
> > >> -I../lib/librte_eal/common/include/arch/x86 -Ilib/librte_eal
> > >> -I../lib/librte_eal -Ilib/librte_kvargs -I../lib/librte_kvargs
> > >> -Ilib/librte_ethdev -I../lib/librte_ethdev -Ilib/librte_net
> > >> -I../lib/librte_net -Ilib/librte_mbuf -I../lib/librte_mbuf
> > >> -Ilib/librte_mempool -I../lib/librte_mempool -Ilib/librte_ring
> > >> -I../lib/librte_ring -Ilib/librte_meter -I../lib/librte_meter
> > >> -Ilib/librte_cryptodev -I../lib/librte_cryptodev -Ilib/librte_hash
> > >> -I../lib/librte_hash -Ilib/librte_pci -I../lib/librte_pci -pipe
> > >> -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -include rte_config.h
> > >> -Wunused-parameter -Wsign-compare -Wcast-qual -D_GNU_SOURCE -fPIC
> > >> -march=native -fno-strict-aliasing -DALLOW_EXPERIMENTAL_API  -MD -MQ
> > >> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -MF
> > >> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o.d' -o
> > >> 'lib/lib@@rte_vhost@sta/librte_vhost_vhost_user.c.o' -c
> > >> ../lib/librte_vhost/vhost_user.c
> > >> ../lib/librte_vhost/vhost_user.c: In function ‘vhost_user_set_mem_table’:
> > >> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
> > >> argument of type ‘long unsigned int’, but argument 4 has type ‘__u64’
> > >> [-Wformat=]
> > >>      RTE_LOG(INFO, VHOST_CONFIG,
> > >>      ^
> > >> ../lib/librte_vhost/vhost_user.c:1088:4: warning: format ‘%lx’ expects
> > >> argument of type ‘long unsigned int’, but argument 5 has type ‘__u64’
> > >> [-Wformat=]
> > >>
> > >> This system was also RHEL 7.6 with gcc 4.8.5-36
> > >
> > > Ok, I run the same.
> > > The catch is that I did not have RTE_LIBRTE_VHOST_POSTCOPY enabled in
> > > my working environment (using make) while meson enables it as long as
> > > userfaultd.h is present.
> > >
> > > Maxime, Tiwei,
> > >
> > > Can't we use uintXX_t instead of (what looks to me) kernel types __uXX ?
> > >
> > >
> >
> > That actually comes from a kernel header (linux/userfaultfd.h), so I
> > would say no.
> 
> Sorry, I had forgotten about this patch.
> Seems fine to me then.
> Maxime, Tiwei?

LGTM as well.

> 
> 
> -- 
> David Marchand

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

* Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting
  2019-08-14 18:36 ` [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting David Christensen
  2019-08-15  6:53   ` David Marchand
@ 2019-10-25  4:41   ` Tiwei Bie
  2019-10-27 10:04     ` David Marchand
  1 sibling, 1 reply; 13+ messages in thread
From: Tiwei Bie @ 2019-10-25  4:41 UTC (permalink / raw)
  To: David Christensen; +Cc: maxime.coquelin, dev

On Wed, Aug 14, 2019 at 01:36:41PM -0500, David Christensen wrote:
> Use of %llx print formatting causes meson build error on Power systems with
> RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.
> 
> Fixes: 9b62e2da1844 (vhost: register new regions with userfaultfd)
> Cc: maxime.coquelin@redhat.com
> 
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---
>  lib/librte_vhost/vhost_user.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 0b72648..6a6d694 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -1086,10 +1086,11 @@
>  				goto err_mmap;
>  			}
>  			RTE_LOG(INFO, VHOST_CONFIG,
> -				"\t userfaultfd registered for range : %llx - %llx\n",
> -				reg_struct.range.start,
> -				reg_struct.range.start +
> -				reg_struct.range.len - 1);
> +				"\t userfaultfd registered for range : "
> +				"%" PRIx64 " - %" PRIx64 "\n",
> +				(uint64_t)reg_struct.range.start,
> +				(uint64_t)reg_struct.range.start +
> +				(uint64_t)reg_struct.range.len - 1);
>  #else
>  			goto err_mmap;
>  #endif
> -- 
> 1.8.3.1
> 

Cc: stable@dpdk.org

Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

Thanks,
Tiwei

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

* Re: [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems
  2019-08-14 18:36 ` [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems David Christensen
@ 2019-10-25 18:52   ` David Christensen
  2019-10-27 10:04   ` David Marchand
  1 sibling, 0 replies; 13+ messages in thread
From: David Christensen @ 2019-10-25 18:52 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie; +Cc: dev

> gcc 4.8.5 used on RHEL 7.6 can identify a Power 9 CPU but cannot generate
> Power 9 code when the "-mcpu=native" command line argument is used. Test
> whether the compiler can generate Power 9 code and adjust the machine
> setting appropriately.
> 
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---

Ping

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

* Re: [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems
  2019-08-14 18:36 ` [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems David Christensen
  2019-10-25 18:52   ` David Christensen
@ 2019-10-27 10:04   ` David Marchand
  1 sibling, 0 replies; 13+ messages in thread
From: David Marchand @ 2019-10-27 10:04 UTC (permalink / raw)
  To: David Christensen; +Cc: Maxime Coquelin, Tiwei Bie, dev

On Wed, Aug 14, 2019 at 8:37 PM David Christensen
<drc@linux.vnet.ibm.com> wrote:
>
> gcc 4.8.5 used on RHEL 7.6 can identify a Power 9 CPU but cannot generate
> Power 9 code when the "-mcpu=native" command line argument is used. Test
> whether the compiler can generate Power 9 code and adjust the machine
> setting appropriately.
>
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---
>  config/ppc_64/meson.build | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/config/ppc_64/meson.build b/config/ppc_64/meson.build
> index 0e65f9d..495ef6f 100644
> --- a/config/ppc_64/meson.build
> +++ b/config/ppc_64/meson.build
> @@ -7,6 +7,16 @@ endif
>  dpdk_conf.set('RTE_ARCH', 'ppc_64')
>  dpdk_conf.set('RTE_ARCH_PPC_64', 1)
>
> +# RHEL 7.x uses gcc 4.8.X which doesn't generate code for Power 9 CPUs,
> +# though it will detect a Power 9 CPU when the "-mcpu=native" argument
> +# is used, resulting in a build failure.
> +power9_supported = cc.has_argument('-mcpu=power9')
> +if not power9_supported
> +       machine = 'power8'
> +       machine_args = ['-mcpu=power8', '-mtune=power8']
> +  dpdk_conf.set('RTE_MACHINE','power8')

Fixed indent.

> +endif
> +
>  # overrides specific to ppc64
>  dpdk_conf.set('RTE_MAX_LCORE', 1536)
>  dpdk_conf.set('RTE_MAX_NUMA_NODES', 32)
> --
> 1.8.3.1
>

Applied, thanks.


--
David Marchand

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

* Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting
  2019-10-25  4:41   ` Tiwei Bie
@ 2019-10-27 10:04     ` David Marchand
  0 siblings, 0 replies; 13+ messages in thread
From: David Marchand @ 2019-10-27 10:04 UTC (permalink / raw)
  To: Tiwei Bie; +Cc: David Christensen, Maxime Coquelin, dev

On Fri, Oct 25, 2019 at 6:41 AM Tiwei Bie <tiwei.bie@intel.com> wrote:
>
> On Wed, Aug 14, 2019 at 01:36:41PM -0500, David Christensen wrote:
> > Use of %llx print formatting causes meson build error on Power systems with
> > RHEL 7.6 and gcc 4.8.5.  Replace with PRIx64 macro.
> >
> > Fixes: 9b62e2da1844 (vhost: register new regions with userfaultfd)

> Cc: stable@dpdk.org

> >
> > Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
>
> Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

Applied, thanks.



--
David Marchand

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

end of thread, other threads:[~2019-10-27 10:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14 18:36 [dpdk-dev] [PATCH 0/2] fixes to resolve meson build issues on Power systems David Christensen
2019-08-14 18:36 ` [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems David Christensen
2019-10-25 18:52   ` David Christensen
2019-10-27 10:04   ` David Marchand
2019-08-14 18:36 ` [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting David Christensen
2019-08-15  6:53   ` David Marchand
2019-08-15 16:16     ` David Christensen
2019-08-19  8:40       ` David Marchand
2019-08-19 11:41         ` Maxime Coquelin
2019-10-24 19:27           ` David Marchand
2019-10-25  4:38             ` Tiwei Bie
2019-10-25  4:41   ` Tiwei Bie
2019-10-27 10:04     ` David Marchand

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