]> git.proxmox.com Git - mirror_ovs.git/blame - datapath-windows/ovsext/Debug.h
datapath-windows: Support for IRP cancelling mechanism
[mirror_ovs.git] / datapath-windows / ovsext / Debug.h
CommitLineData
c803536e
SS
1/*
2 * Copyright (c) 2014 VMware, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
fa1324c9
SG
17#ifndef __DEBUG_H_
18#define __DEBUG_H_ 1
c803536e
SS
19
20#define OVS_DBG_INIT BIT32(0)
21#define OVS_DBG_SWITCH BIT32(1)
22#define OVS_DBG_VPORT BIT32(2)
23#define OVS_DBG_FLOW BIT32(3)
24#define OVS_DBG_QOS BIT32(4)
25#define OVS_DBG_USER BIT32(5)
26#define OVS_DBG_EXECUTE BIT32(6)
27#define OVS_DBG_EVENT BIT32(7)
28#define OVS_DBG_DISPATCH BIT32(8)
29#define OVS_DBG_OID BIT32(9)
30#define OVS_DBG_STATUS BIT32(10)
31#define OVS_DBG_CHECKSUM BIT32(11)
32#define OVS_DBG_VXLAN BIT32(12)
33#define OVS_DBG_GRE BIT32(13)
99e7b077
PS
34#define OVS_DBG_ACTION BIT32(14)
35#define OVS_DBG_DATAPATH BIT32(15)
36#define OVS_DBG_PROPERTY BIT32(16)
37#define OVS_DBG_IPHELPER BIT32(17)
38#define OVS_DBG_BUFMGMT BIT32(18)
39#define OVS_DBG_OTHERS BIT32(19)
40#define OVS_DBG_NETLINK BIT32(20)
41#define OVS_DBG_TUNFLT BIT32(21)
42#define OVS_DBG_STT BIT32(22)
c803536e
SS
43
44#define OVS_DBG_RESERVED BIT32(31)
45//Please add above OVS_DBG_RESERVED.
46
47#define OVS_DBG_ERROR DPFLTR_ERROR_LEVEL
48#define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
49#define OVS_DBG_TRACE DPFLTR_TRACE_LEVEL
50#define OVS_DBG_INFO DPFLTR_INFO_LEVEL
51#define OVS_DBG_LOUD (DPFLTR_INFO_LEVEL + 1)
52
53
54
55VOID OvsLog(UINT32 level, UINT32 flag, CHAR *funcName,
56 UINT32 line, CHAR *format, ...);
57
58
59#define OVS_LOG_LOUD(_format, ...) \
60 OvsLog(OVS_DBG_LOUD, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
61
62#define OVS_LOG_INFO(_format, ...) \
63 OvsLog(OVS_DBG_INFO, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
64
65#define OVS_LOG_TRACE(_format, ...) \
66 OvsLog(OVS_DBG_TRACE, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
67
68#define OVS_LOG_ERROR(_format, ...) \
69 OvsLog(OVS_DBG_ERROR, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
70
71#define OVS_LOG_WARN(_format, ...) \
72 OvsLog(OVS_DBG_WARN, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
73
74#if DBG
75#define OVS_VERIFY_IRQL(_x) \
76 if (KeGetCurrentIrql() != (KIRQL)_x) { \
77 OVS_LOG_WARN("expected IRQL %u, actual IRQL: %u", \
78 _x, KeGetCurrentIrql()); \
79 }
80
81#define OVS_VERIFY_IRQL_LE(_x) \
82 if (KeGetCurrentIrql() > (KIRQL)_x) { \
83 OVS_LOG_WARN("expected IRQL <= %u, actual IRQL: %u", \
84 _x, KeGetCurrentIrql()); \
85 }
86
87#else
88#define OVS_VERIFY_IRQL(_x)
89#define OVS_VERIFY_IRQL_LE(_x)
90#endif
91
fa1324c9 92#endif /* __DEBUG_H_ */