adjust mlx debug logs
Subsystems (3)
cover adjust mlx debug logs
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(-)
Signature · 1 line
2.30.1
PATCH 1/3 net/mlx4: enable debug logs dynamically
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
--- drivers/net/mlx4/mlx4_utils.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/mlx4/mlx4_utils.h +2 -3
@@ -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__)
Signature · 1 line
2.30.1
PATCH 2/3 common/mlx5: enable debug logs dynamically
In reply to Thomas MonjalonMost 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
--- 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(-)
drivers/common/mlx5/mlx5_common.h +0 -2
@@ -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__)
drivers/common/mlx5/mlx5_common_mr.c +24 -21
140 lines not on this page · raw message
drivers/common/mlx5/mlx5_common_pci.c +2 -2
@@ -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; }
drivers/net/mlx5/linux/mlx5_verbs.c +7 -6
@@ -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;
drivers/net/mlx5/mlx5_mr.c +6 -6
@@ -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);
drivers/net/mlx5/mlx5_rxq.c +7 -4
@@ -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; }
Signature · 1 line
2.30.1
PATCH 3/3 net/mlx5: reduce log level of alignment message
In reply to Thomas MonjalonHaving 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.
--- drivers/net/mlx5/mlx5_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_utils.c +2 -2
@@ -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; }
Signature · 1 line
2.30.1
v2 cover adjust mlx debug logs
In reply to Thomas MonjalonFew 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(-)
Signature · 1 line
2.30.1
PATCH v2 1/4 net/mlx4: enable debug logs dynamically
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
--- drivers/net/mlx4/mlx4_utils.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/mlx4/mlx4_utils.h +2 -3
@@ -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__)
Signature · 1 line
2.30.1
Re: [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically
From: Thomas Monjalon
Quoted 8 lines
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:debugSigned-off-by Thomas Monjalon <[email protected]>
Re: [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically
In reply to Thomas MonjalonQuoted 8 lines · 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:debugSigned-off-by Thomas Monjalon <[email protected]>
+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
Re: [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically
17/03/2021 18:29, Ferruh Yigit:
Quoted 10 lines · Thomas Monjalon
Quoted 8 lines
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:debugSigned-off-by Thomas Monjalon <[email protected]>
Quoted 8 lines
+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?
PATCH v2 2/4 common/mlx5: enable debug logs dynamically
In reply to Thomas MonjalonMost 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
--- 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(-)
drivers/common/mlx5/mlx5_common.h +0 -2
@@ -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__)
drivers/common/mlx5/mlx5_common_mr.c +24 -21
140 lines not on this page · raw message
drivers/net/mlx5/linux/mlx5_verbs.c +7 -6
@@ -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;
drivers/net/mlx5/mlx5_mr.c +6 -6
@@ -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);
drivers/net/mlx5/mlx5_rxq.c +7 -4
@@ -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; }
Signature · 1 line
2.30.1
Re: [dpdk-dev] [PATCH v2 2/4] common/mlx5: enable debug logs dynamically
From: Thomas Monjalon
Quoted 10 lines
Most debug logs are using
DRV_LOG(DEBUG,)but some were usingDEBUG(). The macro DEBUG is doing nothing if not compiled withRTE_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:debugSigned-off-by Thomas Monjalon <[email protected]>
Re: [dpdk-dev] [PATCH v2 2/4] common/mlx5: enable debug logs dynamically
In reply to Thomas MonjalonQuoted 11 lines · Thomas Monjalon
Most debug logs are using
DRV_LOG(DEBUG,)
but some were usingDEBUG().
The macro DEBUG is doing nothing if not compiled withRTE_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:debugSigned-off-by Thomas Monjalon <[email protected]>
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?
Re: [dpdk-dev] [PATCH v2 2/4] common/mlx5: enable debug logs dynamically
17/03/2021 18:39, Ferruh Yigit:
Quoted 24 lines · Thomas Monjalon
Quoted 11 lines
Most debug logs are using
DRV_LOG(DEBUG,)
but some were usingDEBUG().
The macro DEBUG is doing nothing if not compiled withRTE_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:debugSigned-off-by Thomas Monjalon <[email protected]>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
Quoted 2 lines
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?
Re: [dpdk-dev] [PATCH v2 2/4] common/mlx5: enable debug logs dynamically
From: Thomas Monjalon
Quoted 29 lines
17/03/2021 18:39, Ferruh Yigit:
Quoted 11 lines · Thomas Monjalon
Quoted 10 lines
Most debug logs are using
DRV_LOG(DEBUG,)but some were usingDEBUG().
The macro DEBUG is doing nothing if not compiled withRTE_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:debugQuoted 7 lines
Quoted 1 line
Signed-off-by Thomas Monjalon <[email protected]>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:
Quoted 2 lines
1- Remove #ifdef from control path
2- Replace with 'RTE_ETHDEV_DEBUG_RX' & 'RTE_ETHDEV_DEBUG_TX' fordata path,
Quoted 3 lines
please see:
https://patches.dpdk.org/project/dpdk/list/?series=15738
3- Remove 'RTE_LIBRTE_MLX5_DEBUG' completely, if not removeddocument it in the
Quoted 2 lines
driver documentation as supported config file
Quoted 8 lines
Quoted 2 lines
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
PATCH v2 3/4 common/mlx5: remove extra line feed in log messages
In reply to Thomas MonjalonThe 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.
--- 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(-)
drivers/common/mlx5/mlx5_common_pci.c +2 -2
@@ -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; }
drivers/common/mlx5/mlx5_devx_cmds.c +1 -1
@@ -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);
drivers/compress/mlx5/mlx5_compress.c +1 -1
@@ -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:
drivers/net/mlx5/linux/mlx5_os.c +4 -4
@@ -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 }
drivers/net/mlx5/mlx5_flow.c +1 -1
@@ -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); }
drivers/net/mlx5/windows/mlx5_os.c +1 -1
@@ -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; }
drivers/vdpa/mlx5/mlx5_vdpa.c +1 -1
@@ -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,
Signature · 1 line
2.30.1
Re: [dpdk-dev] [PATCH v2 3/4] common/mlx5: remove extra line feed in log messages
From: Thomas Monjalon
Quoted 5 lines
The macro
DRV_LOGalready includes a terminating line feed character defined inPMD_DRV_LOG_.
The extra line feeds added in some messages are removed.Signed-off-by Thomas Monjalon <[email protected]>
PATCH v2 4/4 net/mlx5: reduce log level of alignment message
In reply to Thomas MonjalonHaving 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.
--- drivers/net/mlx5/mlx5_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_utils.c +2 -2
@@ -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; }
Signature · 1 line
2.30.1
Re: [dpdk-dev] [PATCH v2 4/4] net/mlx5: reduce log level of alignment message
From: Thomas Monjalon
Quoted 5 lines
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 <[email protected]>
Hi,
Quoted 35 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Thomas Monjalon
Sent: Tuesday, March 9, 2021 11:49 AM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logsFew 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 messagedrivers/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(-)
Quoted 2 lines
--
2.30.1
Series applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh