FD.io VPP  v18.01.2-1-g9b554f3
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   (1)
 
#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_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_TIMER_POP_HANDLER(_tc_index, _timer_id, ...)
 
#define TCP_EVT_SEG_INVALID_HANDLER(_tc, _seq, _end, ...)
 
#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_SND_WND_HANDLER(_tc, ...)
 
#define TCP_EVT_OUTPUT_HANDLER(_tc, flags, n_bytes, ...)
 
#define TCP_EVT_CC_RTX_HANDLER(_tc, offset, n_bytes, ...)
 
#define TCP_EVT_DUPACK_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_DUPACK_RCVD_HANDLER(_tc, ...)
 
#define TCP_EVT_CC_PACK_HANDLER(_tc, ...)
 
#define TCP_EVT_CC_EVT_HANDLER(_tc, _sub_evt, ...)
 
#define STATS_INTERVAL   1
 
#define TCP_EVT_CC_RTO_STAT_HANDLER(_tc, ...)
 
#define TCP_EVT_CC_STAT_HANDLER(_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

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

Definition at line 234 of file tcp_debug.h.

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

Definition at line 233 of file tcp_debug.h.

#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:1637
elog_main_t elog_main
Definition: main.h:155
unsigned int u32
Definition: types.h:88
#define ELOG_TRACK_DATA(em, f, track)
Definition: elog.h:475

Definition at line 88 of file tcp_debug.h.

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") \
_(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.

#define STATS_INTERVAL   1

Definition at line 713 of file tcp_debug.h.

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

Definition at line 86 of file tcp_debug.h.

#define TCP_DBG_BUFFER_ALLOC_MAYBE_FAIL (   thread_index)

Definition at line 781 of file tcp_debug.h.

#define TCP_DBG_IP_TAG_LCL (   _tc)
Value:
{ \
if (_tc->c_is_ip4) \
{ \
{ \
.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); \
} \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 96 of file tcp_debug.h.

#define TCP_DBG_IP_TAG_RMT (   _tc)
Value:
{ \
if (_tc->c_is_ip4) \
{ \
{ \
.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); \
} \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 114 of file tcp_debug.h.

#define TCP_DEBUG   (1)

Definition at line 21 of file tcp_debug.h.

#define TCP_DEBUG_BUFFER_ALLOCATION   (0)

Definition at line 25 of file tcp_debug.h.

#define TCP_DEBUG_CC   (0)

Definition at line 23 of file tcp_debug.h.

#define TCP_DEBUG_CC_STAT   (1)

Definition at line 24 of file tcp_debug.h.

#define TCP_DEBUG_SM   (0)

Definition at line 22 of file tcp_debug.h.

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

Definition at line 581 of file tcp_debug.h.

#define TCP_EVT_ACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 575 of file tcp_debug.h.

#define TCP_EVT_ACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 574 of file tcp_debug.h.

#define TCP_EVT_BIND_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "bind: listener %d", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->c_c_index; \
}
#define TCP_EVT_INIT_HANDLER(_tc, _is_l,...)
Definition: tcp_debug.h:132
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 184 of file tcp_debug.h.

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

Definition at line 705 of file tcp_debug.h.

#define TCP_EVT_CC_PACK_HANDLER (   _tc,
  ... 
)

Definition at line 704 of file tcp_debug.h.

#define TCP_EVT_CC_RTO_STAT_HANDLER (   _tc,
  ... 
)
Value:
{ \
if (_tc->c_cc_stat_tstamp + STATS_INTERVAL < tcp_time_now()) \
{ \
{ \
.format = "rto_stat: rto %u srtt %u rttvar %u ", \
.format_args = "i4i4i4", \
}; \
DECLARE_ETD(_tc, _e, 3); \
ed->data[0] = _tc->rto; \
ed->data[1] = _tc->srtt; \
ed->data[2] = _tc->rttvar; \
} \
}
static u32 tcp_time_now(void)
Definition: tcp.h:656
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define STATS_INTERVAL
Definition: tcp_debug.h:713
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 715 of file tcp_debug.h.

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

Definition at line 701 of file tcp_debug.h.

#define TCP_EVT_CC_STAT_HANDLER (   _tc,
  ... 
)
Value:
{ \
if (_tc->c_cc_stat_tstamp + STATS_INTERVAL < tcp_time_now()) \
{ \
{ \
.format = "cc_stat: cwnd %u flight %u space %u ssthresh %u snd_wnd %u",\
.format_args = "i4i4i4i4i4", \
}; \
DECLARE_ETD(_tc, _e, 5); \
ed->data[0] = _tc->cwnd; \
ed->data[1] = tcp_flight_size (_tc); \
ed->data[2] = tcp_snd_space (_tc); \
ed->data[3] = _tc->ssthresh; \
ed->data[4] = _tc->snd_wnd; \
_tc->c_cc_stat_tstamp = tcp_time_now(); \
} \
}
static u32 tcp_time_now(void)
Definition: tcp.h:656
u32 tcp_snd_space(tcp_connection_t *tc)
Compute tx window session is allowed to fill.
Definition: tcp.c:939
static u32 tcp_flight_size(const tcp_connection_t *tc)
Our estimate of the number of bytes in flight (pipe size)
Definition: tcp.h:556
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define TCP_EVT_CC_RTO_STAT_HANDLER(_tc,...)
Definition: tcp_debug.h:715
#define STATS_INTERVAL
Definition: tcp_debug.h:713
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 731 of file tcp_debug.h.

