numam-dpdk/drivers/net/hns3/hns3_logs.h
Wei Hu (Xavier) c203571b36 net/hns3: register and add log interface
This patch registers hns3 PMD driver and adds the definition for log
interfaces.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07 15:00:56 +02:00

35 lines
1.0 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2018-2019 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_ */