FD.io VPP  v17.10-9-gd594711
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 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, ...)
 

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 233 of file tcp_debug.h.

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

Definition at line 232 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:1650
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 87 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 26 of file tcp_debug.h.

#define STATS_INTERVAL   1

Definition at line 712 of file tcp_debug.h.

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

Definition at line 85 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:87

Definition at line 95 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:87

Definition at line 113 of file tcp_debug.h.

#define TCP_DEBUG   (1)

Definition at line 21 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 580 of file tcp_debug.h.

#define TCP_EVT_ACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 574 of file tcp_debug.h.

#define TCP_EVT_ACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 573 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:131
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:87

Definition at line 183 of file tcp_debug.h.

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

Definition at line 704 of file tcp_debug.h.

#define TCP_EVT_CC_PACK_HANDLER (   _tc,
  ... 
)

Definition at line 703 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:658
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define STATS_INTERVAL
Definition: tcp_debug.h:712
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:87

Definition at line 714 of file tcp_debug.h.

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

Definition at line 700 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:658
u32 tcp_snd_space(tcp_connection_t *tc)
Compute tx window session is allowed to fill.
Definition: tcp.c:1063
static u32 tcp_flight_size(const tcp_connection_t *tc)
Our estimate of the number of bytes in flight (pipe size)
Definition: tcp.h:558
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define TCP_EVT_CC_RTO_STAT_HANDLER(_tc,...)
Definition: tcp_debug.h:714
#define STATS_INTERVAL
Definition: tcp_debug.h:712
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:87

Definition at line 730 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:87

Definition at line 172 of file tcp_debug.h.

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

Definition at line 234 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 155 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:155
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:87

Definition at line 220 of file tcp_debug.h.

#define TCP_EVT_DUPACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 702 of file tcp_debug.h.

#define TCP_EVT_DUPACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 701 of file tcp_debug.h.

#define TCP_EVT_FIN_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 392 of file tcp_debug.h.

#define TCP_EVT_FIN_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 390 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:1650
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:95
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:113

Definition at line 131 of file tcp_debug.h.

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

Definition at line 576 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:131
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:87

Definition at line 160 of file tcp_debug.h.

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

Definition at line 612 of file tcp_debug.h.

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

Definition at line 579 of file tcp_debug.h.

#define TCP_EVT_PKTIZE_HANDLER (   _tc,
  ... 
)

Definition at line 575 of file tcp_debug.h.

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

Definition at line 581 of file tcp_debug.h.

#define TCP_EVT_RST_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 393 of file tcp_debug.h.

#define TCP_EVT_RST_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 391 of file tcp_debug.h.

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

Definition at line 578 of file tcp_debug.h.

#define TCP_EVT_SND_WND_HANDLER (   _tc,
  ... 
)

Definition at line 611 of file tcp_debug.h.

#define TCP_EVT_STATE_CHANGE_HANDLER (   _tc,
  ... 
)

Definition at line 394 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:131
#define TCP_EVT_STATE_CHANGE_HANDLER(_tc,...)
Definition: tcp_debug.h:394
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:87

Definition at line 194 of file tcp_debug.h.

#define TCP_EVT_SYN_RXT_HANDLER (   _tc,
  ... 
)

Definition at line 389 of file tcp_debug.h.

#define TCP_EVT_SYN_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 386 of file tcp_debug.h.

#define TCP_EVT_SYNACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 388 of file tcp_debug.h.

#define TCP_EVT_SYNACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 387 of file tcp_debug.h.

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

Definition at line 577 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:155
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:87

Definition at line 208 of file tcp_debug.h.

#define TRANSPORT_DEBUG   (1)

Definition at line 79 of file tcp_debug.h.

Typedef Documentation

typedef enum _tcp_dbg tcp_dbg_e
typedef enum _tcp_dbg_evt tcp_dbg_evt_e