#define TCP_EVT_CLOSE_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "close: %d", \
.format_args = "i4", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->c_c_index; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 173 of file tcp_debug.h.

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

Definition at line 235 of file tcp_debug.h.

#define TCP_EVT_DEALLOC_HANDLER (   _tc,
  ... 
)
Value:
{ \
vec_free (_tc->c_elog_track.name); \
}
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:336

Definition at line 156 of file tcp_debug.h.

#define TCP_EVT_DELETE_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "delete: %d", \
.format_args = "i4", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->c_c_index; \
}
#define TCP_EVT_DEALLOC_HANDLER(_tc,...)
Definition: tcp_debug.h:156
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 221 of file tcp_debug.h.

#define TCP_EVT_DUPACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 703 of file tcp_debug.h.

#define TCP_EVT_DUPACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 702 of file tcp_debug.h.

#define TCP_EVT_FIN_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 393 of file tcp_debug.h.

#define TCP_EVT_FIN_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 391 of file tcp_debug.h.

#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); \
}
vlib_main_t vlib_global_main
Definition: main.c:1637
word elog_track_register(elog_main_t *em, elog_track_t *t)
register an event track
Definition: elog.c:198
#define TCP_DBG_IP_TAG_LCL(_tc)
Definition: tcp_debug.h:96
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
elog_main_t elog_main
Definition: main.h:155
#define TCP_DBG_IP_TAG_RMT(_tc)
Definition: tcp_debug.h:114

Definition at line 132 of file tcp_debug.h.

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

Definition at line 577 of file tcp_debug.h.

#define TCP_EVT_OPEN_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "open: index %d", \
.format_args = "i4", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->c_c_index; \
}
#define TCP_EVT_INIT_HANDLER(_tc, _is_l,...)
Definition: tcp_debug.h:132
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 161 of file tcp_debug.h.

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

Definition at line 613 of file tcp_debug.h.

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

Definition at line 580 of file tcp_debug.h.

#define TCP_EVT_PKTIZE_HANDLER (   _tc,
  ... 
)

Definition at line 576 of file tcp_debug.h.

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

Definition at line 582 of file tcp_debug.h.

#define TCP_EVT_RST_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 394 of file tcp_debug.h.

#define TCP_EVT_RST_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 392 of file tcp_debug.h.

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

Definition at line 579 of file tcp_debug.h.

#define TCP_EVT_SND_WND_HANDLER (   _tc,
  ... 
)

Definition at line 612 of file tcp_debug.h.

#define TCP_EVT_STATE_CHANGE_HANDLER (   _tc,
  ... 
)

Definition at line 395 of file tcp_debug.h.

#define TCP_EVT_SYN_RCVD_HANDLER (   _tc,
  _init,
  ... 
)
Value:
{ \
if (_init) \
{ \
.format = "syn-rx: irs %u", \
.format_args = "i4", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->irs; \
}
#define TCP_EVT_INIT_HANDLER(_tc, _is_l,...)
Definition: tcp_debug.h:132
#define TCP_EVT_STATE_CHANGE_HANDLER(_tc,...)
Definition: tcp_debug.h:395
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 195 of file tcp_debug.h.

#define TCP_EVT_SYN_RXT_HANDLER (   _tc,
  ... 
)

Definition at line 390 of file tcp_debug.h.

#define TCP_EVT_SYN_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 387 of file tcp_debug.h.

#define TCP_EVT_SYNACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 389 of file tcp_debug.h.

#define TCP_EVT_SYNACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 388 of file tcp_debug.h.

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

Definition at line 578 of file tcp_debug.h.

#define TCP_EVT_UNBIND_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "unbind: listener %d", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->c_c_index; \
}
#define TCP_EVT_DEALLOC_HANDLER(_tc,...)
Definition: tcp_debug.h:156
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:88

Definition at line 209 of file tcp_debug.h.

#define TRANSPORT_DEBUG   (1)

Definition at line 80 of file tcp_debug.h.

Typedef Documentation

typedef enum _tcp_dbg tcp_dbg_e
typedef enum _tcp_dbg_evt tcp_dbg_evt_e