FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
tcp_debug.h File Reference
+ Include dependency graph for tcp_debug.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TCP_DEBUG   (1)
 
#define TCP_DEBUG_SM   (0)
 
#define TCP_DEBUG_CC   (0)
 
#define TCP_DEBUG_CC_STAT   (0)
 
#define TCP_DEBUG_BUFFER_ALLOCATION   (0)
 
#define foreach_tcp_dbg_evt
 
#define TRANSPORT_DEBUG   (1)
 
#define TCP_DBG(_fmt, _args...)   clib_warning (_fmt, ##_args)
 
#define DECLARE_ETD(_tc, _e, _size)
 
#define TCP_DBG_IP_TAG_LCL(_tc)
 
#define TCP_DBG_IP_TAG_RMT(_tc)
 
#define TCP_EVT_INIT_HANDLER(_tc, _is_l, ...)
 
#define TCP_EVT_DEALLOC_HANDLER(_tc, ...)
 
#define TCP_EVT_OPEN_HANDLER(_tc, ...)
 
#define TCP_EVT_CLOSE_HANDLER(_tc, ...)
 
#define TCP_EVT_BIND_HANDLER(_tc, ...)
 
#define TCP_EVT_SYN_RCVD_HANDLER(_tc, _init, ...)
 
#define TCP_EVT_UNBIND_HANDLER(_tc, ...)
 
#define TCP_EVT_DELETE_HANDLER(_tc, ...)
 
#define CONCAT_HELPER(_a, _b)   _a##_b
 
#define CC(_a, _b)   CONCAT_HELPER(_a, _b)
 
#define TCP_EVT_DBG(_evt, _args...)   CC(_evt, _HANDLER)(_args)
 
#define TCP_EVT_SYN_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_SYNACK_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_SYNACK_RCVD_HANDLER(_tc, ...)
 
#define TCP_EVT_SYN_RXT_HANDLER(_tc, ...)
 
#define TCP_EVT_FIN_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_RST_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_FIN_RCVD_HANDLER(_tc, ...)
 
#define TCP_EVT_RST_RCVD_HANDLER(_tc, ...)
 
#define TCP_EVT_STATE_CHANGE_HANDLER(_tc, ...)
 
#define TCP_EVT_TIMER_POP_HANDLER(_tc_index, _timer_id, ...)
 
#define TCP_EVT_SEG_INVALID_HANDLER(_tc, _btcp, ...)
 
#define TCP_EVT_PAWS_FAIL_HANDLER(_tc, _seq, _end, ...)
 
#define TCP_EVT_ACK_RCV_ERR_HANDLER(_tc, _type, _ack, ...)
 
#define TCP_EVT_RCV_WND_SHRUNK_HANDLER(_tc, _obs, _av, ...)
 
#define TCP_EVT_ACK_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_ACK_RCVD_HANDLER(_tc, ...)
 
#define TCP_EVT_PKTIZE_HANDLER(_tc, ...)
 
#define TCP_EVT_INPUT_HANDLER(_tc, _type, _len, _written, ...)
 
#define TCP_EVT_SND_WND_HANDLER(_tc, ...)
 
#define TCP_EVT_OUTPUT_HANDLER(_tc, flags, n_bytes, ...)
 
#define TCP_EVT_CC_EVT_HANDLER(_tc, _sub_evt, ...)
 
#define TCP_EVT_CC_RTX_HANDLER(_tc, offset, n_bytes, ...)
 
#define TCP_EVT_DUPACK_SENT_HANDLER(_tc, _btcp, ...)
 
#define TCP_EVT_DUPACK_RCVD_HANDLER(_tc, ...)
 
#define TCP_EVT_CC_PACK_HANDLER(_tc, ...)
 
#define TCP_EVT_CC_SCOREBOARD_HANDLER(_tc, ...)
 
#define TCP_EVT_CC_SACKS_HANDLER(_tc, ...)
 
#define TCP_EVT_CC_INPUT_HANDLER(_tc, _len, _written, ...)
 
#define TCP_EVT_CC_STAT_HANDLER(_tc, ...)
 
#define TCP_EVT_CC_STAT_PRINT(_tc)
 
#define TCP_DBG_BUFFER_ALLOC_MAYBE_FAIL(thread_index)
 

Typedefs

typedef enum _tcp_dbg tcp_dbg_e
 
typedef enum _tcp_dbg_evt tcp_dbg_evt_e
 

Macro Definition Documentation

◆ CC

#define CC (   _a,
  _b 
)    CONCAT_HELPER(_a, _b)

Definition at line 240 of file tcp_debug.h.

◆ CONCAT_HELPER

#define CONCAT_HELPER (   _a,
  _b 
)    _a##_b

Definition at line 239 of file tcp_debug.h.

◆ DECLARE_ETD

#define DECLARE_ETD (   _tc,
  _e,
  _size 
)
Value:
struct \
{ \
u32 data[_size]; \
} * ed; \
_e, _tc->c_elog_track)
vlib_main_t vlib_global_main
Definition: main.c:1924
u8 data[128]
Definition: ipsec.api:248
elog_main_t elog_main
Definition: main.h:172
#define ELOG_TRACK_DATA(em, f, track)
Definition: elog.h:478

Definition at line 91 of file tcp_debug.h.

◆ foreach_tcp_dbg_evt

foreach_tcp_dbg_evt
Value:
_(INIT, "") \
_(DEALLOC, "") \
_(OPEN, "open") \
_(CLOSE, "close") \
_(BIND, "bind") \
_(UNBIND, "unbind") \
_(DELETE, "delete") \
_(SYN_SENT, "SYN sent") \
_(SYNACK_SENT, "SYNACK sent") \
_(SYNACK_RCVD, "SYNACK rcvd") \
_(SYN_RXT, "SYN retransmit") \
_(FIN_SENT, "FIN sent") \
_(ACK_SENT, "ACK sent") \
_(DUPACK_SENT, "DUPACK sent") \
_(RST_SENT, "RST sent") \
_(SYN_RCVD, "SYN rcvd") \
_(ACK_RCVD, "ACK rcvd") \
_(DUPACK_RCVD, "DUPACK rcvd") \
_(FIN_RCVD, "FIN rcvd") \
_(RST_RCVD, "RST rcvd") \
_(STATE_CHANGE, "state change") \
_(PKTIZE, "packetize") \
_(INPUT, "in") \
_(SND_WND, "snd_wnd update") \
_(OUTPUT, "output") \
_(TIMER_POP, "timer pop") \
_(CC_RTX, "retransmit") \
_(CC_EVT, "cc event") \
_(CC_PACK, "cc partial ack") \
_(CC_STAT, "cc stats") \
_(CC_RTO_STAT, "cc rto stats") \
_(CC_SCOREBOARD, "scoreboard stats") \
_(CC_SACKS, "snd sacks stats") \
_(CC_INPUT, "ooo data delivered") \
_(SEG_INVALID, "invalid segment") \
_(PAWS_FAIL, "failed paws check") \
_(ACK_RCV_ERR, "invalid ack") \
_(RCV_WND_SHRUNK, "shrunk rcv_wnd") \

Definition at line 27 of file tcp_debug.h.

◆ TCP_DBG

