patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix 32-bit build
@ 2019-06-27 15:10 Ali Alnubani
  2019-06-27 15:26 ` [dpdk-stable] [dpdk-dev] " Stephen Hemminger
  2019-06-27 16:01 ` [dpdk-stable] " Ferruh Yigit
  0 siblings, 2 replies; 3+ messages in thread
From: Ali Alnubani @ 2019-06-27 15:10 UTC (permalink / raw)
  To: dev; +Cc: motih, stable

This is to fix the error:
  ```
  drivers/net/mlx5/mlx5_defs.h:14:26: error: format '%lx' expects argument
  of type 'long unsigned int', but argument 5 has type 'off_t {aka long
  long int}' [-Werror=format=]
   #define MLX5_DRIVER_NAME "net_mlx5"
                            ^
  RTE_SDK/i686-native-linuxapp-gcc/include/rte_common.h:642:27:
  note: in definition of macro 'RTE_FMT'
   #define RTE_FMT(fmt, ...) fmt "%.0s", __VA_ARGS__ ""
                             ^~~
  RTE_SDK/drivers/net/mlx5/mlx5_utils.h:79:11: note: in expansion
  of macro 'MLX5_DRIVER_NAME'
     RTE_FMT(MLX5_DRIVER_NAME ": " \
             ^~~~~~~~~~~~~~~~
  RTE_SDK/drivers/net/mlx5/mlx5_utils.h:101:2: note: in expansion
  of macro 'PMD_DRV_LOG___'
    PMD_DRV_LOG___(level, __VA_ARGS__)
    ^~~~~~~~~~~~~~
  RTE_SDK/drivers/net/mlx5/mlx5_utils.h:103:2: note: in expansion
  of macro 'PMD_DRV_LOG__'
    PMD_DRV_LOG__(level, s "\n", __VA_ARGS__)
    ^~~~~~~~~~~~~
  RTE_SDK/drivers/net/mlx5/mlx5_utils.h:109:2: note: in expansion
  of macro 'PMD_DRV_LOG_'
    PMD_DRV_LOG_(level, \
    ^~~~~~~~~~~~
  RTE_SDK/drivers/net/mlx5/mlx5_txq.c:569:3: note: in expansion of
  macro 'DRV_LOG'
     DRV_LOG(DEBUG, "port %u: uar_mmap_offset 0x%lx",
     ^~~~~~~
  RTE_SDK/drivers/net/mlx5/mlx5_txq.c:569:48: note: format string
  is defined here
     DRV_LOG(DEBUG, "port %u: uar_mmap_offset 0x%lx"
                                                ~~^
                                                %llx
  ```
Which reproduces with gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0.

Fixes: 6bf10ab69be0 ("net/mlx5: support 32-bit systems")
Cc: motih@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
---
 drivers/net/mlx5/mlx5_txq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index ebb42cbff..5cdcbf2f2 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -10,6 +10,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <sys/mman.h>
+#include <inttypes.h>
 
 /* Verbs header. */
 /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
