DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx: fix printing format specifiers
@ 2018-05-10  5:53 Yongseok Koh
  2018-05-10 10:58 ` Shahaf Shuler
  0 siblings, 1 reply; 3+ messages in thread
From: Yongseok Koh @ 2018-05-10  5:53 UTC (permalink / raw)
  To: shahafs, adrien.mazarguil, nelio.laranjeiro
  Cc: dev, ferruh.yigit, Yongseok Koh

This will have to be squashed to:
	net/mlx4: add new Memory Region support
	net/mlx5: add new Memory Region support

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---

This is not a formal patch to merge but Shahaf will squash it separately to mlx4
and mlx5 for dpdk-next-net.

 drivers/net/mlx4/mlx4_mr.c | 20 ++++++++++++--------
 drivers/net/mlx5/mlx5_mr.c | 21 +++++++++++++--------
 2 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_mr.c b/drivers/net/mlx4/mlx4_mr.c
index 08e632baf..d23d3c613 100644
--- a/drivers/net/mlx4/mlx4_mr.c
+++ b/drivers/net/mlx4/mlx4_mr.c
@@ -161,8 +161,8 @@ mr_btree_insert(struct mlx4_mr_btree *bt, struct mlx4_mr_cache *entry)
 	lkp_tbl = *bt->table;
 	/* Find out the slot for insertion. */
 	if (mr_btree_lookup(bt, &idx, entry->start) != UINT32_MAX) {
-		DEBUG("abort insertion to B-tree(%p):"
-		      " already exist at idx=%u [0x%lx, 0x%lx) lkey=0x%x",
+		DEBUG("abort insertion to B-tree(%p): already exist at"
+		      " idx=%u [0x%" PRIxPTR ", 0x%" PRIxPTR ") lkey=0x%x",
 		      (void *)bt, idx, entry->start, entry->end, entry->lkey);
 		/* Already exist, return. */
 		return 0;
@@ -179,7 +179,8 @@ mr_btree_insert(struct mlx4_mr_btree *bt, struct mlx4_mr_cache *entry)
 		memmove(&lkp_tbl[idx + 1], &lkp_tbl[idx], shift);
 	lkp_tbl[idx] = *entry;
 	bt->len++;
-	DEBUG("inserted B-tree(%p)[%u], [0x%lx, 0x%lx) lkey=0x%x",
+	DEBUG("inserted B-tree(%p)[%u],"
+	      " [0x%" PRIxPTR ", 0x%" PRIxPTR ") lkey=0x%x",
 	      (void *)bt, idx, entry->start, entry->end, entry->lkey);
 	return 0;
 }
@@ -259,7 +260,8 @@ mlx4_mr_btree_dump(struct mlx4_mr_btree *bt)
 	for (idx = 0; idx < bt->len; ++idx) {
 		struct mlx4_mr_cache *entry = &lkp_tbl[idx];
 
-		DEBUG("B-tree(%p)[%u], [0x%lx, 0x%lx) lkey=0x%x",
+		DEBUG("B-tree(%p)[%u],"
+		      " [0x%" PRIxPTR ", 0x%" PRIxPTR ") lkey=0x%x",
 		      (void *)bt, idx, entry->start, entry->end, entry->lkey);
 	}
 }
@@ -574,7 +576,8 @@ mlx4_mr_create(struct rte_eth_dev *dev, struct mlx4_mr_cache *entry,
 	assert(msl->page_sz == ms->hugepage_sz);
 	/* Number of memsegs in the range. */
 	ms_n = len / msl->page_sz;
-	DEBUG("port %u extending %p to [0x%lx, 0x%lx), page_sz=0x%lx, ms_n=%u",
+	DEBUG("port %u extending %p to [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
+	      " page_sz=0x%" PRIx64 ", ms_n=%u",
 	      dev->data->port_id, (void *)addr,
 	      data.start, data.end, msl->page_sz, ms_n);
 	/* Size of memory for bitmap. */
@@ -708,7 +711,8 @@ mlx4_mr_create(struct rte_eth_dev *dev, struct mlx4_mr_cache *entry,
 	assert(mr->ibv_mr->length == len);
 	LIST_INSERT_HEAD(&priv->mr.mr_list, mr, mr);
 	DEBUG("port %u MR CREATED (%p) for %p:\n"
-	      "  [0x%lx, 0x%lx), lkey=0x%x base_idx=%u ms_n=%u, ms_bmp_n=%u",
+	      "  [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
+	      " lkey=0x%x base_idx=%u ms_n=%u, ms_bmp_n=%u",
 	      dev->data->port_id, (void *)mr, (void *)addr,
 	      data.start, data.end, rte_cpu_to_be_32(mr->ibv_mr->lkey),
 	      mr->ms_base_idx, mr->ms_n, mr->ms_bmp_n);
@@ -784,7 +788,7 @@ mlx4_mr_mem_event_free_cb(struct rte_eth_dev *dev, const void *addr, size_t len)
 	int i;
 	int rebuild = 0;
 
-	DEBUG("port %u free callback: addr=%p, len=%lu",
+	DEBUG("port %u free callback: addr=%p, len=%zu",
 	      dev->data->port_id, addr, len);
 	msl = rte_mem_virt2memseg_list(addr);
 	/* addr and len must be page-aligned. */
@@ -1129,7 +1133,7 @@ mlx4_mr_dump_dev(struct rte_eth_dev *dev)
 			n = mr_find_next_chunk(mr, &ret, n);
 			if (!ret.end)
 				break;
-			DEBUG("  chunk[%u], [0x%lx, 0x%lx)",
+			DEBUG("  chunk[%u], [0x%" PRIxPTR ", 0x%" PRIxPTR ")",
 			      chunk_n++, ret.start, ret.end);
 		}
 	}
diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
index 8245535f9..abb1f5179 100644
--- a/drivers/net/mlx5/mlx5_mr.c
+++ b/drivers/net/mlx5/mlx5_mr.c
@@ -146,8 +146,8 @@ mr_btree_insert(struct mlx5_mr_btree *bt, struct mlx5_mr_cache *entry)
 	/* Find out the slot for insertion. */
 	if (mr_btree_lookup(bt, &idx, entry->start) != UINT32_MAX) {
 		DRV_LOG(DEBUG,
-			"abort insertion to B-tree(%p):"
-			" already exist at idx=%u [0x%lx, 0x%lx) lkey=0x%x",
+			"abort insertion to B-tree(%p): already exist at"
+			" idx=%u [0x%" PRIxPTR ", 0x%" PRIxPTR ") lkey=0x%x",
 			(void *)bt, idx, entry->start, entry->end, entry->lkey);
 		/* Already exist, return. */
 		return 0;
@@ -165,7 +165,8 @@ mr_btree_insert(struct mlx5_mr_btree *bt, struct mlx5_mr_cache *entry)
 	lkp_tbl[idx] = *entry;
 	bt->len++;
 	DRV_LOG(DEBUG,
-		"inserted B-tree(%p)[%u], [0x%lx, 0x%lx) lkey=0x%x",
+		"inserted B-tree(%p)[%u],"
+		" [0x%" PRIxPTR ", 0x%" PRIxPTR ") lkey=0x%x",
 		(void *)bt, idx, entry->start, entry->end, entry->lkey);
 	return 0;
 }
@@ -247,7 +248,8 @@ mlx5_mr_btree_dump(struct mlx5_mr_btree *bt)
 		struct mlx5_mr_cache *entry = &lkp_tbl[idx];
 
 		DRV_LOG(DEBUG,
-			"B-tree(%p)[%u], [0x%lx, 0x%lx) lkey=0x%x",
+			"B-tree(%p)[%u],"
+			" [0x%" PRIxPTR ", 0x%" PRIxPTR ") lkey=0x%x",
 			(void *)bt, idx, entry->start, entry->end, entry->lkey);
 	}
 }
@@ -574,7 +576,8 @@ mlx5_mr_create(struct rte_eth_dev *dev, struct mlx5_mr_cache *entry,
 	/* Number of memsegs in the range. */
 	ms_n = len / msl->page_sz;
 	DRV_LOG(DEBUG,
-		"port %u extending %p to [0x%lx, 0x%lx), page_sz=0x%lx, ms_n=%u",
+		"port %u extending %p to [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
+		" page_sz=0x%" PRIx64 ", ms_n=%u",
 		dev->data->port_id, (void *)addr,
 		data.start, data.end, msl->page_sz, ms_n);
 	/* Size of memory for bitmap. */
@@ -714,7 +717,8 @@ mlx5_mr_create(struct rte_eth_dev *dev, struct mlx5_mr_cache *entry,
 	LIST_INSERT_HEAD(&priv->mr.mr_list, mr, mr);
 	DRV_LOG(DEBUG,
 		"port %u MR CREATED (%p) for %p:\n"
-		"  [0x%lx, 0x%lx), lkey=0x%x base_idx=%u ms_n=%u, ms_bmp_n=%u",
+		"  [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
+		" lkey=0x%x base_idx=%u ms_n=%u, ms_bmp_n=%u",
 		dev->data->port_id, (void *)mr, (void *)addr,
 		data.start, data.end, rte_cpu_to_be_32(mr->ibv_mr->lkey),
 		mr->ms_base_idx, mr->ms_n, mr->ms_bmp_n);
@@ -792,7 +796,7 @@ mlx5_mr_mem_event_free_cb(struct rte_eth_dev *dev, const void *addr, size_t len)
 	int i;
 	int rebuild = 0;
 
-	DRV_LOG(DEBUG, "port %u free callback: addr=%p, len=%lu",
+	DRV_LOG(DEBUG, "port %u free callback: addr=%p, len=%zu",
 		dev->data->port_id, addr, len);
 	msl = rte_mem_virt2memseg_list(addr);
 	/* addr and len must be page-aligned. */
@@ -1143,7 +1147,8 @@ mlx5_mr_dump_dev(struct rte_eth_dev *dev)
 			n = mr_find_next_chunk(mr, &ret, n);
 			if (!ret.end)
 				break;
-			DRV_LOG(DEBUG, "  chunk[%u], [0x%lx, 0x%lx)",
+			DRV_LOG(DEBUG,
+				"  chunk[%u], [0x%" PRIxPTR ", 0x%" PRIxPTR ")",
 				chunk_n++, ret.start, ret.end);
 		}
 	}
-- 
2.11.0

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

end of thread, other threads:[~2018-05-10 19:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-10  5:53 [dpdk-dev] [PATCH] net/mlx: fix printing format specifiers Yongseok Koh
2018-05-10 10:58 ` Shahaf Shuler
2018-05-10 19:39   ` 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).