#define TCP_DBG (   _fmt,
  _args... 
)    clib_warning (_fmt, ##_args)

Definition at line 89 of file tcp_debug.h.

◆ TCP_DBG_BUFFER_ALLOC_MAYBE_FAIL

#define TCP_DBG_BUFFER_ALLOC_MAYBE_FAIL (   thread_index)

Definition at line 919 of file tcp_debug.h.

◆ TCP_DBG_IP_TAG_LCL

#define TCP_DBG_IP_TAG_LCL (   _tc)
Value:
{ \
if (_tc->c_is_ip4) \
{ \
ELOG_TYPE_DECLARE (_e) = \
{ \
.format = "lcl: %d.%d.%d.%d:%d", \
.format_args = "i4i4i4i4i4", \
}; \
DECLARE_ETD(_tc, _e, 5); \
ed->data[0] = _tc->c_lcl_ip.ip4.as_u8[0]; \
ed->data[1] = _tc->c_lcl_ip.ip4.as_u8[1]; \
ed->data[2] = _tc->c_lcl_ip.ip4.as_u8[2]; \
ed->data[3] = _tc->c_lcl_ip.ip4.as_u8[3]; \
ed->data[4] = clib_net_to_host_u16(_tc->c_lcl_port); \
} \
}

Definition at line 99 of file tcp_debug.h.

◆ TCP_DBG_IP_TAG_RMT

#define TCP_DBG_IP_TAG_RMT (   _tc)
Value:
{ \
if (_tc->c_is_ip4) \
{ \
ELOG_TYPE_DECLARE (_e) = \
{ \
.format = "rmt: %d.%d.%d.%d:%d", \
.format_args = "i4i4i4i4i4", \
}; \
DECLARE_ETD(_tc, _e, 5); \
ed->data[0] = _tc->c_rmt_ip.ip4.as_u8[0]; \
ed->data[1] = _tc->c_rmt_ip.ip4.as_u8[1]; \
ed->data[2] = _tc->c_rmt_ip.ip4.as_u8[2]; \
ed->data[3] = _tc->c_rmt_ip.ip4.as_u8[3]; \
ed->data[4] = clib_net_to_host_u16(_tc->c_rmt_port); \
} \
}

Definition at line 117 of file tcp_debug.h.

◆ TCP_DEBUG

#define TCP_DEBUG   (1)

Definition at line 21 of file tcp_debug.h.

◆ TCP_DEBUG_BUFFER_ALLOCATION

#define TCP_DEBUG_BUFFER_ALLOCATION   (0)

Definition at line 25 of file tcp_debug.h.

◆ TCP_DEBUG_CC

#define TCP_DEBUG_CC   (0)

Definition at line 23 of file tcp_debug.h.

◆ TCP_DEBUG_CC_STAT

#define TCP_DEBUG_CC_STAT   (0)

Definition at line 24 of file tcp_debug.h.

◆ TCP_DEBUG_SM

#define TCP_DEBUG_SM   (0)

Definition at line 22 of file tcp_debug.h.

◆ TCP_EVT_ACK_RCV_ERR_HANDLER

#define TCP_EVT_ACK_RCV_ERR_HANDLER (   _tc,
  _type,
  _ack,
  ... 
)

Definition at line 522 of file tcp_debug.h.

◆ TCP_EVT_ACK_RCVD_HANDLER

#define TCP_EVT_ACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 595 of file tcp_debug.h.

◆ TCP_EVT_ACK_SENT_HANDLER

#define TCP_EVT_ACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 594 of file tcp_debug.h.

◆ TCP_EVT_BIND_HANDLER

#define TCP_EVT_BIND_HANDLER (   _tc,
  ... 
)
Value:
{ \
TCP_EVT_INIT_HANDLER(_tc, 1); \
ELOG_TYPE_DECLARE (_e) = \
{ \
.format = "bind: listener %d", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->c_c_index; \
}

Definition at line 187 of file tcp_debug.h.

◆ TCP_EVT_CC_EVT_HANDLER

#define TCP_EVT_CC_EVT_HANDLER (   _tc,
  _sub_evt,
  ... 
)

Definition at line 671 of file tcp_debug.h.

◆ TCP_EVT_CC_INPUT_HANDLER

#define TCP_EVT_CC_INPUT_HANDLER (   _tc,
  _len,
  _written,
  ... 
)

Definition at line 798 of file tcp_debug.h.

◆ TCP_EVT_CC_PACK_HANDLER

#define TCP_EVT_CC_PACK_HANDLER (   _tc,
  ... 
)

Definition at line 795 of file tcp_debug.h.

◆ TCP_EVT_CC_RTX_HANDLER

#define TCP_EVT_CC_RTX_HANDLER (   _tc,
  offset,
  n_bytes,
  ... 
)

Definition at line 792 of file tcp_debug.h.

◆ TCP_EVT_CC_SACKS_HANDLER

#define TCP_EVT_CC_SACKS_HANDLER (   _tc,
  ... 
)

Definition at line 797 of file tcp_debug.h.

◆ TCP_EVT_CC_SCOREBOARD_HANDLER

#define TCP_EVT_CC_SCOREBOARD_HANDLER (   _tc,
  ... 
)

Definition at line 796 of file tcp_debug.h.

◆ TCP_EVT_CC_STAT_HANDLER

#define TCP_EVT_CC_STAT_HANDLER (   _tc,
  ... 
)

Definition at line 885 of file tcp_debug.h.

◆ TCP_EVT_CC_STAT_PRINT

#define TCP_EVT_CC_STAT_PRINT (   _tc)

Definition at line 886 of file tcp_debug.h.