@@ -566,7 +567,7 @@ mlx5_txq_ibv_new(struct rte_eth_dev *dev, uint16_t idx)
 	txq_uar_init(txq_ctrl);
 	if (qp.comp_mask & MLX5DV_QP_MASK_UAR_MMAP_OFFSET) {
 		txq_ctrl->uar_mmap_offset = qp.uar_mmap_offset;
-		DRV_LOG(DEBUG, "port %u: uar_mmap_offset 0x%lx",
+		DRV_LOG(DEBUG, "port %u: uar_mmap_offset 0x%"PRIx64"",
 			dev->data->port_id, txq_ctrl->uar_mmap_offset);
 	} else {
 		DRV_LOG(ERR,
-- 
2.22.0


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix 32-bit build
  2019-06-27 15:10 [dpdk-stable] [PATCH] net/mlx5: fix 32-bit build Ali Alnubani
@ 2019-06-27 15:26 ` Stephen Hemminger
  2019-06-27 16:01 ` [dpdk-stable] " Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2019-06-27 15:26 UTC (permalink / raw)
  To: Ali Alnubani; +Cc: dev, motih, stable

On Thu, 27 Jun 2019 18:10:07 +0300
Ali Alnubani <alialnu@mellanox.com> wrote:

> +		DRV_LOG(DEBUG, "port %u: uar_mmap_offset 0x%"PRIx64"",

Minor nitpick:
You don't need empty string at the end of the format.

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

* Re: [dpdk-stable] [PATCH] net/mlx5: fix 32-bit build
  2019-06-27 15:10 [dpdk-stable] [PATCH] net/mlx5: fix 32-bit build Ali Alnubani
  2019-06-27 15:26 ` [dpdk-stable] [dpdk-dev] " Stephen Hemminger
@ 2019-06-27 16:01 ` Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2019-06-27 16:01 UTC (permalink / raw)
  To: Ali Alnubani, dev; +Cc: motih, stable, Stephen Hemminger

On 6/27/2019 4:10 PM, Ali Alnubani wrote:
> This is to fix the error:
>   ```
>   drivers/net/mlx5/mlx5_defs.h:14:26: error: format '%lx' expects argument
>   of type 'long unsigned int', but argument 5 has type 'off_t {aka long
>   long int}' [-Werror=format=]
>    #define MLX5_DRIVER_NAME "net_mlx5"
>                             ^
>   RTE_SDK/i686-native-linuxapp-gcc/include/rte_common.h:642:27:
>   note: in definition of macro 'RTE_FMT'
>    #define RTE_FMT(fmt, ...) fmt "%.0s", __VA_ARGS__ ""
>                              ^~~
>   RTE_SDK/drivers/net/mlx5/mlx5_utils.h:79:11: note: in expansion
>   of macro 'MLX5_DRIVER_NAME'
>      RTE_FMT(MLX5_DRIVER_NAME ": " \
>              ^~~~~~~~~~~~~~~~
>   RTE_SDK/drivers/net/mlx5/mlx5_utils.h:101:2: note: in expansion
>   of macro 'PMD_DRV_LOG___'
>     PMD_DRV_LOG___(level, __VA_ARGS__)
>     ^~~~~~~~~~~~~~
>   RTE_SDK/drivers/net/mlx5/mlx5_utils.h:103:2: note: in expansion
>   of macro 'PMD_DRV_LOG__'
>     PMD_DRV_LOG__(level, s "\n", __VA_ARGS__)
>     ^~~~~~~~~~~~~
>   RTE_SDK/drivers/net/mlx5/mlx5_utils.h:109:2: note: in expansion
>   of macro 'PMD_DRV_LOG_'
>     PMD_DRV_LOG_(level, \
>     ^~~~~~~~~~~~
>   RTE_SDK/drivers/net/mlx5/mlx5_txq.c:569:3: note: in expansion of
>   macro 'DRV_LOG'
>      DRV_LOG(DEBUG, "port %u: uar_mmap_offset 0x%lx",
>      ^~~~~~~
>   RTE_SDK/drivers/net/mlx5/mlx5_txq.c:569:48: note: format string
>   is defined here
>      DRV_LOG(DEBUG, "port %u: uar_mmap_offset 0x%lx"
>                                                 ~~^
>                                                 %llx
>   ```
> Which reproduces with gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0.
> 
> Fixes: 6bf10ab69be0 ("net/mlx5: support 32-bit systems")
> Cc: motih@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ali Alnubani <alialnu@mellanox.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.

(empty string at the end removed while merging)


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

end of thread, other threads:[~2019-06-27 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 15:10 [dpdk-stable] [PATCH] net/mlx5: fix 32-bit build Ali Alnubani
2019-06-27 15:26 ` [dpdk-stable] [dpdk-dev] " Stephen Hemminger
2019-06-27 16:01 ` [dpdk-stable] " Ferruh Yigit

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