2 * Copyright (c) 2014 VMware, Inc.
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
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)
34 #define OVS_DBG_GRE64 BIT32(14)
35 #define OVS_DBG_ACTION BIT32(15)
36 #define OVS_DBG_DATAPATH BIT32(16)
37 #define OVS_DBG_PROPERTY BIT32(17)
38 #define OVS_DBG_IPHELPER BIT32(18)
39 #define OVS_DBG_BUFMGMT BIT32(19)
40 #define OVS_DBG_OTHERS BIT32(21)
41 #define OVS_DBG_NETLINK BIT32(22)
43 #define OVS_DBG_RESERVED BIT32(31)
44 //Please add above OVS_DBG_RESERVED.
46 #define OVS_DBG_ERROR DPFLTR_ERROR_LEVEL
47 #define OVS_DBG_WARN DPFLTR_WARNING_LEVEL
48 #define OVS_DBG_TRACE DPFLTR_TRACE_LEVEL
49 #define OVS_DBG_INFO DPFLTR_INFO_LEVEL
50 #define OVS_DBG_LOUD (DPFLTR_INFO_LEVEL + 1)
54 VOID OvsLog(UINT32 level, UINT32 flag, CHAR *funcName,
55 UINT32 line, CHAR *format, ...);
58 #define OVS_LOG_LOUD(_format, ...) \
59 OvsLog(OVS_DBG_LOUD, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
61 #define OVS_LOG_INFO(_format, ...) \
62 OvsLog(OVS_DBG_INFO, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
64 #define OVS_LOG_TRACE(_format, ...) \
65 OvsLog(OVS_DBG_TRACE, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
67 #define OVS_LOG_ERROR(_format, ...) \
68 OvsLog(OVS_DBG_ERROR, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
70 #define OVS_LOG_WARN(_format, ...) \
71 OvsLog(OVS_DBG_WARN, OVS_DBG_MOD, __FUNCTION__, __LINE__, _format, __VA_ARGS__)
74 #define OVS_VERIFY_IRQL(_x) \
75 if (KeGetCurrentIrql() != (KIRQL)_x) { \
76 OVS_LOG_WARN("expected IRQL %u, actual IRQL: %u", \
77 _x, KeGetCurrentIrql()); \
80 #define OVS_VERIFY_IRQL_LE(_x) \
81 if (KeGetCurrentIrql() > (KIRQL)_x) { \
82 OVS_LOG_WARN("expected IRQL <= %u, actual IRQL: %u", \
83 _x, KeGetCurrentIrql()); \
87 #define OVS_VERIFY_IRQL(_x)
88 #define OVS_VERIFY_IRQL_LE(_x)
91 #endif /* __DEBUG_H_ */