xref: /dpdk/drivers/crypto/bcmfs/bcmfs_logs.h (revision 2b843cac232eb3f2fa79e4254e21766817e2019f)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Broadcom
3  * All rights reserved.
4  */
5 
6 #ifndef _BCMFS_LOGS_H_
7 #define _BCMFS_LOGS_H_
8 
9 #include <rte_log.h>
10 
11 extern int bcmfs_conf_logtype;
12 #define RTE_LOGTYPE_BCMFS_CONF bcmfs_conf_logtype
13 extern int bcmfs_dp_logtype;
14 #define RTE_LOGTYPE_BCMFS_DP bcmfs_dp_logtype
15 
16 #define BCMFS_LOG(level, ...) \
17 	RTE_LOG_LINE_PREFIX(level, BCMFS_CONF, "%s(): ", __func__, __VA_ARGS__)
18 
19 #define BCMFS_DP_LOG(level, ...) \
20 	RTE_LOG_LINE_PREFIX(level, BCMFS_DP, "%s(): ", __func__, __VA_ARGS__)
21 
22 #define BCMFS_DP_HEXDUMP_LOG(level, title, buf, len)	\
23 	bcmfs_hexdump_log(RTE_LOG_ ## level, bcmfs_dp_logtype, title, buf, len)
24 
25 /**
26  * bcmfs_hexdump_log Dump out memory in a special hex dump format.
27  *
28  * The message will be sent to the stream used by the rte_log infrastructure.
29  */
30 int
31 bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *heading,
32 		  const void *buf, unsigned int len);
33 
34 #endif /* _BCMFS_LOGS_H_ */
35