Thread (31 messages) 31 messages, 2 authors, 2018-01-26

Re: [PATCH 2/5] net/bnxt: use driver specific dynamic log type

From: Ferruh Yigit <hidden>
Date: 2018-01-22 12:23:51

On 1/22/2018 6:20 AM, Ajit Khaparde wrote:
This patch implements driver specific log type doing away with
usage of RTE_LOG() for logging.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
<...>
quoted hunk ↗ jump to hunk
@@ -3433,6 +3434,16 @@ bool is_bnxt_supported(struct rte_eth_dev *dev)
 	return is_device_supported(dev, &bnxt_rte_pmd);
 }
 
+static void
+bnxt_init_log(void)
+{
+	bnxt_logtype_driver = rte_log_register("pmd.bnxt.driver");
+	if (bnxt_logtype_driver >= 0)
+		rte_log_set_level(bnxt_logtype_driver, RTE_LOG_NOTICE);
+}
+
 RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_bnxt, bnxt_pci_id_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_bnxt, "* igb_uio | uio_pci_generic | vfio-pci");
+
+RTE_INIT(bnxt_init_log);
Compiler giving warning for this [1], briefly asks putting this line above
"bnxt_init_log":

[1]
...dpdk/drivers/net/bnxt/bnxt_ethdev.c:3518:1: error: attribute declaration must
precede definition [-Werror,-Wignored-attributes]


RTE_INIT(bnxt_init_log);
^


<...>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help