Skip to contentSkip to conversation

fixes to resolve meson build issues on Power systems

PATCH Applied David Christensen 4 participants 13 messages Aug 14, 2019 – Oct 27, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover fixes to resolve meson build issues on Power systems

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(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/2 config: fix RHEL7.6 build errors on Power 9 systems

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.

---
 config/ppc_64/meson.build | 10 ++++++++++
 1 file changed, 10 insertions(+)
config/ppc_64/meson.build +10 -0
index 0e65f9d..495ef6f 100644
@@ -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)
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems

Quoted 7 lines

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.

---

Ping

#3 lore raw

Re: [dpdk-dev] [PATCH 1/2] config: fix RHEL7.6 build errors on Power 9 systems

In reply to David Christensen
Quoted 17 lines · 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.

---
 config/ppc_64/meson.build | 10 ++++++++++
 1 file changed, 10 insertions(+)
config/ppc_64/meson.build +0 -0
index 0e65f9d..495ef6f 100644
@@ -7,6 +7,16 @@ endif
 dpdk_conf.set('RTE_ARCH', 'ppc_64')

config/ppc_64/meson.build endif · line 17

Quoted 10 lines
config/ppc_64/meson.build +8 -0
 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.

Quoted 8 lines
config/ppc_64/meson.build +2 -1
+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

#4 lore raw

PATCH 2/2 vhost: fix build error caused by 64bit print formatting

In reply to 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)
---
 lib/librte_vhost/vhost_user.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
lib/librte_vhost/vhost_user.c +5 -4
index 0b72648..6a6d694 100644
@@ -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
Signature · 1 line
1.8.3.1
#5 lore raw

Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting

Quoted 19 lines · 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)
---
 lib/librte_vhost/vhost_user.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
lib/librte_vhost/vhost_user.c +0 -0
index 0b72648..6a6d694 100644
@@ -1086,10 +1086,11 @@
                                goto err_mmap;
                        }

lib/librte_vhost/vhost_user.c line 1093

Quoted 10 lines
lib/librte_vhost/vhost_user.c +5 -4
                        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.

Signature · 1 line
David Marchand
#6 lore raw

Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting

Quoted 6 lines

lib/librte_vhost/vhost_user.c line 1093

Quoted 6 lines

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.

lib/librte_vhost/vhost_user.c +3 -0
+                               (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

#7 lore raw

Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting

Quoted 35 lines · David Christensen
Quoted 7 lines

lib/librte_vhost/vhost_user.c line 1093

Quoted 7 lines

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.

lib/librte_vhost/vhost_user.c +3 -0
+                               (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

(quoted diff) +0 -15
-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=]

Quoted 7 lines
     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 ?

Signature · 1 line
David Marchand
#8 lore raw

Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting

Quoted 50 lines · David Marchand
Quoted 35 lines · David Christensen
Quoted 7 lines

lib/librte_vhost/vhost_user.c line 1093

Quoted 7 lines

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.

lib/librte_vhost/vhost_user.c +3 -0
+                               (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

(quoted diff) +0 -15
-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=]

Quoted 7 lines
     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.

Quoted 5 lines

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.

#9 lore raw

Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting

Quoted 51 lines · Maxime Coquelin
Quoted 50 lines · David Marchand
Quoted 35 lines · David Christensen
Quoted 7 lines

lib/librte_vhost/vhost_user.c line 1093

Quoted 7 lines

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.

lib/librte_vhost/vhost_user.c +3 -0
+                               (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

(quoted diff) +0 -15
-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=]

Quoted 7 lines
     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.

Quoted 8 lines
Quoted 5 lines

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?

Signature · 1 line
David Marchand
#10 lore raw

Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting

Quoted 59 lines · David Marchand
Quoted 57 lines · Maxime Coquelin
Quoted 55 lines · David Marchand
Quoted 35 lines · David Christensen
Quoted 7 lines

lib/librte_vhost/vhost_user.c line 1093

Quoted 7 lines

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.

lib/librte_vhost/vhost_user.c +3 -0
+                               (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

(quoted diff) +0 -15
-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=]

Quoted 7 lines
     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 ?

Quoted 6 lines
Quoted 2 lines

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.

Quoted 4 lines
Signature · 2 lines
-- 
David Marchand
Reviewed-by on v1 2/2
#11 lore raw

Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting

In reply to David Christensen
Quoted 34 lines · 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)
---
 lib/librte_vhost/vhost_user.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
lib/librte_vhost/vhost_user.c +5 -4
index 0b72648..6a6d694 100644
@@ -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
Signature · 1 line
1.8.3.1

Thanks,
Tiwei

#12 lore raw

Re: [dpdk-dev] [PATCH 2/2] vhost: fix build error caused by 64bit print formatting

Quoted 5 lines · Tiwei Bie
Quoted 3 lines · 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.

Quoted 8 lines
Quoted 1 line
Fixes 9b62e2da1844 (vhost: register new regions with userfaultfd)
Quoted 2 lines

Applied, thanks.

--
David Marchand