[RFC,04/29] net/qdma: add logging support
Checks
Commit Message
define macro for logging across PMD files
Signed-off-by: Aman Kumar <aman.kumar@vvdntech.in>
---
drivers/net/qdma/qdma_ethdev.c | 1 +
drivers/net/qdma/qdma_log.h | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
create mode 100644 drivers/net/qdma/qdma_log.h
Comments
On Wed, 6 Jul 2022 13:21:54 +0530
Aman Kumar <aman.kumar@vvdntech.in> wrote:
> +extern int qdma_logtype_pmd;
> +#define PMD_DRV_LOG(level, fmt, args...) \
> + rte_log(RTE_LOG_ ## level, qdma_logtype_pmd, "%s(): " \
> + fmt "\n", __func__, ## args)
Did you test this. Looks like your log messages are going
to end up double spaced. Because many of the later calls put a
newline on the message. Example:
+ PMD_DRV_LOG(INFO, "QDMA devargs desc_prefetch is: %s\n", value);
On 06/07/22 8:57 pm, Stephen Hemminger wrote:
> On Wed, 6 Jul 2022 13:21:54 +0530
> Aman Kumar <aman.kumar@vvdntech.in> wrote:
>
>> +extern int qdma_logtype_pmd;
>> +#define PMD_DRV_LOG(level, fmt, args...) \
>> + rte_log(RTE_LOG_ ## level, qdma_logtype_pmd, "%s(): " \
>> + fmt "\n", __func__, ## args)
> Did you test this. Looks like your log messages are going
> to end up double spaced. Because many of the later calls put a
> newline on the message. Example:
>
> + PMD_DRV_LOG(INFO, "QDMA devargs desc_prefetch is: %s\n", value);
Additional lines did not bother us during feature testing. I'll fix this
in v2.
Thanks for pointing this.
@@ -105,3 +105,4 @@ static struct rte_pci_driver rte_qdma_pmd = {
RTE_PMD_REGISTER_PCI(net_qdma, rte_qdma_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_qdma, qdma_pci_id_tbl);
+RTE_LOG_REGISTER_DEFAULT(qdma_logtype_pmd, NOTICE);
new file mode 100644
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017-2022 Xilinx, Inc. All rights reserved.
+ * Copyright(c) 2022 VVDN Technologies Private Limited. All rights reserved.
+ */
+
+#ifndef __QDMA_LOG_H__
+#define __QDMA_LOG_H__
+
+#include <rte_log.h>
+
+extern int qdma_logtype_pmd;
+#define PMD_DRV_LOG(level, fmt, args...) \
+ rte_log(RTE_LOG_ ## level, qdma_logtype_pmd, "%s(): " \
+ fmt "\n", __func__, ## args)
+
+#endif /* ifndef __QDMA_LOG_H__ */