◆ TCP_EVT_CLOSE_HANDLER

#define TCP_EVT_CLOSE_HANDLER (   _tc,
  ... 
)
Value:
{ \
ELOG_TYPE_DECLARE (_e) = \
{ \
.format = "close: cidx %d", \
.format_args = "i4", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->c_c_index; \
}

Definition at line 176 of file tcp_debug.h.

◆ TCP_EVT_DBG

#define TCP_EVT_DBG (   _evt,
  _args... 
)    CC(_evt, _HANDLER)(_args)

Definition at line 241 of file tcp_debug.h.

◆ TCP_EVT_DEALLOC_HANDLER

#define TCP_EVT_DEALLOC_HANDLER (   _tc,
  ... 
)
Value:
{ \
vec_free (_tc->c_elog_track.name); \
}

Definition at line 159 of file tcp_debug.h.

◆ TCP_EVT_DELETE_HANDLER

#define TCP_EVT_DELETE_HANDLER (   _tc,
  ... 
)
Value:
{ \
ELOG_TYPE_DECLARE (_e) = \
{ \
.format = "delete: cidx %d sidx %d", \
.format_args = "i4i4", \
}; \
DECLARE_ETD(_tc, _e, 2); \
ed->data[0] = _tc->c_c_index; \
ed->data[1] = _tc->c_s_index; \
TCP_EVT_DEALLOC_HANDLER(_tc); \
}

Definition at line 226 of file tcp_debug.h.

◆ TCP_EVT_DUPACK_RCVD_HANDLER

#define TCP_EVT_DUPACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 794 of file tcp_debug.h.

◆ TCP_EVT_DUPACK_SENT_HANDLER

#define TCP_EVT_DUPACK_SENT_HANDLER (   _tc,
  _btcp,
  ... 
)

Definition at line 793 of file tcp_debug.h.

◆ TCP_EVT_FIN_RCVD_HANDLER

#define TCP_EVT_FIN_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 445 of file tcp_debug.h.

◆ TCP_EVT_FIN_SENT_HANDLER

#define TCP_EVT_FIN_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 443 of file tcp_debug.h.

◆ TCP_EVT_INIT_HANDLER

#define TCP_EVT_INIT_HANDLER (   _tc,
  _is_l,
  ... 
)
Value:
{ \
char *_fmt = _is_l ? "l[%d].%d:%d%c" : "[%d].%d:%d->.%d:%d%c"; \
if (_tc->c_is_ip4) \
{ \
_tc->c_elog_track.name = \
(char *) format (0, _fmt, _tc->c_thread_index, \
_tc->c_lcl_ip.ip4.as_u8[3], \
clib_net_to_host_u16(_tc->c_lcl_port), \
_tc->c_rmt_ip.ip4.as_u8[3], \
clib_net_to_host_u16(_tc->c_rmt_port), 0); \
} \
else \
_tc->c_elog_track.name = \
(char *) format (0, _fmt, _tc->c_thread_index, \
_tc->c_lcl_ip.ip6.as_u8[15], \
clib_net_to_host_u16(_tc->c_lcl_port), \
_tc->c_rmt_ip.ip6.as_u8[15], \
clib_net_to_host_u16(_tc->c_rmt_port), 0); \
elog_track_register (&vlib_global_main.elog_main, &_tc->c_elog_track);\
TCP_DBG_IP_TAG_LCL(_tc); \
TCP_DBG_IP_TAG_RMT(_tc); \
}
vlib_main_t vlib_global_main
Definition: main.c:1924
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
elog_main_t elog_main
Definition: main.h:172

Definition at line 135 of file tcp_debug.h.

◆ TCP_EVT_INPUT_HANDLER

#define TCP_EVT_INPUT_HANDLER (   _tc,
  _type,
  _len,
  _written,
  ... 
)

Definition at line 597 of file tcp_debug.h.

◆ TCP_EVT_OPEN_HANDLER

#define TCP_EVT_OPEN_HANDLER (   _tc,
  ... 
)
Value:
{ \
TCP_EVT_INIT_HANDLER(_tc, 0); \
ELOG_TYPE_DECLARE (_e) = \
{ \
.format = "open: index %d", \
.format_args = "i4", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->c_c_index; \
}

Definition at line 164 of file tcp_debug.h.

◆ TCP_EVT_OUTPUT_HANDLER

#define TCP_EVT_OUTPUT_HANDLER (   _tc,
  flags,
  n_bytes,
  ... 
)

