[dpdk-dev] [PATCH 08/11] net/hns3: change the log level to INFO

Wei Hu (Xavier) huwei013 at chinasoftinc.com
Mon Sep 7 13:34:59 CEST 2020


Hi,Ferruh Yigit

On 2020/9/4 18:34, Ferruh Yigit wrote:
> On 8/25/2020 12:53 PM, Wei Hu (Xavier) wrote:
>> From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
>>
>> This patch changes the log level from NOTICE to INFO.
>>
>> Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
>> ---
>>   drivers/net/hns3/hns3_ethdev.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
>> index fca035d4f..3827d3277 100644
>> --- a/drivers/net/hns3/hns3_ethdev.c
>> +++ b/drivers/net/hns3/hns3_ethdev.c
>> @@ -5744,5 +5744,5 @@ static struct rte_pci_driver rte_hns3_pmd = {
>>   RTE_PMD_REGISTER_PCI(net_hns3, rte_hns3_pmd);
>>   RTE_PMD_REGISTER_PCI_TABLE(net_hns3, pci_id_hns3_map);
>>   RTE_PMD_REGISTER_KMOD_DEP(net_hns3, "* igb_uio | vfio-pci");
>> -RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, NOTICE);
>> -RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, NOTICE);
>> +RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, INFO);
>> +RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, INFO);
>>
> 
> Why making the PMD more verbose by default? You can update the log level
> dynamically when need to be more verbose.
> 
> Common approach is to set default PMD log level is to 'NOTICE', I think this is
> good to make applications more usable.

Currently hns3 PMD driver invokes the private macro named hns3_info in 
several places, we found that these information wouldn't never be logged.
     hns3_info -> rte_log(RTE_LOG_INFO, hns3_logtype_dirver,...)

To display the related log information, we need to execute the following 
code in the application, right? Is there any other way?
extern int hns3_logtype_driver;
rte_log_set_level(hns3_logtype_driver, RTE_LOG_INFO);

Thanks, Xavier


> 


More information about the dev mailing list