[dpdk-dev] [PATCH 2/5] net/bnxt: use driver specific dynamic log type

Ferruh Yigit ferruh.yigit at intel.com
Mon Jan 22 13:23:49 CET 2018


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 at broadcom.com>

<...>

> @@ -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);
^


<...>



More information about the dev mailing list