aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip_vs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r--include/net/ip_vs.h119
1 files changed, 59 insertions, 60 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index bbae1e87efcd..98978e73f666 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -99,47 +99,47 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
99 return &buf[*idx - len]; 99 return &buf[*idx - len];
100} 100}
101 101
102#define IP_VS_DBG_BUF(level, msg...) \ 102#define IP_VS_DBG_BUF(level, msg, ...) \
103 do { \ 103 do { \
104 char ip_vs_dbg_buf[160]; \ 104 char ip_vs_dbg_buf[160]; \
105 int ip_vs_dbg_idx = 0; \ 105 int ip_vs_dbg_idx = 0; \
106 if (level <= ip_vs_get_debug_level()) \ 106 if (level <= ip_vs_get_debug_level()) \
107 printk(KERN_DEBUG "IPVS: " msg); \ 107 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
108 } while (0) 108 } while (0)
109#define IP_VS_ERR_BUF(msg...) \ 109#define IP_VS_ERR_BUF(msg...) \
110 do { \ 110 do { \
111 char ip_vs_dbg_buf[160]; \ 111 char ip_vs_dbg_buf[160]; \
112 int ip_vs_dbg_idx = 0; \ 112 int ip_vs_dbg_idx = 0; \
113 printk(KERN_ERR "IPVS: " msg); \ 113 pr_err(msg); \
114 } while (0) 114 } while (0)
115 115
116/* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */ 116/* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */
117#define IP_VS_DBG_ADDR(af, addr) \ 117#define IP_VS_DBG_ADDR(af, addr) \
118 ip_vs_dbg_addr(af, ip_vs_dbg_buf, \ 118 ip_vs_dbg_addr(af, ip_vs_dbg_buf, \
119 sizeof(ip_vs_dbg_buf), addr, \ 119 sizeof(ip_vs_dbg_buf), addr, \
120 &ip_vs_dbg_idx) 120 &ip_vs_dbg_idx)
121 121
122#define IP_VS_DBG(level, msg...) \ 122#define IP_VS_DBG(level, msg, ...) \
123 do { \ 123 do { \
124 if (level <= ip_vs_get_debug_level()) \ 124 if (level <= ip_vs_get_debug_level()) \
125 printk(KERN_DEBUG "IPVS: " msg); \ 125 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
126 } while (0) 126 } while (0)
127#define IP_VS_DBG_RL(msg...) \ 127#define IP_VS_DBG_RL(msg, ...) \
128 do { \ 128 do { \
129 if (net_ratelimit()) \ 129 if (net_ratelimit()) \
130 printk(KERN_DEBUG "IPVS: " msg); \ 130 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
131 } while (0) 131 } while (0)
132#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ 132#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \
133 do { \ 133 do { \
134 if (level <= ip_vs_get_debug_level()) \ 134 if (level <= ip_vs_get_debug_level()) \
135 pp->debug_packet(pp, skb, ofs, msg); \ 135 pp->debug_packet(pp, skb, ofs, msg); \
136 } while (0) 136 } while (0)
137#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ 137#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \
138 do { \ 138 do { \
139 if (level <= ip_vs_get_debug_level() && \ 139 if (level <= ip_vs_get_debug_level() && \
140 net_ratelimit()) \ 140 net_ratelimit()) \
141 pp->debug_packet(pp, skb, ofs, msg); \ 141 pp->debug_packet(pp, skb, ofs, msg); \
142 } while (0) 142 } while (0)
143#else /* NO DEBUGGING at ALL */ 143#else /* NO DEBUGGING at ALL */
144#define IP_VS_DBG_BUF(level, msg...) do {} while (0) 144#define IP_VS_DBG_BUF(level, msg...) do {} while (0)
145#define IP_VS_ERR_BUF(msg...) do {} while (0) 145#define IP_VS_ERR_BUF(msg...) do {} while (0)
@@ -150,29 +150,27 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
150#endif 150#endif
151 151
152#define IP_VS_BUG() BUG() 152#define IP_VS_BUG() BUG()
153#define IP_VS_ERR(msg...) printk(KERN_ERR "IPVS: " msg) 153#define IP_VS_ERR_RL(msg, ...) \
154#define IP_VS_INFO(msg...) printk(KERN_INFO "IPVS: " msg) 154 do { \
155#define IP_VS_WARNING(msg...) \ 155 if (net_ratelimit()) \
156 printk(KERN_WARNING "IPVS: " msg) 156 pr_err(msg, ##__VA_ARGS__); \
157#define IP_VS_ERR_RL(msg...) \ 157 } while (0)
158 do { \
159 if (net_ratelimit()) \
160 printk(KERN_ERR "IPVS: " msg); \
161 } while (0)
162 158
163#ifdef CONFIG_IP_VS_DEBUG 159#ifdef CONFIG_IP_VS_DEBUG
164#define EnterFunction(level) \ 160#define EnterFunction(level) \
165 do { \ 161 do { \
166 if (level <= ip_vs_get_debug_level()) \ 162 if (level <= ip_vs_get_debug_level()) \
167 printk(KERN_DEBUG "Enter: %s, %s line %i\n", \ 163 printk(KERN_DEBUG \
168 __func__, __FILE__, __LINE__); \ 164 pr_fmt("Enter: %s, %s line %i\n"), \
169 } while (0) 165 __func__, __FILE__, __LINE__); \
170#define LeaveFunction(level) \ 166 } while (0)
171 do { \ 167#define LeaveFunction(level) \
172 if (level <= ip_vs_get_debug_level()) \ 168 do { \
173 printk(KERN_DEBUG "Leave: %s, %s line %i\n", \ 169 if (level <= ip_vs_get_debug_level()) \
174 __func__, __FILE__, __LINE__); \ 170 printk(KERN_DEBUG \
175 } while (0) 171 pr_fmt("Leave: %s, %s line %i\n"), \
172 __func__, __FILE__, __LINE__); \
173 } while (0)
176#else 174#else
177#define EnterFunction(level) do {} while (0) 175#define EnterFunction(level) do {} while (0)
178#define LeaveFunction(level) do {} while (0) 176#define LeaveFunction(level) do {} while (0)
@@ -740,7 +738,8 @@ extern void ip_vs_protocol_cleanup(void);
740extern void ip_vs_protocol_timeout_change(int flags); 738extern void ip_vs_protocol_timeout_change(int flags);
741extern int *ip_vs_create_timeout_table(int *table, int size); 739extern int *ip_vs_create_timeout_table(int *table, int size);
742extern int 740extern int
743ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to); 741ip_vs_set_state_timeout(int *table, int num, const char *const *names,
742 const char *name, int to);
744extern void 743extern void
745ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, 744ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb,
746 int offset, const char *msg); 745 int offset, const char *msg);