Definition at line 628 of file tcp_debug.h.

◆ TCP_EVT_PAWS_FAIL_HANDLER

#define TCP_EVT_PAWS_FAIL_HANDLER (   _tc,
  _seq,
  _end,
  ... 
)

Definition at line 521 of file tcp_debug.h.

◆ TCP_EVT_PKTIZE_HANDLER

#define TCP_EVT_PKTIZE_HANDLER (   _tc,
  ... 
)

Definition at line 596 of file tcp_debug.h.

◆ TCP_EVT_RCV_WND_SHRUNK_HANDLER

#define TCP_EVT_RCV_WND_SHRUNK_HANDLER (   _tc,
  _obs,
  _av,
  ... 
)

Definition at line 523 of file tcp_debug.h.

◆ TCP_EVT_RST_RCVD_HANDLER

#define TCP_EVT_RST_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 446 of file tcp_debug.h.

◆ TCP_EVT_RST_SENT_HANDLER

#define TCP_EVT_RST_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 444 of file tcp_debug.h.

◆ TCP_EVT_SEG_INVALID_HANDLER

#define TCP_EVT_SEG_INVALID_HANDLER (   _tc,
  _btcp,
  ... 
)

Definition at line 520 of file tcp_debug.h.

◆ TCP_EVT_SND_WND_HANDLER

#define TCP_EVT_SND_WND_HANDLER (   _tc,
  ... 
)

Definition at line 627 of file tcp_debug.h.

◆ TCP_EVT_STATE_CHANGE_HANDLER

#define TCP_EVT_STATE_CHANGE_HANDLER (   _tc,
  ... 
)

Definition at line 447 of file tcp_debug.h.

◆ TCP_EVT_SYN_RCVD_HANDLER

#define TCP_EVT_SYN_RCVD_HANDLER (   _tc,
  _init,
  ... 
)
Value:
{ \
if (_init) \
TCP_EVT_INIT_HANDLER(_tc, 0); \
ELOG_TYPE_DECLARE (_e) = \
{ \
.format = "syn-rx: cidx %u sidx %u irs %u", \
.format_args = "i4i4i4", \
}; \
DECLARE_ETD(_tc, _e, 3); \
ed->data[0] = _tc->c_c_index; \
ed->data[1] = _tc->c_s_index; \
ed->data[2] = _tc->irs; \
TCP_EVT_STATE_CHANGE_HANDLER(_tc); \
}

Definition at line 198 of file tcp_debug.h.

◆ TCP_EVT_SYN_RXT_HANDLER

#define TCP_EVT_SYN_RXT_HANDLER (   _tc,
  ... 
)

Definition at line 442 of file tcp_debug.h.

◆ TCP_EVT_SYN_SENT_HANDLER

#define TCP_EVT_SYN_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 439 of file tcp_debug.h.

◆ TCP_EVT_SYNACK_RCVD_HANDLER

#define TCP_EVT_SYNACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 441 of file tcp_debug.h.

◆ TCP_EVT_SYNACK_SENT_HANDLER

#define TCP_EVT_SYNACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 440 of file tcp_debug.h.

◆ TCP_EVT_TIMER_POP_HANDLER

#define TCP_EVT_TIMER_POP_HANDLER (   _tc_index,
  _timer_id,
  ... 
)

Definition at line 448 of file tcp_debug.h.

◆ TCP_EVT_UNBIND_HANDLER

#define TCP_EVT_UNBIND_HANDLER (   _tc,
  ... 
)
Value:
{ \
TCP_EVT_DEALLOC_HANDLER(_tc); \
ELOG_TYPE_DECLARE (_e) = \
{ \
.format = "unbind: listener %d", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->c_c_index; \
TCP_EVT_DEALLOC_HANDLER(_tc); \
}

Definition at line 214 of file tcp_debug.h.

◆ TRANSPORT_DEBUG

#define TRANSPORT_DEBUG   (1)

Definition at line 83 of file tcp_debug.h.

Typedef Documentation

◆ tcp_dbg_e

typedef enum _tcp_dbg tcp_dbg_e

◆ tcp_dbg_evt_e

typedef enum _tcp_dbg_evt tcp_dbg_evt_e