numam-dpdk/drivers/net/hns3/hns3_logs.h
Chengwen Feng 2ad146efb1 net/hns3: rename header guards
Currently, the hns3 driver uses _HNS3_XXX conditional compilation
macros to prevent duplicate header files. But in the C11 standard, all
identifiers starting with an underscore plus an uppercase letter are
always reserved. So this patch fixes it.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
2022-10-04 18:09:48 +02:00

35 lines
1.0 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2018-2021 HiSilicon Limited.
*/
#ifndef HNS3_LOGS_H
#define HNS3_LOGS_H
extern int hns3_logtype_init;
#define PMD_INIT_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, hns3_logtype_init, "%s(): " fmt "\n", \
__func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
extern int hns3_logtype_driver;
#define PMD_DRV_LOG_RAW(hw, level, fmt, args...) \
rte_log(level, hns3_logtype_driver, "%s %s(): " fmt, \
(hw)->data->name, __func__, ## args)
#define hns3_err(hw, fmt, args...) \
PMD_DRV_LOG_RAW(hw, RTE_LOG_ERR, fmt "\n", ## args)
#define hns3_warn(hw, fmt, args...) \
PMD_DRV_LOG_RAW(hw, RTE_LOG_WARNING, fmt "\n", ## args)
#define hns3_notice(hw, fmt, args...) \
PMD_DRV_LOG_RAW(hw, RTE_LOG_NOTICE, fmt "\n", ## args)
#define hns3_info(hw, fmt, args...) \
PMD_DRV_LOG_RAW(hw, RTE_LOG_INFO, fmt "\n", ## args)
#define hns3_dbg(hw, fmt, args...) \
PMD_DRV_LOG_RAW(hw, RTE_LOG_DEBUG, fmt "\n", ## args)
#endif /* HNS3_LOGS_H */