* [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier
@ 2018-04-13 5:04 Gowrishankar
2018-04-13 7:10 ` Shreyansh Jain
` (5 more replies)
0 siblings, 6 replies; 15+ messages in thread
From: Gowrishankar @ 2018-04-13 5:04 UTC (permalink / raw)
To: Hemant Agrawal, Shreyansh Jain
Cc: Anatoly Burakov, dev, Thomas Monjalon, Gowrishankar Muthukrishnan
From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
breaks compile in ppc64le.
Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
--
In file included from dpdk/drivers/bus/fslmc/fslmc_vfio.c:37:0:
dpdk/drivers/bus/fslmc/fslmc_vfio.c: In function ‘fslmc_map_dma’:
dpdk/drivers/bus/fslmc/fslmc_logs.h:18:44: error: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \
^
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:2: note: in expansion of macro ‘DPAA2_BUS_DEBUG’
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
^~~~~~~~~~~~~~~
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:39: note: format string is defined here
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
~~~^
%lX
drivers/bus/fslmc/fslmc_vfio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 4036e82..a003a7d 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -270,7 +270,7 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
+ DPAA2_BUS_DEBUG("--> Map address: %"PRIu64", size: 0x%"PRIu64"",
dma_map.vaddr, dma_map.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map);
if (ret) {
@@ -303,7 +303,7 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX",
+ DPAA2_BUS_DEBUG("--> Unmap address: %"PRIu64", size: 0x%"PRIu64"",
dma_unmap.iova, dma_unmap.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_UNMAP_DMA, &dma_unmap);
if (ret) {
@@ -401,7 +401,7 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj)
goto MC_FAILURE;
}
- DPAA2_BUS_DEBUG("Region offset = %llx , region size = %llx",
+ DPAA2_BUS_DEBUG("Region offset = %"PRIu64" , region size = %"PRIu64"",
reg_info.offset, reg_info.size);
v_addr = (size_t)mmap(NULL, reg_info.size,
--
1.9.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 7:10 ` Shreyansh Jain
@ 2018-04-13 7:09 ` Hemant Agrawal
0 siblings, 0 replies; 15+ messages in thread
From: Hemant Agrawal @ 2018-04-13 7:09 UTC (permalink / raw)
To: Shreyansh Jain, Gowrishankar
Cc: Hemant Agrawal, Anatoly Burakov, dev, Thomas Monjalon
On 4/13/2018 12:40 PM, Shreyansh Jain wrote:
> On Friday 13 April 2018 10:34 AM, Gowrishankar wrote:
>> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>>
>> Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
>> breaks compile in ppc64le.
>>
>> Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
>>
>> Signed-off-by: Gowrishankar Muthukrishnan
>> <gowrishankar.m@linux.vnet.ibm.com>
>> --
>
> Thanks for fixing.
>
> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
NACK
This is breaking the x86_64-native-linuxapp-gcc compilation. I am
looking into it.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 5:04 [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier Gowrishankar
@ 2018-04-13 7:10 ` Shreyansh Jain
2018-04-13 7:09 ` Hemant Agrawal
2018-04-13 7:37 ` Hemant Agrawal
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Shreyansh Jain @ 2018-04-13 7:10 UTC (permalink / raw)
To: Gowrishankar; +Cc: Hemant Agrawal, Anatoly Burakov, dev, Thomas Monjalon
On Friday 13 April 2018 10:34 AM, Gowrishankar wrote:
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>
> Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
> breaks compile in ppc64le.
>
> Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
>
> Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> --
Thanks for fixing.
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 5:04 [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier Gowrishankar
2018-04-13 7:10 ` Shreyansh Jain
@ 2018-04-13 7:37 ` Hemant Agrawal
2018-04-13 7:41 ` Thomas Monjalon
` (3 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Hemant Agrawal @ 2018-04-13 7:37 UTC (permalink / raw)
To: Gowrishankar, Hemant Agrawal, Shreyansh Jain
Cc: Anatoly Burakov, dev, Thomas Monjalon
Hi Gowrishankar,
On 4/13/2018 10:34 AM, Gowrishankar wrote:
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>
> Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
> breaks compile in ppc64le.
>
> Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
>
> Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> --
> In file included from dpdk/drivers/bus/fslmc/fslmc_vfio.c:37:0:
> dpdk/drivers/bus/fslmc/fslmc_vfio.c: In function ‘fslmc_map_dma’:
> dpdk/drivers/bus/fslmc/fslmc_logs.h:18:44: error: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
So, powerpc64LE is taking __u64 as long unsigned int, while x86_64
compiler is taking it as long long unsigned it.
> rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \
> ^
> dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:2: note: in expansion of macro ‘DPAA2_BUS_DEBUG’
> DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
> ^~~~~~~~~~~~~~~
> dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:39: note: format string is defined here
> DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
> ~~~^
> %lX
>
> drivers/bus/fslmc/fslmc_vfio.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
> index 4036e82..a003a7d 100644
> --- a/drivers/bus/fslmc/fslmc_vfio.c
> +++ b/drivers/bus/fslmc/fslmc_vfio.c
> @@ -270,7 +270,7 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
> return -1;
> }
>
> - DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
> + DPAA2_BUS_DEBUG("--> Map address: %"PRIu64", size: 0x%"PRIu64"",
> dma_map.vaddr, dma_map.size);
You should also type cast the variables to avoid compilation issue on x86.
- dma_map.vaddr, dma_map.size);
+ (uint64_t)dma_map.vaddr, uint64_t)dma_map.size);
The same change is to be done at other two places as well in your patch.
Please check compilation for x86_64 and i686, the patchwork compilation
check is running late.
> ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map);
> if (ret) {
> @@ -303,7 +303,7 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
> return -1;
> }
>
> - DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX",
> + DPAA2_BUS_DEBUG("--> Unmap address: %"PRIu64", size: 0x%"PRIu64"",
> dma_unmap.iova, dma_unmap.size);
> ret = ioctl(group->container->fd, VFIO_IOMMU_UNMAP_DMA, &dma_unmap);
> if (ret) {
> @@ -401,7 +401,7 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj)
> goto MC_FAILURE;
> }
>
> - DPAA2_BUS_DEBUG("Region offset = %llx , region size = %llx",
> + DPAA2_BUS_DEBUG("Region offset = %"PRIu64" , region size = %"PRIu64"",
> reg_info.offset, reg_info.size);
>
> v_addr = (size_t)mmap(NULL, reg_info.size,
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 5:04 [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier Gowrishankar
2018-04-13 7:10 ` Shreyansh Jain
2018-04-13 7:37 ` Hemant Agrawal
@ 2018-04-13 7:41 ` Thomas Monjalon
2018-04-13 8:56 ` Shreyansh Jain
2018-04-13 10:40 ` [dpdk-dev] [PATCH v2] " Gowrishankar
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Thomas Monjalon @ 2018-04-13 7:41 UTC (permalink / raw)
To: Gowrishankar; +Cc: Hemant Agrawal, Shreyansh Jain, Anatoly Burakov, dev
13/04/2018 07:04, Gowrishankar:
> - DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
> + DPAA2_BUS_DEBUG("--> Map address: %"PRIu64", size: 0x%"PRIu64"",
You cannot replace hexadecimal by decimal.
You need to use PRIx64.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 8:56 ` Shreyansh Jain
@ 2018-04-13 8:43 ` gowrishankar muthukrishnan
2018-04-13 10:37 ` Shreyansh Jain
0 siblings, 1 reply; 15+ messages in thread
From: gowrishankar muthukrishnan @ 2018-04-13 8:43 UTC (permalink / raw)
To: Shreyansh Jain, Thomas Monjalon; +Cc: Hemant Agrawal, Anatoly Burakov, dev
On Friday 13 April 2018 02:26 PM, Shreyansh Jain wrote:
> On Friday 13 April 2018 01:11 PM, Thomas Monjalon wrote:
>> 13/04/2018 07:04, Gowrishankar:
>>> - DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
>>> + DPAA2_BUS_DEBUG("--> Map address: %"PRIu64", size: 0x%"PRIu64"",
>>
>> You cannot replace hexadecimal by decimal.
>> You need to use PRIx64.
>>
>>
>
> Now that Thomas has pointed out, I think the log message can be
> improved. Len as hex is not helpful and is out of sync with other
> messages in this file.
>
> While on this, I think it should be corrected.
> I will fix this.
>
> @gowrishankar, I will post a patch in reply to your patch - can you
> please help me with ppc64le check? I will take care of Hemant's comment.
Yup, I check for it. Thanks Shreyansh.
>
> -
> Shreyansh
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 7:41 ` Thomas Monjalon
@ 2018-04-13 8:56 ` Shreyansh Jain
2018-04-13 8:43 ` gowrishankar muthukrishnan
0 siblings, 1 reply; 15+ messages in thread
From: Shreyansh Jain @ 2018-04-13 8:56 UTC (permalink / raw)
To: Thomas Monjalon, Gowrishankar
Cc: Hemant Agrawal, Shreyansh Jain, Anatoly Burakov, dev
On Friday 13 April 2018 01:11 PM, Thomas Monjalon wrote:
> 13/04/2018 07:04, Gowrishankar:
>> - DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
>> + DPAA2_BUS_DEBUG("--> Map address: %"PRIu64", size: 0x%"PRIu64"",
>
> You cannot replace hexadecimal by decimal.
> You need to use PRIx64.
>
>
Now that Thomas has pointed out, I think the log message can be
improved. Len as hex is not helpful and is out of sync with other
messages in this file.
While on this, I think it should be corrected.
I will fix this.
@gowrishankar, I will post a patch in reply to your patch - can you
please help me with ppc64le check? I will take care of Hemant's comment.
-
Shreyansh
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 8:43 ` gowrishankar muthukrishnan
@ 2018-04-13 10:37 ` Shreyansh Jain
0 siblings, 0 replies; 15+ messages in thread
From: Shreyansh Jain @ 2018-04-13 10:37 UTC (permalink / raw)
To: gowrishankar muthukrishnan; +Cc: dev
On Friday 13 April 2018 02:13 PM, gowrishankar muthukrishnan wrote:
> On Friday 13 April 2018 02:26 PM, Shreyansh Jain wrote:
>> On Friday 13 April 2018 01:11 PM, Thomas Monjalon wrote:
>>> 13/04/2018 07:04, Gowrishankar:
>>>> - DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
>>>> + DPAA2_BUS_DEBUG("--> Map address: %"PRIu64", size: 0x%"PRIu64"",
>>>
>>> You cannot replace hexadecimal by decimal.
>>> You need to use PRIx64.
>>>
>>>
>>
>> Now that Thomas has pointed out, I think the log message can be
>> improved. Len as hex is not helpful and is out of sync with other
>> messages in this file.
>>
>> While on this, I think it should be corrected.
>> I will fix this.
>>
>> @gowrishankar, I will post a patch in reply to your patch - can you
>> please help me with ppc64le check? I will take care of Hemant's comment.
>
> Yup, I check for it. Thanks Shreyansh.
>
Can you please check this:
--->8---
@@ -270,8 +270,8 @@ fslmc_map_dma(uint64_t vaddr, rte_iova_t iovaddr
__rte_unused, size_t len)
return -1;
}
- DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
- dma_map.vaddr, dma_map.size);
+ DPAA2_BUS_DEBUG("--> Map address: 0x%"PRIx64", size: %"PRIu64"",
+ (uint64_t)dma_map.vaddr, (uint64_t)dma_map.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map);
if (ret) {
DPAA2_BUS_ERR("VFIO_IOMMU_MAP_DMA API(errno = %d)",
@@ -303,8 +303,8 @@ fslmc_unmap_dma(uint64_t vaddr, uint64_t iovaddr
__rte_unused, size_t len)
return -1;
}
- DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX",
- dma_unmap.iova, dma_unmap.size);
+ DPAA2_BUS_DEBUG("--> Unmap address: 0x%"PRIx64", size: %"PRIu64"",
+ (uint64_t)dma_unmap.iova, (uint64_t)dma_unmap.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_UNMAP_DMA,
&dma_unmap);
if (ret) {
DPAA2_BUS_ERR("VFIO_IOMMU_UNMAP_DMA API(errno = %d)",
@@ -401,8 +401,8 @@ static int64_t vfio_map_mcp_obj(struct
fslmc_vfio_group *group, char *mcp_obj)
goto MC_FAILURE;
}
- DPAA2_BUS_DEBUG("Region offset = %llx , region size = %llx",
- reg_info.offset, reg_info.size);
+ DPAA2_BUS_DEBUG("Region offset = 0x%"PRIx64", region size =
%"PRIu64"",
+ (uint64_t)reg_info.offset, (uint64_t)reg_info.size);
v_addr = (size_t)mmap(NULL, reg_info.size,
PROT_WRITE | PROT_READ, MAP_SHARED,
--->8---
gcc for i686/x86_64/ARM64 are compiling fine for me.
If this works fine, feel free to use it in your patch.
-
Shreyansh
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 5:04 [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier Gowrishankar
` (2 preceding siblings ...)
2018-04-13 7:41 ` Thomas Monjalon
@ 2018-04-13 10:40 ` Gowrishankar
2018-04-13 10:47 ` gowrishankar muthukrishnan
2018-04-13 10:55 ` Gowrishankar
2018-04-13 11:22 ` [dpdk-dev] [PATCH v3] " Gowrishankar
5 siblings, 1 reply; 15+ messages in thread
From: Gowrishankar @ 2018-04-13 10:40 UTC (permalink / raw)
To: Hemant Agrawal, Shreyansh Jain
Cc: Anatoly Burakov, dev, Thomas Monjalon, Gowrishankar Muthukrishnan
From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
breaks compile in ppc64le.
Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
--
v2:
- corrected format specifier wrt address and size.
In file included from dpdk/drivers/bus/fslmc/fslmc_vfio.c:37:0:
dpdk/drivers/bus/fslmc/fslmc_vfio.c: In function ‘fslmc_map_dma’:
dpdk/drivers/bus/fslmc/fslmc_logs.h:18:44: error: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \
^
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:2: note: in expansion of macro ‘DPAA2_BUS_DEBUG’
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
^~~~~~~~~~~~~~~
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:39: note: format string is defined here
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
~~~^
%lX
---
drivers/bus/fslmc/fslmc_vfio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 4036e82..80c64d2 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -270,7 +270,7 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
+ DPAA2_BUS_DEBUG("--> Map address: %"PRIx64", size: 0x%"PRIu64"",
dma_map.vaddr, dma_map.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map);
if (ret) {
@@ -303,7 +303,7 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX",
+ DPAA2_BUS_DEBUG("--> Unmap address: %"PRIx64", size: 0x%"PRIu64"",
dma_unmap.iova, dma_unmap.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_UNMAP_DMA, &dma_unmap);
if (ret) {
@@ -401,7 +401,7 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj)
goto MC_FAILURE;
}
- DPAA2_BUS_DEBUG("Region offset = %llx , region size = %llx",
+ DPAA2_BUS_DEBUG("Region offset = %"PRIx64" , region size = %"PRIu64"",
reg_info.offset, reg_info.size);
v_addr = (size_t)mmap(NULL, reg_info.size,
--
1.9.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 10:40 ` [dpdk-dev] [PATCH v2] " Gowrishankar
@ 2018-04-13 10:47 ` gowrishankar muthukrishnan
0 siblings, 0 replies; 15+ messages in thread
From: gowrishankar muthukrishnan @ 2018-04-13 10:47 UTC (permalink / raw)
To: Hemant Agrawal, Shreyansh Jain; +Cc: Anatoly Burakov, dev, Thomas Monjalon
On Friday 13 April 2018 04:10 PM, Gowrishankar wrote:
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>
> Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
> breaks compile in ppc64le.
>
> Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
>
> Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> --
>
> v2:
> - corrected format specifier wrt address and size.
Please ignore it. I sent incorrect one by mistake. Thanks.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 5:04 [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier Gowrishankar
` (3 preceding siblings ...)
2018-04-13 10:40 ` [dpdk-dev] [PATCH v2] " Gowrishankar
@ 2018-04-13 10:55 ` Gowrishankar
2018-04-13 11:17 ` Shreyansh Jain
2018-04-13 11:22 ` [dpdk-dev] [PATCH v3] " Gowrishankar
5 siblings, 1 reply; 15+ messages in thread
From: Gowrishankar @ 2018-04-13 10:55 UTC (permalink / raw)
To: Hemant Agrawal, Shreyansh Jain
Cc: Anatoly Burakov, dev, Thomas Monjalon, Gowrishankar Muthukrishnan
From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
breaks compile in ppc64le.
Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
--
v2:
- corrected format specifier wrt address and size.
Thanks Shreyansh, Hemant and Thomas.
In file included from dpdk/drivers/bus/fslmc/fslmc_vfio.c:37:0:
dpdk/drivers/bus/fslmc/fslmc_vfio.c: In function ‘fslmc_map_dma’:
dpdk/drivers/bus/fslmc/fslmc_logs.h:18:44: error: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \
^
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:2: note: in expansion of macro ‘DPAA2_BUS_DEBUG’
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
^~~~~~~~~~~~~~~
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:39: note: format string is defined here
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
~~~^
%lX
---
drivers/bus/fslmc/fslmc_vfio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 4036e82..93c20f3 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -270,8 +270,8 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
- dma_map.vaddr, dma_map.size);
+ DPAA2_BUS_DEBUG("--> Map address: %"PRIx64", size: 0x%"PRIu64"",
+ (uint64_t)dma_map.vaddr, (uint64_t)dma_map.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map);
if (ret) {
DPAA2_BUS_ERR("VFIO_IOMMU_MAP_DMA API(errno = %d)",
@@ -303,8 +303,8 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX",
- dma_unmap.iova, dma_unmap.size);
+ DPAA2_BUS_DEBUG("--> Unmap address: %"PRIx64", size: 0x%"PRIu64"",
+ (uint64_t)dma_unmap.iova, (uint64_t)dma_unmap.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_UNMAP_DMA, &dma_unmap);
if (ret) {
DPAA2_BUS_ERR("VFIO_IOMMU_UNMAP_DMA API(errno = %d)",
@@ -401,8 +401,8 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj)
goto MC_FAILURE;
}
- DPAA2_BUS_DEBUG("Region offset = %llx , region size = %llx",
- reg_info.offset, reg_info.size);
+ DPAA2_BUS_DEBUG("Region offset = %"PRIx64" , region size = %"PRIu64"",
+ (uint64_t)reg_info.offset, (uint64_t)reg_info.size);
v_addr = (size_t)mmap(NULL, reg_info.size,
PROT_WRITE | PROT_READ, MAP_SHARED,
--
1.9.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 10:55 ` Gowrishankar
@ 2018-04-13 11:17 ` Shreyansh Jain
0 siblings, 0 replies; 15+ messages in thread
From: Shreyansh Jain @ 2018-04-13 11:17 UTC (permalink / raw)
To: Gowrishankar; +Cc: Hemant Agrawal, Anatoly Burakov, dev, Thomas Monjalon
On Friday 13 April 2018 04:25 PM, Gowrishankar wrote:
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>
> Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
> breaks compile in ppc64le.
>
> Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
>
> Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> --
>
> v2:
> - corrected format specifier wrt address and size.
> Thanks Shreyansh, Hemant and Thomas.
>
> In file included from dpdk/drivers/bus/fslmc/fslmc_vfio.c:37:0:
> dpdk/drivers/bus/fslmc/fslmc_vfio.c: In function ‘fslmc_map_dma’:
> dpdk/drivers/bus/fslmc/fslmc_logs.h:18:44: error: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
> rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \
> ^
> dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:2: note: in expansion of macro ‘DPAA2_BUS_DEBUG’
> DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
> ^~~~~~~~~~~~~~~
> dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:39: note: format string is defined here
> DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
> ~~~^
> %lX
> ---
> drivers/bus/fslmc/fslmc_vfio.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
> index 4036e82..93c20f3 100644
> --- a/drivers/bus/fslmc/fslmc_vfio.c
> +++ b/drivers/bus/fslmc/fslmc_vfio.c
> @@ -270,8 +270,8 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
> return -1;
> }
>
> - DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
> - dma_map.vaddr, dma_map.size);
> + DPAA2_BUS_DEBUG("--> Map address: %"PRIx64", size: 0x%"PRIu64"",
^^^^^^^^^^^^^^^^^^^^^^
Should be: 0x%"PRIx64", size: %"PRIu64""
> + (uint64_t)dma_map.vaddr, (uint64_t)dma_map.size);
> ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map);
> if (ret) {
> DPAA2_BUS_ERR("VFIO_IOMMU_MAP_DMA API(errno = %d)",
> @@ -303,8 +303,8 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
> return -1;
> }
>
> - DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX",
> - dma_unmap.iova, dma_unmap.size);
> + DPAA2_BUS_DEBUG("--> Unmap address: %"PRIx64", size: 0x%"PRIu64"",
^^^^^^^^^^^^^^^^^^^^^^
Should be: 0x%"PRIx64", size: %"PRIu64""
> + (uint64_t)dma_unmap.iova, (uint64_t)dma_unmap.size);
> ret = ioctl(group->container->fd, VFIO_IOMMU_UNMAP_DMA, &dma_unmap);
> if (ret) {
> DPAA2_BUS_ERR("VFIO_IOMMU_UNMAP_DMA API(errno = %d)",
> @@ -401,8 +401,8 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj)
> goto MC_FAILURE;
> }
>
> - DPAA2_BUS_DEBUG("Region offset = %llx , region size = %llx",
> - reg_info.offset, reg_info.size);
> + DPAA2_BUS_DEBUG("Region offset = %"PRIx64" , region size = %"PRIu64"",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Should be: 0x%"PRIx64", region size = %"PRIu64""
> + (uint64_t)reg_info.offset, (uint64_t)reg_info.size);
>
> v_addr = (size_t)mmap(NULL, reg_info.size,
> PROT_WRITE | PROT_READ, MAP_SHARED,
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v3] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 5:04 [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier Gowrishankar
` (4 preceding siblings ...)
2018-04-13 10:55 ` Gowrishankar
@ 2018-04-13 11:22 ` Gowrishankar
2018-04-13 12:44 ` Hemant Agrawal
5 siblings, 1 reply; 15+ messages in thread
From: Gowrishankar @ 2018-04-13 11:22 UTC (permalink / raw)
To: Hemant Agrawal, Shreyansh Jain
Cc: dev, Thomas Monjalon, Gowrishankar Muthukrishnan
From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
breaks compile in ppc64le.
Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
--
v3:
- correction to prefix address with 0x
v2:
- corrected format specifier wrt address and size.
Thanks Shreyansh, Hemant and Thomas.
In file included from dpdk/drivers/bus/fslmc/fslmc_vfio.c:37:0:
dpdk/drivers/bus/fslmc/fslmc_vfio.c: In function ‘fslmc_map_dma’:
dpdk/drivers/bus/fslmc/fslmc_logs.h:18:44: error: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \
^
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:2: note: in expansion of macro ‘DPAA2_BUS_DEBUG’
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
^~~~~~~~~~~~~~~
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:39: note: format string is defined here
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
~~~^
%lX
---
drivers/bus/fslmc/fslmc_vfio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 4036e82..675d160 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -270,8 +270,8 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
- dma_map.vaddr, dma_map.size);
+ DPAA2_BUS_DEBUG("--> Map address: 0x%"PRIx64", size: %"PRIu64"",
+ (uint64_t)dma_map.vaddr, (uint64_t)dma_map.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map);
if (ret) {
DPAA2_BUS_ERR("VFIO_IOMMU_MAP_DMA API(errno = %d)",
@@ -303,8 +303,8 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX",
- dma_unmap.iova, dma_unmap.size);
+ DPAA2_BUS_DEBUG("--> Unmap address: 0x%"PRIx64", size: %"PRIu64"",
+ (uint64_t)dma_unmap.iova, (uint64_t)dma_unmap.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_UNMAP_DMA, &dma_unmap);
if (ret) {
DPAA2_BUS_ERR("VFIO_IOMMU_UNMAP_DMA API(errno = %d)",
@@ -401,8 +401,8 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj)
goto MC_FAILURE;
}
- DPAA2_BUS_DEBUG("Region offset = %llx , region size = %llx",
- reg_info.offset, reg_info.size);
+ DPAA2_BUS_DEBUG("Region offset = 0x%"PRIx64" , region size = %"PRIu64"",
+ (uint64_t)reg_info.offset, (uint64_t)reg_info.size);
v_addr = (size_t)mmap(NULL, reg_info.size,
PROT_WRITE | PROT_READ, MAP_SHARED,
--
1.9.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v3] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 11:22 ` [dpdk-dev] [PATCH v3] " Gowrishankar
@ 2018-04-13 12:44 ` Hemant Agrawal
2018-04-15 12:22 ` Thomas Monjalon
0 siblings, 1 reply; 15+ messages in thread
From: Hemant Agrawal @ 2018-04-13 12:44 UTC (permalink / raw)
To: Gowrishankar, Hemant Agrawal, Shreyansh Jain; +Cc: dev, Thomas Monjalon
On 4/13/2018 4:52 PM, Gowrishankar wrote:
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>
> Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
> breaks compile in ppc64le.
>
> Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
>
> Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> --
> v3:
> - correction to prefix address with 0x
> v2:
> - corrected format specifier wrt address and size.
> Thanks Shreyansh, Hemant and Thomas.
>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v3] bus/fslmc: use PRIu64 instead of llX in format specifier
2018-04-13 12:44 ` Hemant Agrawal
@ 2018-04-15 12:22 ` Thomas Monjalon
0 siblings, 0 replies; 15+ messages in thread
From: Thomas Monjalon @ 2018-04-15 12:22 UTC (permalink / raw)
To: Gowrishankar; +Cc: dev, Hemant Agrawal, Shreyansh Jain
13/04/2018 14:44, Hemant Agrawal:
>
> On 4/13/2018 4:52 PM, Gowrishankar wrote:
> > From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> >
> > Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
> > breaks compile in ppc64le.
> >
> > Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
> >
> > Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> > --
> > v3:
> > - correction to prefix address with 0x
> > v2:
> > - corrected format specifier wrt address and size.
> > Thanks Shreyansh, Hemant and Thomas.
> >
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Applied, thanks
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2018-04-15 12:22 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13 5:04 [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier Gowrishankar
2018-04-13 7:10 ` Shreyansh Jain
2018-04-13 7:09 ` Hemant Agrawal
2018-04-13 7:37 ` Hemant Agrawal
2018-04-13 7:41 ` Thomas Monjalon
2018-04-13 8:56 ` Shreyansh Jain
2018-04-13 8:43 ` gowrishankar muthukrishnan
2018-04-13 10:37 ` Shreyansh Jain
2018-04-13 10:40 ` [dpdk-dev] [PATCH v2] " Gowrishankar
2018-04-13 10:47 ` gowrishankar muthukrishnan
2018-04-13 10:55 ` Gowrishankar
2018-04-13 11:17 ` Shreyansh Jain
2018-04-13 11:22 ` [dpdk-dev] [PATCH v3] " Gowrishankar
2018-04-13 12:44 ` Hemant Agrawal
2018-04-15 12:22 ` Thomas Monjalon
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).