16 #ifndef SRC_VNET_TCP_TCP_DEBUG_H_ 17 #define SRC_VNET_TCP_TCP_DEBUG_H_ 22 #define TCP_DEBUG_SM (0) 23 #define TCP_DEBUG_CC (0) 24 #define TCP_DEBUG_CC_STAT (1) 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) 85 #define TCP_DBG(_fmt, _args...) clib_warning (_fmt, ##_args) 87 #define DECLARE_ETD(_tc, _e, _size) \ 92 ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, \ 93 _e, _tc->c_elog_track) 95 #define TCP_DBG_IP_TAG_LCL(_tc) \ 99 ELOG_TYPE_DECLARE (_e) = \ 101 .format = "lcl: %d.%d.%d.%d:%d", \ 102 .format_args = "i4i4i4i4i4", \ 104 DECLARE_ETD(_tc, _e, 5); \ 105 ed->data[0] = _tc->c_lcl_ip.ip4.as_u8[0]; \ 106 ed->data[1] = _tc->c_lcl_ip.ip4.as_u8[1]; \ 107 ed->data[2] = _tc->c_lcl_ip.ip4.as_u8[2]; \ 108 ed->data[3] = _tc->c_lcl_ip.ip4.as_u8[3]; \ 109 ed->data[4] = clib_net_to_host_u16(_tc->c_lcl_port); \ 113 #define TCP_DBG_IP_TAG_RMT(_tc) \ 117 ELOG_TYPE_DECLARE (_e) = \ 119 .format = "rmt: %d.%d.%d.%d:%d", \ 120 .format_args = "i4i4i4i4i4", \ 122 DECLARE_ETD(_tc, _e, 5); \ 123 ed->data[0] = _tc->c_rmt_ip.ip4.as_u8[0]; \ 124 ed->data[1] = _tc->c_rmt_ip.ip4.as_u8[1]; \ 125 ed->data[2] = _tc->c_rmt_ip.ip4.as_u8[2]; \ 126 ed->data[3] = _tc->c_rmt_ip.ip4.as_u8[3]; \ 127 ed->data[4] = clib_net_to_host_u16(_tc->c_rmt_port); \ 131 #define TCP_EVT_INIT_HANDLER(_tc, _is_l, ...) \ 133 char *_fmt = _is_l ? "l[%d].%d:%d%c" : "[%d].%d:%d->.%d:%d%c"; \ 136 _tc->c_elog_track.name = \ 137 (char *) format (0, _fmt, _tc->c_thread_index, \ 138 _tc->c_lcl_ip.ip4.as_u8[3], \ 139 clib_net_to_host_u16(_tc->c_lcl_port), \ 140 _tc->c_rmt_ip.ip4.as_u8[3], \ 141 clib_net_to_host_u16(_tc->c_rmt_port), 0); \ 144 _tc->c_elog_track.name = \ 145 (char *) format (0, _fmt, _tc->c_thread_index, \ 146 _tc->c_lcl_ip.ip6.as_u8[15], \ 147 clib_net_to_host_u16(_tc->c_lcl_port), \ 148 _tc->c_rmt_ip.ip6.as_u8[15], \ 149 clib_net_to_host_u16(_tc->c_rmt_port), 0); \ 150 elog_track_register (&vlib_global_main.elog_main, &_tc->c_elog_track);\ 151 TCP_DBG_IP_TAG_LCL(_tc); \ 152 TCP_DBG_IP_TAG_RMT(_tc); \ 155 #define TCP_EVT_DEALLOC_HANDLER(_tc, ...) \ 157 vec_free (_tc->c_elog_track.name); \ 160 #define TCP_EVT_OPEN_HANDLER(_tc, ...) \ 162 TCP_EVT_INIT_HANDLER(_tc, 0); \ 163 ELOG_TYPE_DECLARE (_e) = \ 165 .format = "open: index %d", \ 166 .format_args = "i4", \ 168 DECLARE_ETD(_tc, _e, 1); \ 169 ed->data[0] = _tc->c_c_index; \ 172 #define TCP_EVT_CLOSE_HANDLER(_tc, ...) \ 174 ELOG_TYPE_DECLARE (_e) = \ 176 .format = "close: %d", \ 177 .format_args = "i4", \ 179 DECLARE_ETD(_tc, _e, 1); \ 180 ed->data[0] = _tc->c_c_index; \ 183 #define TCP_EVT_BIND_HANDLER(_tc, ...) \ 185 TCP_EVT_INIT_HANDLER(_tc, 1); \ 186 ELOG_TYPE_DECLARE (_e) = \ 188 .format = "bind: listener %d", \ 190 DECLARE_ETD(_tc, _e, 1); \ 191 ed->data[0] = _tc->c_c_index; \ 194 #define TCP_EVT_SYN_RCVD_HANDLER(_tc,_init, ...) \ 197 TCP_EVT_INIT_HANDLER(_tc, 0); \ 198 ELOG_TYPE_DECLARE (_e) = \ 200 .format = "syn-rx: irs %u", \ 201 .format_args = "i4", \ 203 DECLARE_ETD(_tc, _e, 1); \ 204 ed->data[0] = _tc->irs; \ 205 TCP_EVT_STATE_CHANGE_HANDLER(_tc); \ 208 #define TCP_EVT_UNBIND_HANDLER(_tc, ...) \ 210 TCP_EVT_DEALLOC_HANDLER(_tc); \ 211 ELOG_TYPE_DECLARE (_e) = \ 213 .format = "unbind: listener %d", \ 215 DECLARE_ETD(_tc, _e, 1); \ 216 ed->data[0] = _tc->c_c_index; \ 217 TCP_EVT_DEALLOC_HANDLER(_tc); \ 220 #define TCP_EVT_DELETE_HANDLER(_tc, ...) \ 222 ELOG_TYPE_DECLARE (_e) = \ 224 .format = "delete: %d", \ 225 .format_args = "i4", \ 227 DECLARE_ETD(_tc, _e, 1); \ 228 ed->data[0] = _tc->c_c_index; \ 229 TCP_EVT_DEALLOC_HANDLER(_tc); \ 232 #define CONCAT_HELPER(_a, _b) _a##_b 233 #define CC(_a, _b) CONCAT_HELPER(_a, _b) 234 #define TCP_EVT_DBG(_evt, _args...) CC(_evt, _HANDLER)(_args) 236 #define TCP_EVT_DBG(_evt, _args...) 237 #define TCP_DBG(_fmt, _args...) 245 #define TCP_EVT_STATE_CHANGE_HANDLER(_tc, ...) \ 247 ELOG_TYPE_DECLARE (_e) = \ 249 .format = "state: %s", \ 250 .format_args = "t4", \ 251 .n_enum_strings = 11, \ 266 DECLARE_ETD(_tc, _e, 1); \ 267 ed->data[0] = _tc->state; \ 270 #define TCP_EVT_SYN_SENT_HANDLER(_tc, ...) \ 272 ELOG_TYPE_DECLARE (_e) = \ 274 .format = "syn-tx: iss %u snd_una %u snd_una_max %u snd_nxt %u", \ 275 .format_args = "i4i4i4i4", \ 277 DECLARE_ETD(_tc, _e, 4); \ 278 ed->data[0] = _tc->iss; \ 279 ed->data[1] = _tc->snd_una - _tc->iss; \ 280 ed->data[2] = _tc->snd_una_max - _tc->iss; \ 281 ed->data[3] = _tc->snd_nxt - _tc->iss; \ 282 TCP_EVT_STATE_CHANGE_HANDLER(_tc); \ 285 #define TCP_EVT_SYNACK_SENT_HANDLER(_tc, ...) \ 287 ELOG_TYPE_DECLARE (_e) = \ 289 .format = "synack-tx: iss %u irs %u snd_una %u snd_nxt %u rcv_nxt %u",\ 290 .format_args = "i4i4i4i4i4", \ 292 DECLARE_ETD(_tc, _e, 5); \ 293 ed->data[0] = _tc->iss; \ 294 ed->data[1] = _tc->irs; \ 295 ed->data[2] = _tc->snd_una - _tc->iss; \ 296 ed->data[3] = _tc->snd_nxt - _tc->iss; \ 297 ed->data[4] = _tc->rcv_nxt - _tc->irs; \ 300 #define TCP_EVT_SYNACK_RCVD_HANDLER(_tc, ...) \ 302 ELOG_TYPE_DECLARE (_e) = \ 304 .format = "synack-rx: iss %u irs %u snd_una %u snd_nxt %u rcv_nxt %u",\ 305 .format_args = "i4i4i4i4i4", \ 307 DECLARE_ETD(_tc, _e, 5); \ 308 ed->data[0] = _tc->iss; \ 309 ed->data[1] = _tc->irs; \ 310 ed->data[2] = _tc->snd_una - _tc->iss; \ 311 ed->data[3] = _tc->snd_nxt - _tc->iss; \ 312 ed->data[4] = _tc->rcv_nxt - _tc->irs; \ 313 TCP_EVT_STATE_CHANGE_HANDLER(_tc); \ 316 #define TCP_EVT_FIN_SENT_HANDLER(_tc, ...) \ 318 ELOG_TYPE_DECLARE (_e) = \ 320 .format = "fin-tx: snd_nxt %d rcv_nxt %d", \ 321 .format_args = "i4i4", \ 323 DECLARE_ETD(_tc, _e, 2); \ 324 ed->data[0] = _tc->snd_nxt - _tc->iss; \ 325 ed->data[1] = _tc->rcv_nxt - _tc->irs; \ 328 #define TCP_EVT_RST_SENT_HANDLER(_tc, ...) \ 330 ELOG_TYPE_DECLARE (_e) = \ 332 .format = "rst-tx: snd_nxt %d rcv_nxt %d", \ 333 .format_args = "i4i4", \ 335 DECLARE_ETD(_tc, _e, 2); \ 336 ed->data[0] = _tc->snd_nxt - _tc->iss; \ 337 ed->data[1] = _tc->rcv_nxt - _tc->irs; \ 338 TCP_EVT_STATE_CHANGE_HANDLER(_tc); \ 341 #define TCP_EVT_FIN_RCVD_HANDLER(_tc, ...) \ 343 ELOG_TYPE_DECLARE (_e) = \ 345 .format = "fin-rx: snd_nxt %d rcv_nxt %d", \ 346 .format_args = "i4i4", \ 348 DECLARE_ETD(_tc, _e, 2); \ 349 ed->data[0] = _tc->snd_nxt - _tc->iss; \ 350 ed->data[1] = _tc->rcv_nxt - _tc->irs; \ 353 #define TCP_EVT_RST_RCVD_HANDLER(_tc, ...) \ 355 ELOG_TYPE_DECLARE (_e) = \ 357 .format = "rst-rx: snd_nxt %d rcv_nxt %d", \ 358 .format_args = "i4i4", \ 360 DECLARE_ETD(_tc, _e, 2); \ 361 ed->data[0] = _tc->snd_nxt - _tc->iss; \ 362 ed->data[1] = _tc->rcv_nxt - _tc->irs; \ 365 #define TCP_EVT_SYN_RXT_HANDLER(_tc, _type, ...) \ 367 ELOG_TYPE_DECLARE (_e) = \ 369 .format = "%s-rxt: iss %u irs %u snd_nxt %u rcv_nxt %u", \ 370 .format_args = "t4i4i4i4i4", \ 371 .n_enum_strings = 2, \ 377 DECLARE_ETD(_tc, _e, 5); \ 378 ed->data[0] = _type; \ 379 ed->data[1] = _tc->iss; \ 380 ed->data[2] = _tc->irs; \ 381 ed->data[3] = _tc->snd_nxt - _tc->iss; \ 382 ed->data[4] = _tc->rcv_nxt - _tc->irs; \ 386 #define TCP_EVT_SYN_SENT_HANDLER(_tc, ...) 387 #define TCP_EVT_SYNACK_SENT_HANDLER(_tc, ...) 388 #define TCP_EVT_SYNACK_RCVD_HANDLER(_tc, ...) 389 #define TCP_EVT_SYN_RXT_HANDLER(_tc, ...) 390 #define TCP_EVT_FIN_SENT_HANDLER(_tc, ...) 391 #define TCP_EVT_RST_SENT_HANDLER(_tc, ...) 392 #define TCP_EVT_FIN_RCVD_HANDLER(_tc, ...) 393 #define TCP_EVT_RST_RCVD_HANDLER(_tc, ...) 394 #define TCP_EVT_STATE_CHANGE_HANDLER(_tc, ...) 399 #define TCP_EVT_ACK_SENT_HANDLER(_tc, ...) \ 401 ELOG_TYPE_DECLARE (_e) = \ 403 .format = "ack-tx: acked %u rcv_nxt %u rcv_wnd %u snd_nxt %u snd_wnd %u",\ 404 .format_args = "i4i4i4i4i4", \ 406 DECLARE_ETD(_tc, _e, 5); \ 407 ed->data[0] = _tc->rcv_nxt - _tc->rcv_las; \ 408 ed->data[1] = _tc->rcv_nxt - _tc->irs; \ 409 ed->data[2] = _tc->rcv_wnd; \ 410 ed->data[3] = _tc->snd_nxt - _tc->iss; \ 411 ed->data[4] = _tc->snd_wnd; \ 414 #define TCP_EVT_ACK_RCVD_HANDLER(_tc, ...) \ 416 ELOG_TYPE_DECLARE (_e) = \ 418 .format = "ack-rx: %u snd_una %u snd_wnd %u cwnd %u inflight %u", \ 419 .format_args = "i4i4i4i4i4", \ 421 DECLARE_ETD(_tc, _e, 5); \ 422 ed->data[0] = _tc->bytes_acked; \ 423 ed->data[1] = _tc->snd_una - _tc->iss; \ 424 ed->data[2] = _tc->snd_wnd; \ 425 ed->data[3] = _tc->cwnd; \ 426 ed->data[4] = tcp_flight_size(_tc); \ 429 #define TCP_EVT_PKTIZE_HANDLER(_tc, ...) \ 431 ELOG_TYPE_DECLARE (_e) = \ 433 .format = "tx: una %u snd_nxt %u space %u flight %u rcv_wnd %u",\ 434 .format_args = "i4i4i4i4i4", \ 436 DECLARE_ETD(_tc, _e, 5); \ 437 ed->data[0] = _tc->snd_una - _tc->iss; \ 438 ed->data[1] = _tc->snd_nxt - _tc->iss; \ 439 ed->data[2] = tcp_available_output_snd_space (_tc); \ 440 ed->data[3] = tcp_flight_size (_tc); \ 441 ed->data[4] = _tc->rcv_wnd; \ 444 #define TCP_EVT_INPUT_HANDLER(_tc, _type, _len, _written, ...) \ 446 ELOG_TYPE_DECLARE (_e) = \ 448 .format = "in: %s len %u written %d rcv_nxt %u rcv_wnd(o) %d", \ 449 .format_args = "t4i4i4i4i4", \ 450 .n_enum_strings = 2, \ 456 DECLARE_ETD(_tc, _e, 5); \ 457 ed->data[0] = _type; \ 458 ed->data[1] = _len; \ 459 ed->data[2] = _written; \ 460 ed->data[3] = (_tc->rcv_nxt - _tc->irs) + _written; \ 461 ed->data[4] = _tc->rcv_wnd - (_tc->rcv_nxt - _tc->rcv_las); \ 464 #define TCP_EVT_TIMER_POP_HANDLER(_tc_index, _timer_id, ...) \ 466 tcp_connection_t *_tc; \ 467 if (_timer_id == TCP_TIMER_RETRANSMIT_SYN \ 468 || _timer_id == TCP_TIMER_ESTABLISH) \ 470 _tc = tcp_half_open_connection_get (_tc_index); \ 474 u32 _thread_index = vlib_get_thread_index (); \ 475 _tc = tcp_connection_get (_tc_index, _thread_index); \ 477 ELOG_TYPE_DECLARE (_e) = \ 479 .format = "timer-pop: %s (%d)", \ 480 .format_args = "t4i4", \ 481 .n_enum_strings = 7, \ 494 DECLARE_ETD(_tc, _e, 2); \ 495 ed->data[0] = _timer_id; \ 496 ed->data[1] = _timer_id; \ 500 clib_warning ("pop %d for unexisting connection %d", _timer_id, \ 505 #define TCP_EVT_SEG_INVALID_HANDLER(_tc, _seq, _end, ...) \ 507 ELOG_TYPE_DECLARE (_e) = \ 509 .format = "seg-inv: seq %u end %u rcv_las %u rcv_nxt %u rcv_wnd %u",\ 510 .format_args = "i4i4i4i4i4", \ 512 DECLARE_ETD(_tc, _e, 5); \ 513 ed->data[0] = _seq - _tc->irs; \ 514 ed->data[1] = _end - _tc->irs; \ 515 ed->data[2] = _tc->rcv_las - _tc->irs; \ 516 ed->data[3] = _tc->rcv_nxt - _tc->irs; \ 517 ed->data[4] = _tc->rcv_wnd; \ 520 #define TCP_EVT_PAWS_FAIL_HANDLER(_tc, _seq, _end, ...) \ 522 ELOG_TYPE_DECLARE (_e) = \ 524 .format = "paws-err: seq %u end %u tsval %u tsval_recent %u", \ 525 .format_args = "i4i4i4i4", \ 527 DECLARE_ETD(_tc, _e, 4); \ 528 ed->data[0] = _seq - _tc->irs; \ 529 ed->data[1] = _end - _tc->irs; \ 530 ed->data[2] = _tc->rcv_opts.tsval; \ 531 ed->data[3] = _tc->tsval_recent; \ 534 #define TCP_EVT_ACK_RCV_ERR_HANDLER(_tc, _type, _ack, ...) \ 536 ELOG_TYPE_DECLARE (_e) = \ 538 .format = "ack-err: %s ack %u snd_una %u snd_nxt %u una_max %u", \ 539 .format_args = "t4i4i4i4i4", \ 540 .n_enum_strings = 3, \ 547 DECLARE_ETD(_tc, _e, 5); \ 548 ed->data[0] = _type; \ 549 ed->data[1] = _ack - _tc->iss; \ 550 ed->data[2] = _tc->snd_una - _tc->iss; \ 551 ed->data[3] = _tc->snd_nxt - _tc->iss; \ 552 ed->data[4] = _tc->snd_una_max - _tc->iss; \ 555 #define TCP_EVT_RCV_WND_SHRUNK_HANDLER(_tc, _obs, _av, ...) \ 559 ELOG_TYPE_DECLARE (_e) = \ 561 .format = "huh?: rcv_wnd %u obsd %u av %u rcv_nxt %u rcv_las %u", \ 562 .format_args = "i4i4i4i4i4", \ 564 DECLARE_ETD(_tc, _e, 5); \ 565 ed->data[0] = _tc->rcv_wnd; \ 566 ed->data[1] = _obs; \ 568 ed->data[3] = _tc->rcv_nxt - _tc->irs; \ 569 ed->data[4] = _tc->rcv_las - _tc->irs; \ 573 #define TCP_EVT_ACK_SENT_HANDLER(_tc, ...) 574 #define TCP_EVT_ACK_RCVD_HANDLER(_tc, ...) 575 #define TCP_EVT_PKTIZE_HANDLER(_tc, ...) 576 #define TCP_EVT_INPUT_HANDLER(_tc, _type, _len, _written, ...) 577 #define TCP_EVT_TIMER_POP_HANDLER(_tc_index, _timer_id, ...) 578 #define TCP_EVT_SEG_INVALID_HANDLER(_tc, _seq, _end, ...) 579 #define TCP_EVT_PAWS_FAIL_HANDLER(_tc, _seq, _end, ...) 580 #define TCP_EVT_ACK_RCV_ERR_HANDLER(_tc, _type, _ack, ...) 581 #define TCP_EVT_RCV_WND_SHRUNK_HANDLER(_tc, _obs, _av, ...) 588 #define TCP_EVT_SND_WND_HANDLER(_tc, ...) \ 590 ELOG_TYPE_DECLARE (_e) = \ 592 .format = "snd-wnd update: %u ", \ 593 .format_args = "i4", \ 595 DECLARE_ETD(_tc, _e, 1); \ 596 ed->data[0] = _tc->snd_wnd; \ 599 #define TCP_EVT_OUTPUT_HANDLER(_tc, flags, n_bytes,...) \ 601 ELOG_TYPE_DECLARE (_e) = \ 603 .format = "out: flags %x, bytes %u", \ 604 .format_args = "i4i4", \ 606 DECLARE_ETD(_tc, _e, 2); \ 607 ed->data[0] = flags; \ 608 ed->data[1] = n_bytes; \ 611 #define TCP_EVT_SND_WND_HANDLER(_tc, ...) 612 #define TCP_EVT_OUTPUT_HANDLER(_tc, flags, n_bytes,...) 621 #define TCP_EVT_CC_EVT_HANDLER(_tc, _sub_evt, ...) \ 623 ELOG_TYPE_DECLARE (_e) = \ 625 .format = "cc: %s wnd %u snd_cong %u rxt_bytes %u", \ 626 .format_args = "t4i4i4i4", \ 627 .n_enum_strings = 6, \ 637 DECLARE_ETD(_tc, _e, 4); \ 638 ed->data[0] = _sub_evt; \ 639 ed->data[1] = tcp_available_snd_space (_tc); \ 640 ed->data[2] = _tc->snd_congestion - _tc->iss; \ 641 ed->data[3] = _tc->snd_rxt_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_DUPACK_SENT_HANDLER(_tc, ...) \ 660 ELOG_TYPE_DECLARE (_e) = \ 662 .format = "dack-tx: rcv_nxt %u rcv_wnd %u snd_nxt %u av_wnd %u snd_wnd %u",\ 663 .format_args = "i4i4i4i4i4", \ 665 DECLARE_ETD(_tc, _e, 5); \ 666 ed->data[0] = _tc->rcv_nxt - _tc->irs; \ 667 ed->data[1] = _tc->rcv_wnd; \ 668 ed->data[2] = _tc->snd_nxt - _tc->iss; \ 669 ed->data[3] = tcp_available_snd_wnd(_tc); \ 670 ed->data[4] = _tc->snd_wnd; \ 673 #define TCP_EVT_DUPACK_RCVD_HANDLER(_tc, ...) \ 675 ELOG_TYPE_DECLARE (_e) = \ 677 .format = "dack-rx: snd_una %u cwnd %u snd_wnd %u flight %u rcv_wnd %u",\ 678 .format_args = "i4i4i4i4i4", \ 680 DECLARE_ETD(_tc, _e, 5); \ 681 ed->data[0] = _tc->snd_una - _tc->iss; \ 682 ed->data[1] = _tc->cwnd; \ 683 ed->data[2] = _tc->snd_wnd; \ 684 ed->data[3] = tcp_flight_size(_tc); \ 685 ed->data[4] = _tc->rcv_wnd; \ 688 #define TCP_EVT_CC_PACK_HANDLER(_tc, ...) \ 690 ELOG_TYPE_DECLARE (_e) = \ 692 .format = "pack: snd_una %u snd_una_max %u", \ 693 .format_args = "i4i4", \ 695 DECLARE_ETD(_tc, _e, 2); \ 696 ed->data[0] = _tc->snd_una - _tc->iss; \ 697 ed->data[1] = _tc->snd_una_max - _tc->iss; \ 700 #define TCP_EVT_CC_RTX_HANDLER(_tc, offset, n_bytes, ...) 701 #define TCP_EVT_DUPACK_SENT_HANDLER(_tc, ...) 702 #define TCP_EVT_DUPACK_RCVD_HANDLER(_tc, ...) 703 #define TCP_EVT_CC_PACK_HANDLER(_tc, ...) 704 #define TCP_EVT_CC_EVT_HANDLER(_tc, _sub_evt, ...) 710 #if TCP_DEBUG_CC_STAT 712 #define STATS_INTERVAL 1 714 #define TCP_EVT_CC_RTO_STAT_HANDLER(_tc, ...) \ 716 if (_tc->c_cc_stat_tstamp + STATS_INTERVAL < tcp_time_now()) \ 718 ELOG_TYPE_DECLARE (_e) = \ 720 .format = "rto_stat: rto %u srtt %u rttvar %u ", \ 721 .format_args = "i4i4i4", \ 723 DECLARE_ETD(_tc, _e, 3); \ 724 ed->data[0] = _tc->rto; \ 725 ed->data[1] = _tc->srtt; \ 726 ed->data[2] = _tc->rttvar; \ 730 #define TCP_EVT_CC_STAT_HANDLER(_tc, ...) \ 732 if (_tc->c_cc_stat_tstamp + STATS_INTERVAL < tcp_time_now()) \ 734 ELOG_TYPE_DECLARE (_e) = \ 736 .format = "cc_stat: cwnd %u flight %u space %u ssthresh %u snd_wnd %u",\ 737 .format_args = "i4i4i4i4i4", \ 739 DECLARE_ETD(_tc, _e, 5); \ 740 ed->data[0] = _tc->cwnd; \ 741 ed->data[1] = tcp_flight_size (_tc); \ 742 ed->data[2] = tcp_snd_space (_tc); \ 743 ed->data[3] = _tc->ssthresh; \ 744 ed->data[4] = _tc->snd_wnd; \ 745 TCP_EVT_CC_RTO_STAT_HANDLER (_tc); \ 746 _tc->c_cc_stat_tstamp = tcp_time_now(); \ 751 #define TCP_EVT_CC_STAT_HANDLER(_tc, ...)
#define foreach_tcp_dbg_evt
enum _tcp_dbg_evt tcp_dbg_evt_e