2 * Copyright (c) 2017 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef SRC_VNET_TCP_TCP_DEBUG_H_
17 #define SRC_VNET_TCP_TCP_DEBUG_H_
19 #include <vlib/vlib.h>
22 #define TCP_DEBUG_SM (2)
23 #define TCP_DEBUG_CC (0)
24 #define TCP_DEBUG_CC_STAT (0)
26 #define foreach_tcp_dbg_evt \
34 _(SYN_SENT, "SYN sent") \
35 _(SYNACK_SENT, "SYNACK sent") \
36 _(SYNACK_RCVD, "SYNACK rcvd") \
37 _(SYN_RXT, "SYN retransmit") \
38 _(FIN_SENT, "FIN sent") \
39 _(ACK_SENT, "ACK sent") \
40 _(DUPACK_SENT, "DUPACK sent") \
41 _(RST_SENT, "RST sent") \
42 _(SYN_RCVD, "SYN rcvd") \
43 _(ACK_RCVD, "ACK rcvd") \
44 _(DUPACK_RCVD, "DUPACK rcvd") \
45 _(FIN_RCVD, "FIN rcvd") \
46 _(RST_RCVD, "RST rcvd") \
47 _(STATE_CHANGE, "state change") \
48 _(PKTIZE, "packetize") \
50 _(SND_WND, "snd_wnd update") \
52 _(TIMER_POP, "timer pop") \
53 _(CC_RTX, "retransmit") \
54 _(CC_EVT, "cc event") \
55 _(CC_PACK, "cc partial ack") \
56 _(CC_STAT, "cc stats") \
57 _(CC_RTO_STAT, "cc rto stats") \
58 _(SEG_INVALID, "invalid segment") \
59 _(PAWS_FAIL, "failed paws check") \
60 _(ACK_RCV_ERR, "invalid ack") \
61 _(RCV_WND_SHRUNK, "shrunk rcv_wnd") \
65 #define _(sym, str) TCP_DBG_##sym,
70 typedef enum _tcp_dbg_evt
72 #define _(sym, str) TCP_EVT_##sym,
79 #define TRANSPORT_DEBUG (1)
82 * Infra and evt track setup
85 #define TCP_DBG(_tc, _evt, _args...) \
88 _tmp = format(_tmp, "%U", format_tcp_connection_verbose, _tc); \
89 clib_warning("%s", _tmp); \
93 #define DECLARE_ETD(_tc, _e, _size) \
98 ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, \
99 _e, _tc->c_elog_track)
101 #define TCP_DBG_IP_TAG_LCL(_tc) \
105 ELOG_TYPE_DECLARE (_e) = \
107 .format = "lcl: %d.%d.%d.%d:%d", \
108 .format_args = "i4i4i4i4i4", \
110 DECLARE_ETD(_tc, _e, 5); \
111 ed->data[0] = _tc->c_lcl_ip.ip4.as_u8[0]; \
112 ed->data[1] = _tc->c_lcl_ip.ip4.as_u8[1]; \
113 ed->data[2] = _tc->c_lcl_ip.ip4.as_u8[2]; \
114 ed->data[3] = _tc->c_lcl_ip.ip4.as_u8[3]; \
115 ed->data[4] = clib_net_to_host_u16(_tc->c_lcl_port); \
119 #define TCP_DBG_IP_TAG_RMT(_tc) \
123 ELOG_TYPE_DECLARE (_e) = \
125 .format = "rmt: %d.%d.%d.%d:%d", \
126 .format_args = "i4i4i4i4i4", \
128 DECLARE_ETD(_tc, _e, 5); \
129 ed->data[0] = _tc->c_rmt_ip.ip4.as_u8[0]; \
130 ed->data[1] = _tc->c_rmt_ip.ip4.as_u8[1]; \
131 ed->data[2] = _tc->c_rmt_ip.ip4.as_u8[2]; \
132 ed->data[3] = _tc->c_rmt_ip.ip4.as_u8[3]; \
133 ed->data[4] = clib_net_to_host_u16(_tc->c_rmt_port); \
137 #define TCP_EVT_INIT_HANDLER(_tc, _is_l, ...) \
139 char *_fmt = _is_l ? "l[%d].%d:%d%c" : "[%d].%d:%d->.%d:%d%c"; \
142 _tc->c_elog_track.name = \
143 (char *) format (0, _fmt, _tc->c_thread_index, \
144 _tc->c_lcl_ip.ip4.as_u8[3], \
145 clib_net_to_host_u16(_tc->c_lcl_port), \
146 _tc->c_rmt_ip.ip4.as_u8[3], \
147 clib_net_to_host_u16(_tc->c_rmt_port), 0); \
150 _tc->c_elog_track.name = \
151 (char *) format (0, _fmt, _tc->c_thread_index, \
152 _tc->c_lcl_ip.ip6.as_u8[15], \
153 clib_net_to_host_u16(_tc->c_lcl_port), \
154 _tc->c_rmt_ip.ip6.as_u8[15], \
155 clib_net_to_host_u16(_tc->c_rmt_port), 0); \
156 elog_track_register (&vlib_global_main.elog_main, &_tc->c_elog_track);\
157 TCP_DBG_IP_TAG_LCL(_tc); \
158 TCP_DBG_IP_TAG_RMT(_tc); \
161 #define TCP_EVT_DEALLOC_HANDLER(_tc, ...) \
163 vec_free (_tc->c_elog_track.name); \
166 #define TCP_EVT_OPEN_HANDLER(_tc, ...) \
168 TCP_EVT_INIT_HANDLER(_tc, 0); \
169 ELOG_TYPE_DECLARE (_e) = \
171 .format = "open: index %d", \
172 .format_args = "i4", \
174 DECLARE_ETD(_tc, _e, 1); \
175 ed->data[0] = _tc->c_c_index; \
178 #define TCP_EVT_CLOSE_HANDLER(_tc, ...) \
180 ELOG_TYPE_DECLARE (_e) = \
182 .format = "close: %d", \
183 .format_args = "i4", \
185 DECLARE_ETD(_tc, _e, 1); \
186 ed->data[0] = _tc->c_c_index; \
189 #define TCP_EVT_BIND_HANDLER(_tc, ...) \
191 TCP_EVT_INIT_HANDLER(_tc, 1); \
192 ELOG_TYPE_DECLARE (_e) = \
194 .format = "bind: listener %d", \
196 DECLARE_ETD(_tc, _e, 1); \
197 ed->data[0] = _tc->c_c_index; \
200 #define TCP_EVT_UNBIND_HANDLER(_tc, ...) \
202 TCP_EVT_DEALLOC_HANDLER(_tc); \
203 ELOG_TYPE_DECLARE (_e) = \
205 .format = "unbind: listener %d", \
207 DECLARE_ETD(_tc, _e, 1); \
208 ed->data[0] = _tc->c_c_index; \
209 TCP_EVT_DEALLOC_HANDLER(_tc); \
212 #define TCP_EVT_DELETE_HANDLER(_tc, ...) \
214 ELOG_TYPE_DECLARE (_e) = \
216 .format = "delete: %d", \
217 .format_args = "i4", \
219 DECLARE_ETD(_tc, _e, 1); \
220 ed->data[0] = _tc->c_c_index; \
221 TCP_EVT_DEALLOC_HANDLER(_tc); \
224 #define CONCAT_HELPER(_a, _b) _a##_b
225 #define CC(_a, _b) CONCAT_HELPER(_a, _b)
226 #define TCP_EVT_DBG(_evt, _args...) CC(_evt, _HANDLER)(_args)
228 #define TCP_EVT_DBG(_evt, _args...)
236 #define TCP_EVT_STATE_CHANGE_HANDLER(_tc, ...) \
238 ELOG_TYPE_DECLARE (_e) = \
240 .format = "state: %s", \
241 .format_args = "t4", \
242 .n_enum_strings = 11, \
257 DECLARE_ETD(_tc, _e, 1); \
258 ed->data[0] = _tc->state; \
261 #define TCP_EVT_SYN_RCVD_HANDLER(_tc, ...) \
263 TCP_EVT_INIT_HANDLER(_tc, 0); \
264 ELOG_TYPE_DECLARE (_e) = \
266 .format = "syn-rx: irs %u", \
267 .format_args = "i4", \
269 DECLARE_ETD(_tc, _e, 1); \
270 ed->data[0] = _tc->irs; \
271 TCP_EVT_STATE_CHANGE_HANDLER(_tc); \
274 #define TCP_EVT_SYN_SENT_HANDLER(_tc, ...) \
276 ELOG_TYPE_DECLARE (_e) = \
278 .format = "syn-tx: iss %u", \
279 .format_args = "i4", \
281 DECLARE_ETD(_tc, _e, 1); \
282 ed->data[0] = _tc->iss; \
283 TCP_EVT_STATE_CHANGE_HANDLER(_tc); \
286 #define TCP_EVT_SYNACK_SENT_HANDLER(_tc, ...) \
288 ELOG_TYPE_DECLARE (_e) = \
290 .format = "synack-tx: iss %u irs %u", \
291 .format_args = "i4i4", \
293 DECLARE_ETD(_tc, _e, 2); \
294 ed->data[0] = _tc->iss; \
295 ed->data[1] = _tc->irs; \
298 #define TCP_EVT_SYNACK_RCVD_HANDLER(_tc, ...) \
300 ELOG_TYPE_DECLARE (_e) = \
302 .format = "synack-rx: iss %u irs %u", \
303 .format_args = "i4i4", \
305 DECLARE_ETD(_tc, _e, 2); \
306 ed->data[0] = _tc->iss; \
307 ed->data[1] = _tc->irs; \
308 TCP_EVT_STATE_CHANGE_HANDLER(_tc); \
311 #define TCP_EVT_FIN_SENT_HANDLER(_tc, ...) \
313 ELOG_TYPE_DECLARE (_e) = \
315 .format = "fin-tx: snd_nxt %d rcv_nxt %d", \
316 .format_args = "i4i4", \
318 DECLARE_ETD(_tc, _e, 2); \
319 ed->data[0] = _tc->snd_nxt - _tc->iss; \
320 ed->data[1] = _tc->rcv_nxt - _tc->irs; \
323 #define TCP_EVT_RST_SENT_HANDLER(_tc, ...) \
325 ELOG_TYPE_DECLARE (_e) = \
327 .format = "rst-tx: snd_nxt %d rcv_nxt %d", \
328 .format_args = "i4i4", \
330 DECLARE_ETD(_tc, _e, 2); \
331 ed->data[0] = _tc->snd_nxt - _tc->iss; \
332 ed->data[1] = _tc->rcv_nxt - _tc->irs; \
333 TCP_EVT_STATE_CHANGE_HANDLER(_tc); \
336 #define TCP_EVT_FIN_RCVD_HANDLER(_tc, ...) \
338 ELOG_TYPE_DECLARE (_e) = \
340 .format = "fin-rx: snd_nxt %d rcv_nxt %d", \
341 .format_args = "i4i4", \
343 DECLARE_ETD(_tc, _e, 2); \
344 ed->data[0] = _tc->snd_nxt - _tc->iss; \
345 ed->data[1] = _tc->rcv_nxt - _tc->irs; \
348 #define TCP_EVT_RST_RCVD_HANDLER(_tc, ...) \
350 ELOG_TYPE_DECLARE (_e) = \
352 .format = "rst-rx: snd_nxt %d rcv_nxt %d", \
353 .format_args = "i4i4", \
355 DECLARE_ETD(_tc, _e, 2); \
356 ed->data[0] = _tc->snd_nxt - _tc->iss; \
357 ed->data[1] = _tc->rcv_nxt - _tc->irs; \
360 #define TCP_EVT_SYN_RXT_HANDLER(_tc, _type, ...) \
362 ELOG_TYPE_DECLARE (_e) = \
364 .format = "%s-rxt: iss %u", \
365 .format_args = "t4i4", \
366 .n_enum_strings = 2, \
372 DECLARE_ETD(_tc, _e, 2); \
373 ed->data[0] = _type; \
374 ed->data[1] = _tc->iss; \
378 #define TCP_EVT_SYN_SENT_HANDLER(_tc, ...)
379 #define TCP_EVT_SYNACK_SENT_HANDLER(_tc, ...)
380 #define TCP_EVT_SYNACK_RCVD_HANDLER(_tc, ...)
381 #define TCP_EVT_SYN_RXT_HANDLER(_tc, ...)
382 #define TCP_EVT_FIN_SENT_HANDLER(_tc, ...)
383 #define TCP_EVT_RST_SENT_HANDLER(_tc, ...)
384 #define TCP_EVT_FIN_RCVD_HANDLER(_tc, ...)
385 #define TCP_EVT_RST_RCVD_HANDLER(_tc, ...)
386 #define TCP_EVT_STATE_CHANGE_HANDLER(_tc, ...)
391 #define TCP_EVT_ACK_SENT_HANDLER(_tc, ...) \
393 ELOG_TYPE_DECLARE (_e) = \
395 .format = "ack-tx: acked %u rcv_nxt %u rcv_wnd %u snd_nxt %u snd_wnd %u",\
396 .format_args = "i4i4i4i4i4", \
398 DECLARE_ETD(_tc, _e, 5); \
399 ed->data[0] = _tc->rcv_nxt - _tc->rcv_las; \
400 ed->data[1] = _tc->rcv_nxt - _tc->irs; \
401 ed->data[2] = _tc->rcv_wnd; \
402 ed->data[3] = _tc->snd_nxt - _tc->iss; \
403 ed->data[4] = _tc->snd_wnd; \
406 #define TCP_EVT_DUPACK_SENT_HANDLER(_tc, ...) \
408 ELOG_TYPE_DECLARE (_e) = \
410 .format = "dack-tx: rcv_nxt %u rcv_wnd %u snd_nxt %u av_wnd %u snd_wnd %u",\
411 .format_args = "i4i4i4i4i4", \
413 DECLARE_ETD(_tc, _e, 5); \
414 ed->data[0] = _tc->rcv_nxt - _tc->irs; \
415 ed->data[1] = _tc->rcv_wnd; \
416 ed->data[2] = _tc->snd_nxt - _tc->iss; \
417 ed->data[3] = tcp_available_wnd(_tc); \
418 ed->data[4] = _tc->snd_wnd; \
421 #define TCP_EVT_ACK_RCVD_HANDLER(_tc, ...) \
423 ELOG_TYPE_DECLARE (_e) = \
425 .format = "acked: %u snd_una %u snd_wnd %u cwnd %u inflight %u", \
426 .format_args = "i4i4i4i4i4", \
428 DECLARE_ETD(_tc, _e, 5); \
429 ed->data[0] = _tc->bytes_acked; \
430 ed->data[1] = _tc->snd_una - _tc->iss; \
431 ed->data[2] = _tc->snd_wnd; \
432 ed->data[3] = _tc->cwnd; \
433 ed->data[4] = tcp_flight_size(_tc); \
436 #define TCP_EVT_DUPACK_RCVD_HANDLER(_tc, ...) \
438 ELOG_TYPE_DECLARE (_e) = \
440 .format = "dack-rx: snd_una %u cwnd %u snd_wnd %u flight %u rcv_wnd %u",\
441 .format_args = "i4i4i4i4i4", \
443 DECLARE_ETD(_tc, _e, 5); \
444 ed->data[0] = _tc->snd_una - _tc->iss; \
445 ed->data[1] = _tc->cwnd; \
446 ed->data[2] = _tc->snd_wnd; \
447 ed->data[3] = tcp_flight_size(_tc); \
448 ed->data[4] = _tc->rcv_wnd; \
451 #define TCP_EVT_PKTIZE_HANDLER(_tc, ...) \
453 ELOG_TYPE_DECLARE (_e) = \
455 .format = "pktize: una %u snd_nxt %u space %u flight %u rcv_wnd %u",\
456 .format_args = "i4i4i4i4i4", \
458 DECLARE_ETD(_tc, _e, 5); \
459 ed->data[0] = _tc->snd_una - _tc->iss; \
460 ed->data[1] = _tc->snd_nxt - _tc->iss; \
461 ed->data[2] = tcp_available_snd_space (_tc); \
462 ed->data[3] = tcp_flight_size (_tc); \
463 ed->data[4] = _tc->rcv_wnd; \
466 #define TCP_EVT_INPUT_HANDLER(_tc, _type, _len, _written, ...) \
468 ELOG_TYPE_DECLARE (_e) = \
470 .format = "in: %s len %u written %d rcv_nxt %u rcv_wnd(o) %d", \
471 .format_args = "t4i4i4i4i4", \
472 .n_enum_strings = 2, \
478 DECLARE_ETD(_tc, _e, 5); \
479 ed->data[0] = _type; \
480 ed->data[1] = _len; \
481 ed->data[2] = _written; \
482 ed->data[3] = (_tc->rcv_nxt - _tc->irs) + _written; \
483 ed->data[4] = _tc->rcv_wnd - (_tc->rcv_nxt - _tc->rcv_las); \
486 #define TCP_EVT_TIMER_POP_HANDLER(_tc_index, _timer_id, ...) \
488 tcp_connection_t *_tc; \
489 if (_timer_id == TCP_TIMER_RETRANSMIT_SYN \
490 || _timer_id == TCP_TIMER_ESTABLISH) \
492 _tc = tcp_half_open_connection_get (_tc_index); \
496 u32 _thread_index = vlib_get_thread_index (); \
497 _tc = tcp_connection_get (_tc_index, _thread_index); \
499 ELOG_TYPE_DECLARE (_e) = \
501 .format = "timer-pop: %s (%d)", \
502 .format_args = "t4i4", \
503 .n_enum_strings = 7, \
516 DECLARE_ETD(_tc, _e, 2); \
517 ed->data[0] = _timer_id; \
518 ed->data[1] = _timer_id; \
522 clib_warning ("pop %d for unexisting connection %d", _timer_id, \
527 #define TCP_EVT_SEG_INVALID_HANDLER(_tc, _seq, _end, ...) \
529 ELOG_TYPE_DECLARE (_e) = \
531 .format = "seg-inv: seq %u end %u rcv_las %u rcv_nxt %u rcv_wnd %u",\
532 .format_args = "i4i4i4i4i4", \
534 DECLARE_ETD(_tc, _e, 5); \
535 ed->data[0] = _seq - _tc->irs; \
536 ed->data[1] = _end - _tc->irs; \
537 ed->data[2] = _tc->rcv_las - _tc->irs; \
538 ed->data[3] = _tc->rcv_nxt - _tc->irs; \
539 ed->data[4] = _tc->rcv_wnd; \
542 #define TCP_EVT_PAWS_FAIL_HANDLER(_tc, _seq, _end, ...) \
544 ELOG_TYPE_DECLARE (_e) = \
546 .format = "paws-err: seq %u end %u tsval %u tsval_recent %u", \
547 .format_args = "i4i4i4i4", \
549 DECLARE_ETD(_tc, _e, 4); \
550 ed->data[0] = _seq - _tc->irs; \
551 ed->data[1] = _end - _tc->irs; \
552 ed->data[2] = _tc->rcv_opts.tsval; \
553 ed->data[3] = _tc->tsval_recent; \
556 #define TCP_EVT_ACK_RCV_ERR_HANDLER(_tc, _type, _ack, ...) \
558 ELOG_TYPE_DECLARE (_e) = \
560 .format = "ack-err: %s ack %u snd_una %u snd_nxt %u una_max %u", \
561 .format_args = "t4i4i4i4i4", \
562 .n_enum_strings = 3, \
569 DECLARE_ETD(_tc, _e, 5); \
570 ed->data[0] = _type; \
571 ed->data[1] = _ack - _tc->iss; \
572 ed->data[2] = _tc->snd_una - _tc->iss; \
573 ed->data[3] = _tc->snd_nxt - _tc->iss; \
574 ed->data[4] = _tc->snd_una_max - _tc->iss; \
577 #define TCP_EVT_RCV_WND_SHRUNK_HANDLER(_tc, _obs, _av, ...) \
581 ELOG_TYPE_DECLARE (_e) = \
583 .format = "huh?: rcv_wnd %u obsd %u av %u rcv_nxt %u rcv_las %u", \
584 .format_args = "i4i4i4i4i4", \
586 DECLARE_ETD(_tc, _e, 5); \
587 ed->data[0] = _tc->rcv_wnd; \
588 ed->data[1] = _obs; \
590 ed->data[3] = _tc->rcv_nxt - _tc->irs; \
591 ed->data[4] = _tc->rcv_las - _tc->irs; \
595 #define TCP_EVT_ACK_SENT_HANDLER(_tc, ...)
596 #define TCP_EVT_DUPACK_SENT_HANDLER(_tc, ...)
597 #define TCP_EVT_ACK_RCVD_HANDLER(_tc, ...)
598 #define TCP_EVT_DUPACK_RCVD_HANDLER(_tc, ...)
599 #define TCP_EVT_PKTIZE_HANDLER(_tc, ...)
600 #define TCP_EVT_INPUT_HANDLER(_tc, _type, _len, _written, ...)
601 #define TCP_EVT_TIMER_POP_HANDLER(_tc_index, _timer_id, ...)
602 #define TCP_EVT_SEG_INVALID_HANDLER(_tc, _seq, _end, ...)
603 #define TCP_EVT_PAWS_FAIL_HANDLER(_tc, _seq, _end, ...)
604 #define TCP_EVT_ACK_RCV_ERR_HANDLER(_tc, _type, _ack, ...)
605 #define TCP_EVT_RCV_WND_SHRUNK_HANDLER(_tc, _obs, _av, ...)
609 * State machine verbose
612 #define TCP_EVT_SND_WND_HANDLER(_tc, ...) \
614 ELOG_TYPE_DECLARE (_e) = \
616 .format = "snd-wnd update: %u ", \
617 .format_args = "i4", \
619 DECLARE_ETD(_tc, _e, 1); \
620 ed->data[0] = _tc->snd_wnd; \
623 #define TCP_EVT_OUTPUT_HANDLER(_tc, flags, n_bytes,...) \
625 ELOG_TYPE_DECLARE (_e) = \
627 .format = "out: flags %x, bytes %u", \
628 .format_args = "i4i4", \
630 DECLARE_ETD(_tc, _e, 2); \
631 ed->data[0] = flags; \
632 ed->data[1] = n_bytes; \
635 #define TCP_EVT_SND_WND_HANDLER(_tc, ...)
636 #define TCP_EVT_OUTPUT_HANDLER(_tc, flags, n_bytes,...)
644 #define TCP_EVT_CC_RTX_HANDLER(_tc, offset, n_bytes, ...) \
646 ELOG_TYPE_DECLARE (_e) = \
648 .format = "rxt: snd_nxt %u offset %u snd %u rxt %u", \
649 .format_args = "i4i4i4i4", \
651 DECLARE_ETD(_tc, _e, 4); \
652 ed->data[0] = _tc->snd_nxt - _tc->iss; \
653 ed->data[1] = offset; \
654 ed->data[2] = n_bytes; \
655 ed->data[3] = _tc->snd_rxt_bytes; \
658 #define TCP_EVT_CC_EVT_HANDLER(_tc, _sub_evt, ...) \
660 ELOG_TYPE_DECLARE (_e) = \
662 .format = "cc: %s wnd %u snd_cong %u rxt_bytes %u", \
663 .format_args = "t4i4i4i4", \
664 .n_enum_strings = 5, \
673 DECLARE_ETD(_tc, _e, 4); \
674 ed->data[0] = _sub_evt; \
675 ed->data[1] = tcp_available_snd_space (_tc); \
676 ed->data[2] = _tc->snd_congestion - _tc->iss; \
677 ed->data[3] = _tc->snd_rxt_bytes; \
680 #define TCP_EVT_CC_PACK_HANDLER(_tc, ...) \
682 ELOG_TYPE_DECLARE (_e) = \
684 .format = "pack: snd_una %u snd_una_max %u", \
685 .format_args = "i4i4", \
687 DECLARE_ETD(_tc, _e, 2); \
688 ed->data[0] = _tc->snd_una - _tc->iss; \
689 ed->data[1] = _tc->snd_una_max - _tc->iss; \
693 * Congestion control stats
695 #if TCP_DEBUG_CC_STAT
697 #define STATS_INTERVAL 1
699 #define TCP_EVT_CC_RTO_STAT_HANDLER(_tc, ...) \
701 if (_tc->c_cc_stat_tstamp + STATS_INTERVAL < tcp_time_now()) \
703 ELOG_TYPE_DECLARE (_e) = \
705 .format = "rto_stat: rto %u srtt %u rttvar %u ", \
706 .format_args = "i4i4i4", \
708 DECLARE_ETD(_tc, _e, 3); \
709 ed->data[0] = _tc->rto; \
710 ed->data[1] = _tc->srtt; \
711 ed->data[2] = _tc->rttvar; \
715 #define TCP_EVT_CC_STAT_HANDLER(_tc, ...) \
717 if (_tc->c_cc_stat_tstamp + STATS_INTERVAL < tcp_time_now()) \
719 ELOG_TYPE_DECLARE (_e) = \
721 .format = "cc_stat: cwnd %u flight %u space %u ssthresh %u snd_wnd %u",\
722 .format_args = "i4i4i4i4i4", \
724 DECLARE_ETD(_tc, _e, 5); \
725 ed->data[0] = _tc->cwnd; \
726 ed->data[1] = tcp_flight_size (_tc); \
727 ed->data[2] = tcp_snd_space (_tc); \
728 ed->data[3] = _tc->ssthresh; \
729 ed->data[4] = _tc->snd_wnd; \
730 TCP_EVT_CC_RTO_STAT_HANDLER (_tc); \
731 _tc->c_cc_stat_tstamp = tcp_time_now(); \
736 #define TCP_EVT_CC_STAT_HANDLER(_tc, ...)
740 #define TCP_EVT_CC_RTX_HANDLER(_tc, offset, n_bytes, ...)
741 #define TCP_EVT_CC_EVT_HANDLER(_tc, _sub_evt, ...)
742 #define TCP_EVT_CC_PACK_HANDLER(_tc, ...)
743 #define TCP_EVT_CC_STAT_HANDLER(_tc, ...)
746 #endif /* SRC_VNET_TCP_TCP_DEBUG_H_ */
748 * fd.io coding-style-patch-verification: ON
751 * eval: (c-set-style "gnu")