DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] adjust mlx debug logs
@ 2021-03-08 22:28 Thomas Monjalon
  2021-03-08 22:28 ` [dpdk-dev] [PATCH 1/3] net/mlx4: enable debug logs dynamically Thomas Monjalon
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-08 22:28 UTC (permalink / raw)
  To: dev

Few adjustments of debug log usage in mlx4/mlx5.

Thomas Monjalon (3):
  net/mlx4: enable debug logs dynamically
  common/mlx5: enable debug logs dynamically
  net/mlx5: reduce log level of alignment message

 drivers/common/mlx5/mlx5_common.h     |  2 --
 drivers/common/mlx5/mlx5_common_mr.c  | 45 ++++++++++++++-------------
 drivers/common/mlx5/mlx5_common_pci.c |  4 +--
 drivers/net/mlx4/mlx4_utils.h         |  5 ++-
 drivers/net/mlx5/linux/mlx5_verbs.c   | 13 ++++----
 drivers/net/mlx5/mlx5_mr.c            | 12 +++----
 drivers/net/mlx5/mlx5_rxq.c           | 11 ++++---
 drivers/net/mlx5/mlx5_utils.c         |  4 +--
 8 files changed, 50 insertions(+), 46 deletions(-)

-- 
2.30.1


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

* [dpdk-dev] [PATCH 1/3] net/mlx4: enable debug logs dynamically
  2021-03-08 22:28 [dpdk-dev] [PATCH 0/3] adjust mlx debug logs Thomas Monjalon
@ 2021-03-08 22:28 ` Thomas Monjalon
  2021-03-08 22:28 ` [dpdk-dev] [PATCH 2/3] common/mlx5: " Thomas Monjalon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-08 22:28 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Shahaf Shuler

The macro DEBUG was doing nothing if not compiled with
RTE_LIBRTE_MLX4_DEBUG.

As it is not used in the data path, it can be always enabled at
compilation time. Then it can be enabled at runtime with:
	--log-level pmd.net.mlx4:debug

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mlx4/mlx4_utils.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h
index b8769562ab..fca21fd79c 100644
--- a/drivers/net/mlx4/mlx4_utils.h
+++ b/drivers/net/mlx4/mlx4_utils.h
@@ -52,14 +52,13 @@ pmd_drv_log_basename(const char *s)
 			__LINE__, \
 			__func__, \
 			RTE_FMT_TAIL(__VA_ARGS__,)))
-#define DEBUG(...) PMD_DRV_LOG(DEBUG, __VA_ARGS__)
 #define MLX4_ASSERT(exp) RTE_VERIFY(exp)
 #define claim_zero(...) MLX4_ASSERT((__VA_ARGS__) == 0)
 
 #else /* RTE_LIBRTE_MLX4_DEBUG */
 
 /*
- * Like MLX4_ASSERT(), DEBUG() becomes a no-op and claim_zero() does not perform
+ * Like MLX4_ASSERT(), claim_zero() does not perform
  * any check when debugging is disabled.
  */
 
@@ -68,12 +67,12 @@ pmd_drv_log_basename(const char *s)
 		RTE_FMT(MLX4_DRIVER_NAME ": " \
 			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
 		RTE_FMT_TAIL(__VA_ARGS__,)))
-#define DEBUG(...) (void)0
 #define MLX4_ASSERT(exp) RTE_ASSERT(exp)
 #define claim_zero(...) (__VA_ARGS__)
 
 #endif /* RTE_LIBRTE_MLX4_DEBUG */
 
+#define DEBUG(...) PMD_DRV_LOG(DEBUG, __VA_ARGS__)
 #define INFO(...) PMD_DRV_LOG(INFO, __VA_ARGS__)
 #define WARN(...) PMD_DRV_LOG(WARNING, __VA_ARGS__)
 #define ERROR(...) PMD_DRV_LOG(ERR, __VA_ARGS__)
-- 
2.30.1


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

* [dpdk-dev] [PATCH 2/3] common/mlx5: enable debug logs dynamically
  2021-03-08 22:28 [dpdk-dev] [PATCH 0/3] adjust mlx debug logs Thomas Monjalon
  2021-03-08 22:28 ` [dpdk-dev] [PATCH 1/3] net/mlx4: enable debug logs dynamically Thomas Monjalon
@ 2021-03-08 22:28 ` Thomas Monjalon
  2021-03-08 22:28 ` [dpdk-dev] [PATCH 3/3] net/mlx5: reduce log level of alignment message Thomas Monjalon
  2021-03-09  9:48 ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Thomas Monjalon
  3 siblings, 0 replies; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-08 22:28 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko

Most debug logs are using DRV_LOG(DEBUG,)
but some were using DEBUG().
The macro DEBUG is doing nothing if not compiled with
RTE_LIBRTE_MLX5_DEBUG.

As it is not used in the data path, the macro DEBUG
can be replaced with DRV_LOG.
Then all debug logs can be enabled at runtime with:
	--log-level pmd.net.mlx5:debug

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/common/mlx5/mlx5_common.h     |  2 --
 drivers/common/mlx5/mlx5_common_mr.c  | 45 ++++++++++++++-------------
 drivers/common/mlx5/mlx5_common_pci.c |  4 +--
 drivers/net/mlx5/linux/mlx5_verbs.c   | 13 ++++----
 drivers/net/mlx5/mlx5_mr.c            | 12 +++----
 drivers/net/mlx5/mlx5_rxq.c           | 11 ++++---
 6 files changed, 46 insertions(+), 41 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index 3855582d0d..5028a05b49 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -92,14 +92,12 @@ pmd_drv_log_basename(const char *s)
 /* claim_zero() does not perform any check when debugging is disabled. */
 #ifdef RTE_LIBRTE_MLX5_DEBUG
 
-#define DEBUG(...) DRV_LOG(DEBUG, __VA_ARGS__)
 #define MLX5_ASSERT(exp) RTE_VERIFY(exp)
 #define claim_zero(...) MLX5_ASSERT((__VA_ARGS__) == 0)
 #define claim_nonzero(...) MLX5_ASSERT((__VA_ARGS__) != 0)
 
 #else /* RTE_LIBRTE_MLX5_DEBUG */
 
-#define DEBUG(...) (void)0
 #define MLX5_ASSERT(exp) RTE_ASSERT(exp)
 #define claim_zero(...) (__VA_ARGS__)
 #define claim_nonzero(...) (__VA_ARGS__)
diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c
index 7c25541dc4..e1ed0caf3a 100644
--- a/drivers/common/mlx5/mlx5_common_mr.c
+++ b/drivers/common/mlx5/mlx5_common_mr.c
@@ -187,8 +187,9 @@ mlx5_mr_btree_init(struct mlx5_mr_btree *bt, int n, int socket)
 				0, socket);
 	if (bt->table == NULL) {
 		rte_errno = ENOMEM;
-		DEBUG("failed to allocate memory for btree cache on socket %d",
-		      socket);
+		DRV_LOG(DEBUG,
+			"failed to allocate memory for btree cache on socket "
+			"%d", socket);
 		return -rte_errno;
 	}
 	bt->size = n;
@@ -196,7 +197,7 @@ mlx5_mr_btree_init(struct mlx5_mr_btree *bt, int n, int socket)
 	(*bt->table)[bt->len++] = (struct mr_cache_entry) {
 		.lkey = UINT32_MAX,
 	};
-	DEBUG("initialized B-tree %p with table %p",
+	DRV_LOG(DEBUG, "initialized B-tree %p with table %p",
 	      (void *)bt, (void *)bt->table);
 	return 0;
 }
@@ -212,7 +213,7 @@ mlx5_mr_btree_free(struct mlx5_mr_btree *bt)
 {
 	if (bt == NULL)
 		return;
-	DEBUG("freeing B-tree %p with table %p",
+	DRV_LOG(DEBUG, "freeing B-tree %p with table %p",
 	      (void *)bt, (void *)bt->table);
 	mlx5_free(bt->table);
 	memset(bt, 0, sizeof(*bt));
@@ -237,7 +238,7 @@ mlx5_mr_btree_dump(struct mlx5_mr_btree *bt __rte_unused)
 	for (idx = 0; idx < bt->len; ++idx) {
 		struct mr_cache_entry *entry = &lkp_tbl[idx];
 
-		DEBUG("B-tree(%p)[%u],"
+		DRV_LOG(DEBUG, "B-tree(%p)[%u],"
 		      " [0x%" PRIxPTR ", 0x%" PRIxPTR ") lkey=0x%x",
 		      (void *)bt, idx, entry->start, entry->end, entry->lkey);
 	}
@@ -543,11 +544,11 @@ mlx5_mr_create_secondary(void *pd __rte_unused,
 {
 	int ret;
 
-	DEBUG("port %u requesting MR creation for address (%p)",
+	DRV_LOG(DEBUG, "port %u requesting MR creation for address (%p)",
 	      mp_id->port_id, (void *)addr);
 	ret = mlx5_mp_req_mr_create(mp_id, addr);
 	if (ret) {
-		DEBUG("Fail to request MR creation for address (%p)",
+		DRV_LOG(DEBUG, "Fail to request MR creation for address (%p)",
 		      (void *)addr);
 		return UINT32_MAX;
 	}
@@ -557,7 +558,7 @@ mlx5_mr_create_secondary(void *pd __rte_unused,
 	/* Lookup can't fail. */
 	MLX5_ASSERT(entry->lkey != UINT32_MAX);
 	rte_rwlock_read_unlock(&share_cache->rwlock);
-	DEBUG("MR CREATED by primary process for %p:\n"
+	DRV_LOG(DEBUG, "MR CREATED by primary process for %p:\n"
 	      "  [0x%" PRIxPTR ", 0x%" PRIxPTR "), lkey=0x%x",
 	      (void *)addr, entry->start, entry->end, entry->lkey);
 	return entry->lkey;
@@ -647,7 +648,7 @@ mlx5_mr_create_primary(void *pd,
 	MLX5_ASSERT(msl->page_sz == ms->hugepage_sz);
 	/* Number of memsegs in the range. */
 	ms_n = len / msl->page_sz;
-	DEBUG("Extending %p to [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
+	DRV_LOG(DEBUG, "Extending %p to [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
 	      " page_sz=0x%" PRIx64 ", ms_n=%u",
 	      (void *)addr, data.start, data.end, msl->page_sz, ms_n);
 	/* Size of memory for bitmap. */
@@ -656,7 +657,7 @@ mlx5_mr_create_primary(void *pd,
 			 RTE_ALIGN_CEIL(sizeof(*mr), RTE_CACHE_LINE_SIZE) +
 			 bmp_size, RTE_CACHE_LINE_SIZE, msl->socket_id);
 	if (mr == NULL) {
-		DEBUG("Unable to allocate memory for a new MR of"
+		DRV_LOG(DEBUG, "Unable to allocate memory for a new MR of"
 		      " address (%p).", (void *)addr);
 		rte_errno = ENOMEM;
 		goto err_nolock;
@@ -671,7 +672,7 @@ mlx5_mr_create_primary(void *pd,
 	bmp_mem = RTE_PTR_ALIGN_CEIL(mr + 1, RTE_CACHE_LINE_SIZE);
 	mr->ms_bmp = rte_bitmap_init(ms_n, bmp_mem, bmp_size);
 	if (mr->ms_bmp == NULL) {
-		DEBUG("Unable to initialize bitmap for a new MR of"
+		DRV_LOG(DEBUG, "Unable to initialize bitmap for a new MR of"
 		      " address (%p).", (void *)addr);
 		rte_errno = EINVAL;
 		goto err_nolock;
@@ -688,9 +689,9 @@ mlx5_mr_create_primary(void *pd,
 	data_re = data;
 	if (len > msl->page_sz &&
 	    !rte_memseg_contig_walk(mr_find_contig_memsegs_cb, &data_re)) {
-		DEBUG("Unable to find virtually contiguous"
-		      " chunk for address (%p)."
-		      " rte_memseg_contig_walk() failed.", (void *)addr);
+		DRV_LOG(DEBUG,
+			"Unable to find virtually contiguous chunk for address "
+			"(%p). rte_memseg_contig_walk() failed.", (void *)addr);
 		rte_errno = ENXIO;
 		goto err_memlock;
 	}
@@ -718,7 +719,8 @@ mlx5_mr_create_primary(void *pd,
 		 * here again.
 		 */
 		mr_btree_insert(&share_cache->cache, entry);
-		DEBUG("Found MR for %p on final lookup, abort", (void *)addr);
+		DRV_LOG(DEBUG, "Found MR for %p on final lookup, abort",
+			(void *)addr);
 		rte_rwlock_write_unlock(&share_cache->rwlock);
 		rte_mcfg_mem_read_unlock();
 		/*
@@ -767,7 +769,7 @@ mlx5_mr_create_primary(void *pd,
 	 */
 	share_cache->reg_mr_cb(pd, (void *)data.start, len, &mr->pmd_mr);
 	if (mr->pmd_mr.obj == NULL) {
-		DEBUG("Fail to create an MR for address (%p)",
+		DRV_LOG(DEBUG, "Fail to create an MR for address (%p)",
 		      (void *)addr);
 		rte_errno = EINVAL;
 		goto err_mrlock;
@@ -775,7 +777,7 @@ mlx5_mr_create_primary(void *pd,
 	MLX5_ASSERT((uintptr_t)mr->pmd_mr.addr == data.start);
 	MLX5_ASSERT(mr->pmd_mr.len);
 	LIST_INSERT_HEAD(&share_cache->mr_list, mr, mr);
-	DEBUG("MR CREATED (%p) for %p:\n"
+	DRV_LOG(DEBUG, "MR CREATED (%p) for %p:\n"
 	      "  [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
 	      " lkey=0x%x base_idx=%u ms_n=%u, ms_bmp_n=%u",
 	      (void *)mr, (void *)addr, data.start, data.end,
@@ -1079,7 +1081,7 @@ mlx5_mr_dump_cache(struct mlx5_mr_share_cache *share_cache __rte_unused)
 	LIST_FOREACH(mr, &share_cache->mr_list, mr) {
 		unsigned int n;
 
-		DEBUG("MR[%u], LKey = 0x%x, ms_n = %u, ms_bmp_n = %u",
+		DRV_LOG(DEBUG, "MR[%u], LKey = 0x%x, ms_n = %u, ms_bmp_n = %u",
 		      mr_n++, rte_cpu_to_be_32(mr->pmd_mr.lkey),
 		      mr->ms_n, mr->ms_bmp_n);
 		if (mr->ms_n == 0)
@@ -1090,11 +1092,12 @@ mlx5_mr_dump_cache(struct mlx5_mr_share_cache *share_cache __rte_unused)
 			n = mr_find_next_chunk(mr, &ret, n);
 			if (!ret.end)
 				break;
-			DEBUG("  chunk[%u], [0x%" PRIxPTR ", 0x%" PRIxPTR ")",
-			      chunk_n++, ret.start, ret.end);
+			DRV_LOG(DEBUG,
+				"  chunk[%u], [0x%" PRIxPTR ", 0x%" PRIxPTR ")",
+				chunk_n++, ret.start, ret.end);
 		}
 	}
-	DEBUG("Dumping global cache %p", (void *)share_cache);
+	DRV_LOG(DEBUG, "Dumping global cache %p", (void *)share_cache);
 	mlx5_mr_btree_dump(&share_cache->cache);
 	rte_rwlock_read_unlock(&share_cache->rwlock);
 #endif
diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c
index 2b657686d1..a7f541a90c 100644
--- a/drivers/common/mlx5/mlx5_common_pci.c
+++ b/drivers/common/mlx5/mlx5_common_pci.c
@@ -245,14 +245,14 @@ drivers_probe(struct mlx5_pci_device *dev, struct rte_pci_driver *pci_drv,
 		already_loaded = dev->classes_loaded & driver->driver_class;
 		if (already_loaded &&
 		    !(driver->pci_driver.drv_flags & RTE_PCI_DRV_PROBE_AGAIN)) {
-			DRV_LOG(ERR, "Device %s is already probed\n",
+			DRV_LOG(ERR, "Device %s is already probed",
 				pci_dev->device.name);
 			ret = -EEXIST;
 			goto probe_err;
 		}
 		ret = driver->pci_driver.probe(pci_drv, pci_dev);
 		if (ret < 0) {
-			DRV_LOG(ERR, "Failed to load driver = %s.\n",
+			DRV_LOG(ERR, "Failed to load driver %s",
 				driver->pci_driver.driver.name);
 			goto probe_err;
 		}
diff --git a/drivers/net/mlx5/linux/mlx5_verbs.c b/drivers/net/mlx5/linux/mlx5_verbs.c
index ade241b806..c7d4b177a0 100644
--- a/drivers/net/mlx5/linux/mlx5_verbs.c
+++ b/drivers/net/mlx5/linux/mlx5_verbs.c
@@ -721,7 +721,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
 		return 0;
 	rxq = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*rxq), 0, SOCKET_ID_ANY);
 	if (!rxq) {
-		DEBUG("Port %u cannot allocate drop Rx queue memory.",
+		DRV_LOG(DEBUG, "Port %u cannot allocate drop Rx queue memory.",
 		      dev->data->port_id);
 		rte_errno = ENOMEM;
 		return -rte_errno;
@@ -729,7 +729,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
 	priv->drop_queue.rxq = rxq;
 	rxq->ibv_cq = mlx5_glue->create_cq(ctx, 1, NULL, NULL, 0);
 	if (!rxq->ibv_cq) {
-		DEBUG("Port %u cannot allocate CQ for drop queue.",
+		DRV_LOG(DEBUG, "Port %u cannot allocate CQ for drop queue.",
 		      dev->data->port_id);
 		rte_errno = errno;
 		goto error;
@@ -742,7 +742,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
 						    .cq = rxq->ibv_cq,
 					      });
 	if (!rxq->wq) {
-		DEBUG("Port %u cannot allocate WQ for drop queue.",
+		DRV_LOG(DEBUG, "Port %u cannot allocate WQ for drop queue.",
 		      dev->data->port_id);
 		rte_errno = errno;
 		goto error;
@@ -785,8 +785,9 @@ mlx5_ibv_drop_action_create(struct rte_eth_dev *dev)
 					.comp_mask = 0,
 				 });
 	if (!ind_tbl) {
-		DEBUG("Port %u cannot allocate indirection table for drop"
-		      " queue.", dev->data->port_id);
+		DRV_LOG(DEBUG, "Port %u"
+			" cannot allocate indirection table for drop queue.",
+			dev->data->port_id);
 		rte_errno = errno;
 		goto error;
 	}
@@ -806,7 +807,7 @@ mlx5_ibv_drop_action_create(struct rte_eth_dev *dev)
 			.pd = priv->sh->pd
 		 });
 	if (!hrxq->qp) {
-		DEBUG("Port %u cannot allocate QP for drop queue.",
+		DRV_LOG(DEBUG, "Port %u cannot allocate QP for drop queue.",
 		      dev->data->port_id);
 		rte_errno = errno;
 		goto error;
diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
index da4e91fc24..3255393ca2 100644
--- a/drivers/net/mlx5/mlx5_mr.c
+++ b/drivers/net/mlx5/mlx5_mr.c
@@ -57,7 +57,7 @@ mlx5_mr_mem_event_free_cb(struct mlx5_dev_ctx_shared *sh,
 	int i;
 	int rebuild = 0;
 
-	DEBUG("device %s free callback: addr=%p, len=%zu",
+	DRV_LOG(DEBUG, "device %s free callback: addr=%p, len=%zu",
 	      sh->ibdev_name, addr, len);
 	msl = rte_mem_virt2memseg_list(addr);
 	/* addr and len must be page-aligned. */
@@ -87,13 +87,13 @@ mlx5_mr_mem_event_free_cb(struct mlx5_dev_ctx_shared *sh,
 		pos = ms_idx - mr->ms_base_idx;
 		MLX5_ASSERT(rte_bitmap_get(mr->ms_bmp, pos));
 		MLX5_ASSERT(pos < mr->ms_bmp_n);
-		DEBUG("device %s MR(%p): clear bitmap[%u] for addr %p",
+		DRV_LOG(DEBUG, "device %s MR(%p): clear bitmap[%u] for addr %p",
 		      sh->ibdev_name, (void *)mr, pos, (void *)start);
 		rte_bitmap_clear(mr->ms_bmp, pos);
 		if (--mr->ms_n == 0) {
 			LIST_REMOVE(mr, mr);
 			LIST_INSERT_HEAD(&sh->share_cache.mr_free_list, mr, mr);
-			DEBUG("device %s remove MR(%p) from list",
+			DRV_LOG(DEBUG, "device %s remove MR(%p) from list",
 			      sh->ibdev_name, (void *)mr);
 		}
 		/*
@@ -114,7 +114,7 @@ mlx5_mr_mem_event_free_cb(struct mlx5_dev_ctx_shared *sh,
 		 * before the core sees the newly allocated memory.
 		 */
 		++sh->share_cache.dev_gen;
-		DEBUG("broadcasting local cache flush, gen=%d",
+		DRV_LOG(DEBUG, "broadcasting local cache flush, gen=%d",
 		      sh->share_cache.dev_gen);
 		rte_smp_wmb();
 	}
@@ -405,7 +405,7 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr,
 	}
 	LIST_REMOVE(mr, mr);
 	mlx5_mr_free(mr, sh->share_cache.dereg_mr_cb);
-	DEBUG("port %u remove MR(%p) from list", dev->data->port_id,
+	DRV_LOG(DEBUG, "port %u remove MR(%p) from list", dev->data->port_id,
 	      (void *)mr);
 	mlx5_mr_rebuild_cache(&sh->share_cache);
 	/*
@@ -418,7 +418,7 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr,
 	 * before the core sees the newly allocated memory.
 	 */
 	++sh->share_cache.dev_gen;
-	DEBUG("broadcasting local cache flush, gen=%d",
+	DRV_LOG(DEBUG, "broadcasting local cache flush, gen=%d",
 	      sh->share_cache.dev_gen);
 	rte_smp_wmb();
 	rte_rwlock_read_unlock(&sh->share_cache.rwlock);
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 8f9ee97f7a..9009eb8d18 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1972,7 +1972,8 @@ mlx5_ind_table_obj_setup(struct rte_eth_dev *dev,
 	for (j = 0; j < i; j++)
 		mlx5_rxq_release(dev, ind_tbl->queues[j]);
 	rte_errno = err;
-	DEBUG("Port %u cannot setup indirection table.", dev->data->port_id);
+	DRV_LOG(DEBUG, "Port %u cannot setup indirection table.",
+		dev->data->port_id);
 	return ret;
 }
 
@@ -2056,8 +2057,9 @@ mlx5_ind_table_obj_modify(struct rte_eth_dev *dev,
 		 * reference unsupported. Intended for standalone indirection
 		 * tables only.
 		 */
-		DEBUG("Port %u cannot modify indirection table (refcnt> 1).",
-		      dev->data->port_id);
+		DRV_LOG(DEBUG,
+			"Port %u cannot modify indirection table (refcnt> 1).",
+			dev->data->port_id);
 		rte_errno = EINVAL;
 		return -rte_errno;
 	}
@@ -2081,7 +2083,8 @@ mlx5_ind_table_obj_modify(struct rte_eth_dev *dev,
 	for (j = 0; j < i; j++)
 		mlx5_rxq_release(dev, ind_tbl->queues[j]);
 	rte_errno = err;
-	DEBUG("Port %u cannot setup indirection table.", dev->data->port_id);
+	DRV_LOG(DEBUG, "Port %u cannot setup indirection table.",
+		dev->data->port_id);
 	return ret;
 }
 
-- 
2.30.1


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

* [dpdk-dev] [PATCH 3/3] net/mlx5: reduce log level of alignment message
  2021-03-08 22:28 [dpdk-dev] [PATCH 0/3] adjust mlx debug logs Thomas Monjalon
  2021-03-08 22:28 ` [dpdk-dev] [PATCH 1/3] net/mlx4: enable debug logs dynamically Thomas Monjalon
  2021-03-08 22:28 ` [dpdk-dev] [PATCH 2/3] common/mlx5: " Thomas Monjalon
@ 2021-03-08 22:28 ` Thomas Monjalon
  2021-03-09  9:48 ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Thomas Monjalon
  3 siblings, 0 replies; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-08 22:28 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko

Having to force an alignment does not impact the user,
so it should not be a warning.
The log level is reduced from warning to debug.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mlx5/mlx5_utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index 07373bff02..a39b5edddc 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -40,8 +40,8 @@ mlx5_hlist_create(const char *name, uint32_t size, uint32_t entry_size,
 	/* Align to the next power of 2, 32bits integer is enough now. */
 	if (!rte_is_power_of_2(size)) {
 		act_size = rte_align32pow2(size);
-		DRV_LOG(WARNING, "Size 0x%" PRIX32 " is not power of 2, will "
-			"be aligned to 0x%" PRIX32 ".", size, act_size);
+		DRV_LOG(DEBUG, "Size 0x%" PRIX32 " is not power of 2, "
+			"will be aligned to 0x%" PRIX32 ".", size, act_size);
 	} else {
 		act_size = size;
 	}
-- 
2.30.1


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

* [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs
  2021-03-08 22:28 [dpdk-dev] [PATCH 0/3] adjust mlx debug logs Thomas Monjalon
                   ` (2 preceding siblings ...)
  2021-03-08 22:28 ` [dpdk-dev] [PATCH 3/3] net/mlx5: reduce log level of alignment message Thomas Monjalon
@ 2021-03-09  9:48 ` Thomas Monjalon
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically Thomas Monjalon
                     ` (4 more replies)
  3 siblings, 5 replies; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-09  9:48 UTC (permalink / raw)
  To: dev

Few adjustments of debug log usage in mlx4/mlx5.

v2:
    - fix a typo in an old log
    - separate commit for line feed fixes (and fix more)

Thomas Monjalon (4):
  net/mlx4: enable debug logs dynamically
  common/mlx5: enable debug logs dynamically
  common/mlx5: remove extra line feed in log messages
  net/mlx5: reduce log level of alignment message

 drivers/common/mlx5/mlx5_common.h     |  2 --
 drivers/common/mlx5/mlx5_common_mr.c  | 45 ++++++++++++++-------------
 drivers/common/mlx5/mlx5_common_pci.c |  4 +--
 drivers/common/mlx5/mlx5_devx_cmds.c  |  2 +-
 drivers/compress/mlx5/mlx5_compress.c |  2 +-
 drivers/net/mlx4/mlx4_utils.h         |  5 ++-
 drivers/net/mlx5/linux/mlx5_os.c      |  8 ++---
 drivers/net/mlx5/linux/mlx5_verbs.c   | 13 ++++----
 drivers/net/mlx5/mlx5_flow.c          |  2 +-
 drivers/net/mlx5/mlx5_mr.c            | 12 +++----
 drivers/net/mlx5/mlx5_rxq.c           | 11 ++++---
 drivers/net/mlx5/mlx5_utils.c         |  4 +--
 drivers/net/mlx5/windows/mlx5_os.c    |  2 +-
 drivers/vdpa/mlx5/mlx5_vdpa.c         |  2 +-
 14 files changed, 59 insertions(+), 55 deletions(-)

-- 
2.30.1


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

* [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically
  2021-03-09  9:48 ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Thomas Monjalon
@ 2021-03-09  9:48   ` Thomas Monjalon
  2021-03-11 20:03     ` Matan Azrad
  2021-03-17 17:29     ` Ferruh Yigit
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 2/4] common/mlx5: " Thomas Monjalon
                     ` (3 subsequent siblings)
  4 siblings, 2 replies; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-09  9:48 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Shahaf Shuler

The macro DEBUG was doing nothing if not compiled with
RTE_LIBRTE_MLX4_DEBUG.

As it is not used in the data path, it can be always enabled at
compilation time. Then it can be enabled at runtime with:
	--log-level pmd.net.mlx4:debug

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mlx4/mlx4_utils.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h
index b8769562ab..fca21fd79c 100644
--- a/drivers/net/mlx4/mlx4_utils.h
+++ b/drivers/net/mlx4/mlx4_utils.h
@@ -52,14 +52,13 @@ pmd_drv_log_basename(const char *s)
 			__LINE__, \
 			__func__, \
 			RTE_FMT_TAIL(__VA_ARGS__,)))
-#define DEBUG(...) PMD_DRV_LOG(DEBUG, __VA_ARGS__)
 #define MLX4_ASSERT(exp) RTE_VERIFY(exp)
 #define claim_zero(...) MLX4_ASSERT((__VA_ARGS__) == 0)
 
 #else /* RTE_LIBRTE_MLX4_DEBUG */
 
 /*
- * Like MLX4_ASSERT(), DEBUG() becomes a no-op and claim_zero() does not perform
+ * Like MLX4_ASSERT(), claim_zero() does not perform
  * any check when debugging is disabled.
  */
 
@@ -68,12 +67,12 @@ pmd_drv_log_basename(const char *s)
 		RTE_FMT(MLX4_DRIVER_NAME ": " \
 			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
 		RTE_FMT_TAIL(__VA_ARGS__,)))
-#define DEBUG(...) (void)0
 #define MLX4_ASSERT(exp) RTE_ASSERT(exp)
 #define claim_zero(...) (__VA_ARGS__)
 
 #endif /* RTE_LIBRTE_MLX4_DEBUG */
 
+#define DEBUG(...) PMD_DRV_LOG(DEBUG, __VA_ARGS__)
 #define INFO(...) PMD_DRV_LOG(INFO, __VA_ARGS__)
 #define WARN(...) PMD_DRV_LOG(WARNING, __VA_ARGS__)
 #define ERROR(...) PMD_DRV_LOG(ERR, __VA_ARGS__)
-- 
2.30.1


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

* [dpdk-dev] [PATCH v2 2/4] common/mlx5: enable debug logs dynamically
  2021-03-09  9:48 ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Thomas Monjalon
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically Thomas Monjalon
@ 2021-03-09  9:48   ` Thomas Monjalon
  2021-03-11 20:04     ` Matan Azrad
  2021-03-17 17:39     ` Ferruh Yigit
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 3/4] common/mlx5: remove extra line feed in log messages Thomas Monjalon
                     ` (2 subsequent siblings)
  4 siblings, 2 replies; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-09  9:48 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko

Most debug logs are using DRV_LOG(DEBUG,)
but some were using DEBUG().
The macro DEBUG is doing nothing if not compiled with
RTE_LIBRTE_MLX5_DEBUG.

As it is not used in the data path, the macro DEBUG
can be replaced with DRV_LOG.
Then all debug logs can be enabled at runtime with:
	--log-level pmd.net.mlx5:debug

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/common/mlx5/mlx5_common.h    |  2 --
 drivers/common/mlx5/mlx5_common_mr.c | 45 +++++++++++++++-------------
 drivers/net/mlx5/linux/mlx5_verbs.c  | 13 ++++----
 drivers/net/mlx5/mlx5_mr.c           | 12 ++++----
 drivers/net/mlx5/mlx5_rxq.c          | 11 ++++---
 5 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index 3855582d0d..5028a05b49 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -92,14 +92,12 @@ pmd_drv_log_basename(const char *s)
 /* claim_zero() does not perform any check when debugging is disabled. */
 #ifdef RTE_LIBRTE_MLX5_DEBUG
 
-#define DEBUG(...) DRV_LOG(DEBUG, __VA_ARGS__)
 #define MLX5_ASSERT(exp) RTE_VERIFY(exp)
 #define claim_zero(...) MLX5_ASSERT((__VA_ARGS__) == 0)
 #define claim_nonzero(...) MLX5_ASSERT((__VA_ARGS__) != 0)
 
 #else /* RTE_LIBRTE_MLX5_DEBUG */
 
-#define DEBUG(...) (void)0
 #define MLX5_ASSERT(exp) RTE_ASSERT(exp)
 #define claim_zero(...) (__VA_ARGS__)
 #define claim_nonzero(...) (__VA_ARGS__)
diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c
index 7c25541dc4..e1ed0caf3a 100644
--- a/drivers/common/mlx5/mlx5_common_mr.c
+++ b/drivers/common/mlx5/mlx5_common_mr.c
@@ -187,8 +187,9 @@ mlx5_mr_btree_init(struct mlx5_mr_btree *bt, int n, int socket)
 				0, socket);
 	if (bt->table == NULL) {
 		rte_errno = ENOMEM;
-		DEBUG("failed to allocate memory for btree cache on socket %d",
-		      socket);
+		DRV_LOG(DEBUG,
+			"failed to allocate memory for btree cache on socket "
+			"%d", socket);
 		return -rte_errno;
 	}
 	bt->size = n;
@@ -196,7 +197,7 @@ mlx5_mr_btree_init(struct mlx5_mr_btree *bt, int n, int socket)
 	(*bt->table)[bt->len++] = (struct mr_cache_entry) {
 		.lkey = UINT32_MAX,
 	};
-	DEBUG("initialized B-tree %p with table %p",
+	DRV_LOG(DEBUG, "initialized B-tree %p with table %p",
 	      (void *)bt, (void *)bt->table);
 	return 0;
 }
@@ -212,7 +213,7 @@ mlx5_mr_btree_free(struct mlx5_mr_btree *bt)
 {
 	if (bt == NULL)
 		return;
-	DEBUG("freeing B-tree %p with table %p",
+	DRV_LOG(DEBUG, "freeing B-tree %p with table %p",
 	      (void *)bt, (void *)bt->table);
 	mlx5_free(bt->table);
 	memset(bt, 0, sizeof(*bt));
@@ -237,7 +238,7 @@ mlx5_mr_btree_dump(struct mlx5_mr_btree *bt __rte_unused)
 	for (idx = 0; idx < bt->len; ++idx) {
 		struct mr_cache_entry *entry = &lkp_tbl[idx];
 
-		DEBUG("B-tree(%p)[%u],"
+		DRV_LOG(DEBUG, "B-tree(%p)[%u],"
 		      " [0x%" PRIxPTR ", 0x%" PRIxPTR ") lkey=0x%x",
 		      (void *)bt, idx, entry->start, entry->end, entry->lkey);
 	}
@@ -543,11 +544,11 @@ mlx5_mr_create_secondary(void *pd __rte_unused,
 {
 	int ret;
 
-	DEBUG("port %u requesting MR creation for address (%p)",
+	DRV_LOG(DEBUG, "port %u requesting MR creation for address (%p)",
 	      mp_id->port_id, (void *)addr);
 	ret = mlx5_mp_req_mr_create(mp_id, addr);
 	if (ret) {
-		DEBUG("Fail to request MR creation for address (%p)",
+		DRV_LOG(DEBUG, "Fail to request MR creation for address (%p)",
 		      (void *)addr);
 		return UINT32_MAX;
 	}
@@ -557,7 +558,7 @@ mlx5_mr_create_secondary(void *pd __rte_unused,
 	/* Lookup can't fail. */
 	MLX5_ASSERT(entry->lkey != UINT32_MAX);
 	rte_rwlock_read_unlock(&share_cache->rwlock);
-	DEBUG("MR CREATED by primary process for %p:\n"
+	DRV_LOG(DEBUG, "MR CREATED by primary process for %p:\n"
 	      "  [0x%" PRIxPTR ", 0x%" PRIxPTR "), lkey=0x%x",
 	      (void *)addr, entry->start, entry->end, entry->lkey);
 	return entry->lkey;
@@ -647,7 +648,7 @@ mlx5_mr_create_primary(void *pd,
 	MLX5_ASSERT(msl->page_sz == ms->hugepage_sz);
 	/* Number of memsegs in the range. */
 	ms_n = len / msl->page_sz;
-	DEBUG("Extending %p to [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
+	DRV_LOG(DEBUG, "Extending %p to [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
 	      " page_sz=0x%" PRIx64 ", ms_n=%u",
 	      (void *)addr, data.start, data.end, msl->page_sz, ms_n);
 	/* Size of memory for bitmap. */
@@ -656,7 +657,7 @@ mlx5_mr_create_primary(void *pd,
 			 RTE_ALIGN_CEIL(sizeof(*mr), RTE_CACHE_LINE_SIZE) +
 			 bmp_size, RTE_CACHE_LINE_SIZE, msl->socket_id);
 	if (mr == NULL) {
-		DEBUG("Unable to allocate memory for a new MR of"
+		DRV_LOG(DEBUG, "Unable to allocate memory for a new MR of"
 		      " address (%p).", (void *)addr);
 		rte_errno = ENOMEM;
 		goto err_nolock;
@@ -671,7 +672,7 @@ mlx5_mr_create_primary(void *pd,
 	bmp_mem = RTE_PTR_ALIGN_CEIL(mr + 1, RTE_CACHE_LINE_SIZE);
 	mr->ms_bmp = rte_bitmap_init(ms_n, bmp_mem, bmp_size);
 	if (mr->ms_bmp == NULL) {
-		DEBUG("Unable to initialize bitmap for a new MR of"
+		DRV_LOG(DEBUG, "Unable to initialize bitmap for a new MR of"
 		      " address (%p).", (void *)addr);
 		rte_errno = EINVAL;
 		goto err_nolock;
@@ -688,9 +689,9 @@ mlx5_mr_create_primary(void *pd,
 	data_re = data;
 	if (len > msl->page_sz &&
 	    !rte_memseg_contig_walk(mr_find_contig_memsegs_cb, &data_re)) {
-		DEBUG("Unable to find virtually contiguous"
-		      " chunk for address (%p)."
-		      " rte_memseg_contig_walk() failed.", (void *)addr);
+		DRV_LOG(DEBUG,
+			"Unable to find virtually contiguous chunk for address "
+			"(%p). rte_memseg_contig_walk() failed.", (void *)addr);
 		rte_errno = ENXIO;
 		goto err_memlock;
 	}
@@ -718,7 +719,8 @@ mlx5_mr_create_primary(void *pd,
 		 * here again.
 		 */
 		mr_btree_insert(&share_cache->cache, entry);
-		DEBUG("Found MR for %p on final lookup, abort", (void *)addr);
+		DRV_LOG(DEBUG, "Found MR for %p on final lookup, abort",
+			(void *)addr);
 		rte_rwlock_write_unlock(&share_cache->rwlock);
 		rte_mcfg_mem_read_unlock();
 		/*
@@ -767,7 +769,7 @@ mlx5_mr_create_primary(void *pd,
 	 */
 	share_cache->reg_mr_cb(pd, (void *)data.start, len, &mr->pmd_mr);
 	if (mr->pmd_mr.obj == NULL) {
-		DEBUG("Fail to create an MR for address (%p)",
+		DRV_LOG(DEBUG, "Fail to create an MR for address (%p)",
 		      (void *)addr);
 		rte_errno = EINVAL;
 		goto err_mrlock;
@@ -775,7 +777,7 @@ mlx5_mr_create_primary(void *pd,
 	MLX5_ASSERT((uintptr_t)mr->pmd_mr.addr == data.start);
 	MLX5_ASSERT(mr->pmd_mr.len);
 	LIST_INSERT_HEAD(&share_cache->mr_list, mr, mr);
-	DEBUG("MR CREATED (%p) for %p:\n"
+	DRV_LOG(DEBUG, "MR CREATED (%p) for %p:\n"
 	      "  [0x%" PRIxPTR ", 0x%" PRIxPTR "),"
 	      " lkey=0x%x base_idx=%u ms_n=%u, ms_bmp_n=%u",
 	      (void *)mr, (void *)addr, data.start, data.end,
@@ -1079,7 +1081,7 @@ mlx5_mr_dump_cache(struct mlx5_mr_share_cache *share_cache __rte_unused)
 	LIST_FOREACH(mr, &share_cache->mr_list, mr) {
 		unsigned int n;
 
-		DEBUG("MR[%u], LKey = 0x%x, ms_n = %u, ms_bmp_n = %u",
+		DRV_LOG(DEBUG, "MR[%u], LKey = 0x%x, ms_n = %u, ms_bmp_n = %u",
 		      mr_n++, rte_cpu_to_be_32(mr->pmd_mr.lkey),
 		      mr->ms_n, mr->ms_bmp_n);
 		if (mr->ms_n == 0)
@@ -1090,11 +1092,12 @@ mlx5_mr_dump_cache(struct mlx5_mr_share_cache *share_cache __rte_unused)
 			n = mr_find_next_chunk(mr, &ret, n);
 			if (!ret.end)
 				break;
-			DEBUG("  chunk[%u], [0x%" PRIxPTR ", 0x%" PRIxPTR ")",
-			      chunk_n++, ret.start, ret.end);
+			DRV_LOG(DEBUG,
+				"  chunk[%u], [0x%" PRIxPTR ", 0x%" PRIxPTR ")",
+				chunk_n++, ret.start, ret.end);
 		}
 	}
-	DEBUG("Dumping global cache %p", (void *)share_cache);
+	DRV_LOG(DEBUG, "Dumping global cache %p", (void *)share_cache);
 	mlx5_mr_btree_dump(&share_cache->cache);
 	rte_rwlock_read_unlock(&share_cache->rwlock);
 #endif
diff --git a/drivers/net/mlx5/linux/mlx5_verbs.c b/drivers/net/mlx5/linux/mlx5_verbs.c
index ade241b806..c7d4b177a0 100644
--- a/drivers/net/mlx5/linux/mlx5_verbs.c
+++ b/drivers/net/mlx5/linux/mlx5_verbs.c
@@ -721,7 +721,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
 		return 0;
 	rxq = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*rxq), 0, SOCKET_ID_ANY);
 	if (!rxq) {
-		DEBUG("Port %u cannot allocate drop Rx queue memory.",
+		DRV_LOG(DEBUG, "Port %u cannot allocate drop Rx queue memory.",
 		      dev->data->port_id);
 		rte_errno = ENOMEM;
 		return -rte_errno;
@@ -729,7 +729,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
 	priv->drop_queue.rxq = rxq;
 	rxq->ibv_cq = mlx5_glue->create_cq(ctx, 1, NULL, NULL, 0);
 	if (!rxq->ibv_cq) {
-		DEBUG("Port %u cannot allocate CQ for drop queue.",
+		DRV_LOG(DEBUG, "Port %u cannot allocate CQ for drop queue.",
 		      dev->data->port_id);
 		rte_errno = errno;
 		goto error;
@@ -742,7 +742,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
 						    .cq = rxq->ibv_cq,
 					      });
 	if (!rxq->wq) {
-		DEBUG("Port %u cannot allocate WQ for drop queue.",
+		DRV_LOG(DEBUG, "Port %u cannot allocate WQ for drop queue.",
 		      dev->data->port_id);
 		rte_errno = errno;
 		goto error;
@@ -785,8 +785,9 @@ mlx5_ibv_drop_action_create(struct rte_eth_dev *dev)
 					.comp_mask = 0,
 				 });
 	if (!ind_tbl) {
-		DEBUG("Port %u cannot allocate indirection table for drop"
-		      " queue.", dev->data->port_id);
+		DRV_LOG(DEBUG, "Port %u"
+			" cannot allocate indirection table for drop queue.",
+			dev->data->port_id);
 		rte_errno = errno;
 		goto error;
 	}
@@ -806,7 +807,7 @@ mlx5_ibv_drop_action_create(struct rte_eth_dev *dev)
 			.pd = priv->sh->pd
 		 });
 	if (!hrxq->qp) {
-		DEBUG("Port %u cannot allocate QP for drop queue.",
+		DRV_LOG(DEBUG, "Port %u cannot allocate QP for drop queue.",
 		      dev->data->port_id);
 		rte_errno = errno;
 		goto error;
diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
index da4e91fc24..3255393ca2 100644
--- a/drivers/net/mlx5/mlx5_mr.c
+++ b/drivers/net/mlx5/mlx5_mr.c
@@ -57,7 +57,7 @@ mlx5_mr_mem_event_free_cb(struct mlx5_dev_ctx_shared *sh,
 	int i;
 	int rebuild = 0;
 
-	DEBUG("device %s free callback: addr=%p, len=%zu",
+	DRV_LOG(DEBUG, "device %s free callback: addr=%p, len=%zu",
 	      sh->ibdev_name, addr, len);
 	msl = rte_mem_virt2memseg_list(addr);
 	/* addr and len must be page-aligned. */
@@ -87,13 +87,13 @@ mlx5_mr_mem_event_free_cb(struct mlx5_dev_ctx_shared *sh,
 		pos = ms_idx - mr->ms_base_idx;
 		MLX5_ASSERT(rte_bitmap_get(mr->ms_bmp, pos));
 		MLX5_ASSERT(pos < mr->ms_bmp_n);
-		DEBUG("device %s MR(%p): clear bitmap[%u] for addr %p",
+		DRV_LOG(DEBUG, "device %s MR(%p): clear bitmap[%u] for addr %p",
 		      sh->ibdev_name, (void *)mr, pos, (void *)start);
 		rte_bitmap_clear(mr->ms_bmp, pos);
 		if (--mr->ms_n == 0) {
 			LIST_REMOVE(mr, mr);
 			LIST_INSERT_HEAD(&sh->share_cache.mr_free_list, mr, mr);
-			DEBUG("device %s remove MR(%p) from list",
+			DRV_LOG(DEBUG, "device %s remove MR(%p) from list",
 			      sh->ibdev_name, (void *)mr);
 		}
 		/*
@@ -114,7 +114,7 @@ mlx5_mr_mem_event_free_cb(struct mlx5_dev_ctx_shared *sh,
 		 * before the core sees the newly allocated memory.
 		 */
 		++sh->share_cache.dev_gen;
-		DEBUG("broadcasting local cache flush, gen=%d",
+		DRV_LOG(DEBUG, "broadcasting local cache flush, gen=%d",
 		      sh->share_cache.dev_gen);
 		rte_smp_wmb();
 	}
@@ -405,7 +405,7 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr,
 	}
 	LIST_REMOVE(mr, mr);
 	mlx5_mr_free(mr, sh->share_cache.dereg_mr_cb);
-	DEBUG("port %u remove MR(%p) from list", dev->data->port_id,
+	DRV_LOG(DEBUG, "port %u remove MR(%p) from list", dev->data->port_id,
 	      (void *)mr);
 	mlx5_mr_rebuild_cache(&sh->share_cache);
 	/*
@@ -418,7 +418,7 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr,
 	 * before the core sees the newly allocated memory.
 	 */
 	++sh->share_cache.dev_gen;
-	DEBUG("broadcasting local cache flush, gen=%d",
+	DRV_LOG(DEBUG, "broadcasting local cache flush, gen=%d",
 	      sh->share_cache.dev_gen);
 	rte_smp_wmb();
 	rte_rwlock_read_unlock(&sh->share_cache.rwlock);
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 8f9ee97f7a..9009eb8d18 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1972,7 +1972,8 @@ mlx5_ind_table_obj_setup(struct rte_eth_dev *dev,
 	for (j = 0; j < i; j++)
 		mlx5_rxq_release(dev, ind_tbl->queues[j]);
 	rte_errno = err;
-	DEBUG("Port %u cannot setup indirection table.", dev->data->port_id);
+	DRV_LOG(DEBUG, "Port %u cannot setup indirection table.",
+		dev->data->port_id);
 	return ret;
 }
 
@@ -2056,8 +2057,9 @@ mlx5_ind_table_obj_modify(struct rte_eth_dev *dev,
 		 * reference unsupported. Intended for standalone indirection
 		 * tables only.
 		 */
-		DEBUG("Port %u cannot modify indirection table (refcnt> 1).",
-		      dev->data->port_id);
+		DRV_LOG(DEBUG,
+			"Port %u cannot modify indirection table (refcnt> 1).",
+			dev->data->port_id);
 		rte_errno = EINVAL;
 		return -rte_errno;
 	}
@@ -2081,7 +2083,8 @@ mlx5_ind_table_obj_modify(struct rte_eth_dev *dev,
 	for (j = 0; j < i; j++)
 		mlx5_rxq_release(dev, ind_tbl->queues[j]);
 	rte_errno = err;
-	DEBUG("Port %u cannot setup indirection table.", dev->data->port_id);
+	DRV_LOG(DEBUG, "Port %u cannot setup indirection table.",
+		dev->data->port_id);
 	return ret;
 }
 
-- 
2.30.1


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

* [dpdk-dev] [PATCH v2 3/4] common/mlx5: remove extra line feed in log messages
  2021-03-09  9:48 ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Thomas Monjalon
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically Thomas Monjalon
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 2/4] common/mlx5: " Thomas Monjalon
@ 2021-03-09  9:48   ` Thomas Monjalon
  2021-03-11 20:05     ` Matan Azrad
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 4/4] net/mlx5: reduce log level of alignment message Thomas Monjalon
  2021-03-16  9:04   ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Raslan Darawsheh
  4 siblings, 1 reply; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-09  9:48 UTC (permalink / raw)
  To: dev
  Cc: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko, Fiona Trahe,
	Ashish Gupta

The macro DRV_LOG already includes a terminating line feed character
defined in PMD_DRV_LOG_.
The extra line feeds added in some messages are removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/common/mlx5/mlx5_common_pci.c | 4 ++--
 drivers/common/mlx5/mlx5_devx_cmds.c  | 2 +-
 drivers/compress/mlx5/mlx5_compress.c | 2 +-
 drivers/net/mlx5/linux/mlx5_os.c      | 8 ++++----
 drivers/net/mlx5/mlx5_flow.c          | 2 +-
 drivers/net/mlx5/windows/mlx5_os.c    | 2 +-
 drivers/vdpa/mlx5/mlx5_vdpa.c         | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c
index 2b657686d1..a7f541a90c 100644
--- a/drivers/common/mlx5/mlx5_common_pci.c
+++ b/drivers/common/mlx5/mlx5_common_pci.c
@@ -245,14 +245,14 @@ drivers_probe(struct mlx5_pci_device *dev, struct rte_pci_driver *pci_drv,
 		already_loaded = dev->classes_loaded & driver->driver_class;
 		if (already_loaded &&
 		    !(driver->pci_driver.drv_flags & RTE_PCI_DRV_PROBE_AGAIN)) {
-			DRV_LOG(ERR, "Device %s is already probed\n",
+			DRV_LOG(ERR, "Device %s is already probed",
 				pci_dev->device.name);
 			ret = -EEXIST;
 			goto probe_err;
 		}
 		ret = driver->pci_driver.probe(pci_drv, pci_dev);
 		if (ret < 0) {
-			DRV_LOG(ERR, "Failed to load driver = %s.\n",
+			DRV_LOG(ERR, "Failed to load driver %s",
 				driver->pci_driver.driver.name);
 			goto probe_err;
 		}
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 0060c37fc0..8df14f5b7d 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -275,7 +275,7 @@ mlx5_devx_cmd_mkey_create(void *ctx,
 	mkey->obj = mlx5_glue->devx_obj_create(ctx, in, in_size_dw * 4, out,
 					       sizeof(out));
 	if (!mkey->obj) {
-		DRV_LOG(ERR, "Can't create %sdirect mkey - error %d\n",
+		DRV_LOG(ERR, "Can't create %sdirect mkey - error %d",
 			klm_num ? "an in" : "a ", errno);
 		rte_errno = errno;
 		mlx5_free(mkey);
diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
index 46255ab5e0..85238accff 100644
--- a/drivers/compress/mlx5/mlx5_compress.c
+++ b/drivers/compress/mlx5/mlx5_compress.c
@@ -257,7 +257,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 		DRV_LOG(ERR, "Can't change SQ state to ready.");
 		goto err;
 	}
-	DRV_LOG(INFO, "QP %u: SQN=0x%X CQN=0x%X entries num = %u\n",
+	DRV_LOG(INFO, "QP %u: SQN=0x%X CQN=0x%X entries num = %u",
 		(uint32_t)qp_id, qp->sq.sq->id, qp->cq.cq->id, qp->entries_n);
 	return 0;
 err:
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 81eb2e4b05..b03cafda6a 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1233,14 +1233,14 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 		if (config->hca_attr.log_max_ft_sampler_num > 0  &&
 		    config->dv_flow_en) {
 			priv->sampler_en = 1;
-			DRV_LOG(DEBUG, "The Sampler enabled!\n");
+			DRV_LOG(DEBUG, "Sampler enabled!");
 		} else {
 			priv->sampler_en = 0;
 			if (!config->hca_attr.log_max_ft_sampler_num)
-				DRV_LOG(WARNING, "No available register for"
-						" Sampler.");
+				DRV_LOG(WARNING,
+					"No available register for sampler.");
 			else
-				DRV_LOG(DEBUG, "DV flow is not supported!\n");
+				DRV_LOG(DEBUG, "DV flow is not supported!");
 		}
 #endif
 	}
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index ab5be3dacc..773f3e63f4 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -7924,7 +7924,7 @@ void mlx5_release_tunnel_hub(struct mlx5_dev_ctx_shared *sh, uint16_t port_id)
 	if (!thub)
 		return;
 	if (!LIST_EMPTY(&thub->tunnels))
-		DRV_LOG(WARNING, "port %u tunnels present\n", port_id);
+		DRV_LOG(WARNING, "port %u tunnels present", port_id);
 	mlx5_hlist_destroy(thub->groups);
 	mlx5_free(thub);
 }
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index e37cc65c17..e7db85b757 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -165,7 +165,7 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
 	if (!sh->flow_tbls)
 		err = mlx5_alloc_table_hash_list(priv);
 	else
-		DRV_LOG(DEBUG, "sh->flow_tbls[%p] already created, reuse\n",
+		DRV_LOG(DEBUG, "sh->flow_tbls[%p] already created, reuse",
 			(void *)sh->flow_tbls);
 	return err;
 }
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index 4c2d886bd7..5755a68ec4 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -751,7 +751,7 @@ mlx5_vdpa_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	priv->pci_dev = pci_dev;
 	priv->var = mlx5_glue->dv_alloc_var(ctx, 0);
 	if (!priv->var) {
-		DRV_LOG(ERR, "Failed to allocate VAR %u.\n", errno);
+		DRV_LOG(ERR, "Failed to allocate VAR %u.", errno);
 		goto error;
 	}
 	priv->vdev = rte_vdpa_register_device(&pci_dev->device,
-- 
2.30.1


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

* [dpdk-dev] [PATCH v2 4/4] net/mlx5: reduce log level of alignment message
  2021-03-09  9:48 ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Thomas Monjalon
                     ` (2 preceding siblings ...)
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 3/4] common/mlx5: remove extra line feed in log messages Thomas Monjalon
@ 2021-03-09  9:48   ` Thomas Monjalon
  2021-03-11 20:07     ` Matan Azrad
  2021-03-16  9:04   ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Raslan Darawsheh
  4 siblings, 1 reply; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-09  9:48 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko

Having to force an alignment does not impact the user,
so it should not be a warning.
The log level is reduced from warning to debug.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mlx5/mlx5_utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index 07373bff02..a39b5edddc 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -40,8 +40,8 @@ mlx5_hlist_create(const char *name, uint32_t size, uint32_t entry_size,
 	/* Align to the next power of 2, 32bits integer is enough now. */
 	if (!rte_is_power_of_2(size)) {
 		act_size = rte_align32pow2(size);
-		DRV_LOG(WARNING, "Size 0x%" PRIX32 " is not power of 2, will "
-			"be aligned to 0x%" PRIX32 ".", size, act_size);
+		DRV_LOG(DEBUG, "Size 0x%" PRIX32 " is not power of 2, "
+			"will be aligned to 0x%" PRIX32 ".", size, act_size);
 	} else {
 		act_size = size;
 	}
-- 
2.30.1


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

* Re: [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically Thomas Monjalon
@ 2021-03-11 20:03     ` Matan Azrad
  2021-03-17 17:29     ` Ferruh Yigit
  1 sibling, 0 replies; 19+ messages in thread
From: Matan Azrad @ 2021-03-11 20:03 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, dev; +Cc: Shahaf Shuler



From: Thomas Monjalon
> The macro DEBUG was doing nothing if not compiled with
> RTE_LIBRTE_MLX4_DEBUG.
> 
> As it is not used in the data path, it can be always enabled at compilation time.
> Then it can be enabled at runtime with:
>         --log-level pmd.net.mlx4:debug
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>

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

* Re: [dpdk-dev] [PATCH v2 2/4] common/mlx5: enable debug logs dynamically
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 2/4] common/mlx5: " Thomas Monjalon
@ 2021-03-11 20:04     ` Matan Azrad
  2021-03-17 17:39     ` Ferruh Yigit
  1 sibling, 0 replies; 19+ messages in thread
From: Matan Azrad @ 2021-03-11 20:04 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, dev; +Cc: Shahaf Shuler, Slava Ovsiienko



From: Thomas Monjalon
> Most debug logs are using DRV_LOG(DEBUG,) but some were using DEBUG().
> The macro DEBUG is doing nothing if not compiled with
> RTE_LIBRTE_MLX5_DEBUG.
> 
> As it is not used in the data path, the macro DEBUG can be replaced with
> DRV_LOG.
> Then all debug logs can be enabled at runtime with:
>         --log-level pmd.net.mlx5:debug
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>

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

* Re: [dpdk-dev] [PATCH v2 3/4] common/mlx5: remove extra line feed in log messages
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 3/4] common/mlx5: remove extra line feed in log messages Thomas Monjalon
@ 2021-03-11 20:05     ` Matan Azrad
  0 siblings, 0 replies; 19+ messages in thread
From: Matan Azrad @ 2021-03-11 20:05 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, dev
  Cc: Shahaf Shuler, Slava Ovsiienko, Fiona Trahe, Ashish Gupta



From: Thomas Monjalon
> The macro DRV_LOG already includes a terminating line feed character
> defined in PMD_DRV_LOG_.
> The extra line feeds added in some messages are removed.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>

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

* Re: [dpdk-dev] [PATCH v2 4/4] net/mlx5: reduce log level of alignment message
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 4/4] net/mlx5: reduce log level of alignment message Thomas Monjalon
@ 2021-03-11 20:07     ` Matan Azrad
  0 siblings, 0 replies; 19+ messages in thread
From: Matan Azrad @ 2021-03-11 20:07 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, dev; +Cc: Shahaf Shuler, Slava Ovsiienko



From: Thomas Monjalon
> Having to force an alignment does not impact the user, so it should not be a
> warning.
> The log level is reduced from warning to debug.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>

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

* Re: [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs
  2021-03-09  9:48 ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Thomas Monjalon
                     ` (3 preceding siblings ...)
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 4/4] net/mlx5: reduce log level of alignment message Thomas Monjalon
@ 2021-03-16  9:04   ` Raslan Darawsheh
  4 siblings, 0 replies; 19+ messages in thread
From: Raslan Darawsheh @ 2021-03-16  9:04 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, dev

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Tuesday, March 9, 2021 11:49 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs
> 
> Few adjustments of debug log usage in mlx4/mlx5.
> 
> v2:
>     - fix a typo in an old log
>     - separate commit for line feed fixes (and fix more)
> 
> Thomas Monjalon (4):
>   net/mlx4: enable debug logs dynamically
>   common/mlx5: enable debug logs dynamically
>   common/mlx5: remove extra line feed in log messages
>   net/mlx5: reduce log level of alignment message
> 
>  drivers/common/mlx5/mlx5_common.h     |  2 --
>  drivers/common/mlx5/mlx5_common_mr.c  | 45 ++++++++++++++----------
> ---
>  drivers/common/mlx5/mlx5_common_pci.c |  4 +--
>  drivers/common/mlx5/mlx5_devx_cmds.c  |  2 +-
>  drivers/compress/mlx5/mlx5_compress.c |  2 +-
>  drivers/net/mlx4/mlx4_utils.h         |  5 ++-
>  drivers/net/mlx5/linux/mlx5_os.c      |  8 ++---
>  drivers/net/mlx5/linux/mlx5_verbs.c   | 13 ++++----
>  drivers/net/mlx5/mlx5_flow.c          |  2 +-
>  drivers/net/mlx5/mlx5_mr.c            | 12 +++----
>  drivers/net/mlx5/mlx5_rxq.c           | 11 ++++---
>  drivers/net/mlx5/mlx5_utils.c         |  4 +--
>  drivers/net/mlx5/windows/mlx5_os.c    |  2 +-
>  drivers/vdpa/mlx5/mlx5_vdpa.c         |  2 +-
>  14 files changed, 59 insertions(+), 55 deletions(-)
> 
> --
> 2.30.1

Series applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

* Re: [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically Thomas Monjalon
  2021-03-11 20:03     ` Matan Azrad
@ 2021-03-17 17:29     ` Ferruh Yigit
  2021-03-17 17:47       ` Thomas Monjalon
  1 sibling, 1 reply; 19+ messages in thread
From: Ferruh Yigit @ 2021-03-17 17:29 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: Matan Azrad, Shahaf Shuler

On 3/9/2021 9:48 AM, Thomas Monjalon wrote:
> The macro DEBUG was doing nothing if not compiled with
> RTE_LIBRTE_MLX4_DEBUG.
> 
> As it is not used in the data path, it can be always enabled at
> compilation time. Then it can be enabled at runtime with:
> 	--log-level pmd.net.mlx4:debug
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

+1 to change, but why 'RTE_LIBRTE_MLX4_DEBUG' exists at first place?

It seems is is used both for data and control path, can you extend the patch for:
1- Remove #ifdef from control path
2- Replace with 'RTE_ETHDEV_DEBUG_RX' & 'RTE_ETHDEV_DEBUG_TX' for data path,
    please see: https://patches.dpdk.org/project/dpdk/list/?series=15738
3- Remove 'RTE_LIBRTE_MLX4_DEBUG' completely, if not removed document it in the
    driver documentation as supported config file

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

* Re: [dpdk-dev] [PATCH v2 2/4] common/mlx5: enable debug logs dynamically
  2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 2/4] common/mlx5: " Thomas Monjalon
  2021-03-11 20:04     ` Matan Azrad
@ 2021-03-17 17:39     ` Ferruh Yigit
  2021-03-17 17:48       ` Thomas Monjalon
  1 sibling, 1 reply; 19+ messages in thread
From: Ferruh Yigit @ 2021-03-17 17:39 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko

On 3/9/2021 9:48 AM, Thomas Monjalon wrote:
> Most debug logs are using DRV_LOG(DEBUG,)
> but some were using DEBUG().
> The macro DEBUG is doing nothing if not compiled with
> RTE_LIBRTE_MLX5_DEBUG.
> 
> As it is not used in the data path, the macro DEBUG
> can be replaced with DRV_LOG.
> Then all debug logs can be enabled at runtime with:
> 	--log-level pmd.net.mlx5:debug
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Similar comment for the mlx4 one, copying here:

Why 'RTE_LIBRTE_MLX5_DEBUG' exists at first place?

It seems is is used both for data and control path, can you extend the patch for:
1- Remove #ifdef from control path
2- Replace with 'RTE_ETHDEV_DEBUG_RX' & 'RTE_ETHDEV_DEBUG_TX' for data path,
    please see: https://patches.dpdk.org/project/dpdk/list/?series=15738
3- Remove 'RTE_LIBRTE_MLX5_DEBUG' completely, if not removed document it in the
    driver documentation as supported config file


Both for 'mlx4' and 'mlx5', I will continue with existing patch, but can it be 
possible to make additional patches to address above issues?

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

* Re: [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically
  2021-03-17 17:29     ` Ferruh Yigit
@ 2021-03-17 17:47       ` Thomas Monjalon
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-17 17:47 UTC (permalink / raw)
  To: Ferruh Yigit, Matan Azrad; +Cc: dev, Shahaf Shuler

17/03/2021 18:29, Ferruh Yigit:
> On 3/9/2021 9:48 AM, Thomas Monjalon wrote:
> > The macro DEBUG was doing nothing if not compiled with
> > RTE_LIBRTE_MLX4_DEBUG.
> > 
> > As it is not used in the data path, it can be always enabled at
> > compilation time. Then it can be enabled at runtime with:
> > 	--log-level pmd.net.mlx4:debug
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> +1 to change, but why 'RTE_LIBRTE_MLX4_DEBUG' exists at first place?
> 
> It seems is is used both for data and control path, can you extend the patch for:
> 1- Remove #ifdef from control path
> 2- Replace with 'RTE_ETHDEV_DEBUG_RX' & 'RTE_ETHDEV_DEBUG_TX' for data path,
>     please see: https://patches.dpdk.org/project/dpdk/list/?series=15738
> 3- Remove 'RTE_LIBRTE_MLX4_DEBUG' completely, if not removed document it in the
>     driver documentation as supported config file

To me using ETHDEV config macro in PMDs is new,
and I think it is out of scope for this patch.
But yes I agree it would be a nice improvement.
Matan, please could you do this change during next month?



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

* Re: [dpdk-dev] [PATCH v2 2/4] common/mlx5: enable debug logs dynamically
  2021-03-17 17:39     ` Ferruh Yigit
@ 2021-03-17 17:48       ` Thomas Monjalon
  2021-03-18 10:13         ` Matan Azrad
  0 siblings, 1 reply; 19+ messages in thread
From: Thomas Monjalon @ 2021-03-17 17:48 UTC (permalink / raw)
  To: dev, Ferruh Yigit, Matan Azrad, Viacheslav Ovsiienko; +Cc: Shahaf Shuler

17/03/2021 18:39, Ferruh Yigit:
> On 3/9/2021 9:48 AM, Thomas Monjalon wrote:
> > Most debug logs are using DRV_LOG(DEBUG,)
> > but some were using DEBUG().
> > The macro DEBUG is doing nothing if not compiled with
> > RTE_LIBRTE_MLX5_DEBUG.
> > 
> > As it is not used in the data path, the macro DEBUG
> > can be replaced with DRV_LOG.
> > Then all debug logs can be enabled at runtime with:
> > 	--log-level pmd.net.mlx5:debug
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Similar comment for the mlx4 one, copying here:
> 
> Why 'RTE_LIBRTE_MLX5_DEBUG' exists at first place?
> 
> It seems is is used both for data and control path, can you extend the patch for:
> 1- Remove #ifdef from control path
> 2- Replace with 'RTE_ETHDEV_DEBUG_RX' & 'RTE_ETHDEV_DEBUG_TX' for data path,
>     please see: https://patches.dpdk.org/project/dpdk/list/?series=15738
> 3- Remove 'RTE_LIBRTE_MLX5_DEBUG' completely, if not removed document it in the
>     driver documentation as supported config file
> 
> Both for 'mlx4' and 'mlx5', I will continue with existing patch, but can it be 
> possible to make additional patches to address above issues?

Same answer as for mlx4 :)
To me using ETHDEV config macro in PMDs is new,
and I think it is out of scope for this patch.
But yes I agree it would be a nice improvement.
Matan, Slave, please could you do this change during next month?






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

* Re: [dpdk-dev] [PATCH v2 2/4] common/mlx5: enable debug logs dynamically
  2021-03-17 17:48       ` Thomas Monjalon
@ 2021-03-18 10:13         ` Matan Azrad
  0 siblings, 0 replies; 19+ messages in thread
From: Matan Azrad @ 2021-03-18 10:13 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, dev, Ferruh Yigit, Slava Ovsiienko
  Cc: Shahaf Shuler



From: Thomas Monjalon
> 17/03/2021 18:39, Ferruh Yigit:
> > On 3/9/2021 9:48 AM, Thomas Monjalon wrote:
> > > Most debug logs are using DRV_LOG(DEBUG,) but some were using
> > > DEBUG().
> > > The macro DEBUG is doing nothing if not compiled with
> > > RTE_LIBRTE_MLX5_DEBUG.
> > >
> > > As it is not used in the data path, the macro DEBUG can be replaced
> > > with DRV_LOG.
> > > Then all debug logs can be enabled at runtime with:
> > >     --log-level pmd.net.mlx5:debug
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> >
> > Similar comment for the mlx4 one, copying here:
> >
> > Why 'RTE_LIBRTE_MLX5_DEBUG' exists at first place?
> >
> > It seems is is used both for data and control path, can you extend the patch
> for:
> > 1- Remove #ifdef from control path
> > 2- Replace with 'RTE_ETHDEV_DEBUG_RX' & 'RTE_ETHDEV_DEBUG_TX' for
> data path,
> >     please see:
> > https://patches.dpdk.org/project/dpdk/list/?series=15738
> > 3- Remove 'RTE_LIBRTE_MLX5_DEBUG' completely, if not removed
> document it in the
> >     driver documentation as supported config file
> >
> > Both for 'mlx4' and 'mlx5', I will continue with existing patch, but
> > can it be possible to make additional patches to address above issues?
> 
> Same answer as for mlx4 :)
> To me using ETHDEV config macro in PMDs is new, and I think it is out of scope
> for this patch.
> But yes I agree it would be a nice improvement.
> Matan, Slave, please could you do this change during next month?

Yes, good suggestion, will add to our tasks.
Thanks Thomas\Ferruh.

Matan

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

end of thread, other threads:[~2021-03-18 10:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 22:28 [dpdk-dev] [PATCH 0/3] adjust mlx debug logs Thomas Monjalon
2021-03-08 22:28 ` [dpdk-dev] [PATCH 1/3] net/mlx4: enable debug logs dynamically Thomas Monjalon
2021-03-08 22:28 ` [dpdk-dev] [PATCH 2/3] common/mlx5: " Thomas Monjalon
2021-03-08 22:28 ` [dpdk-dev] [PATCH 3/3] net/mlx5: reduce log level of alignment message Thomas Monjalon
2021-03-09  9:48 ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Thomas Monjalon
2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically Thomas Monjalon
2021-03-11 20:03     ` Matan Azrad
2021-03-17 17:29     ` Ferruh Yigit
2021-03-17 17:47       ` Thomas Monjalon
2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 2/4] common/mlx5: " Thomas Monjalon
2021-03-11 20:04     ` Matan Azrad
2021-03-17 17:39     ` Ferruh Yigit
2021-03-17 17:48       ` Thomas Monjalon
2021-03-18 10:13         ` Matan Azrad
2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 3/4] common/mlx5: remove extra line feed in log messages Thomas Monjalon
2021-03-11 20:05     ` Matan Azrad
2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 4/4] net/mlx5: reduce log level of alignment message Thomas Monjalon
2021-03-11 20:07     ` Matan Azrad
2021-03-16  9:04   ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Raslan Darawsheh

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git