FD.io VPP  v17.07.01-10-g3be13f0
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   (1)
 
#define TCP_DEBUG_CC_STAT   (1)
 
#define TCP_DEBUG_SM_VERBOSE   (0)
 
#define foreach_tcp_dbg_evt
 
#define TRANSPORT_DEBUG   (1)
 
#define TCP_DBG(_tc, _evt, _args...)
 
#define DECLARE_ETD(_tc, _e, _size)
 
#define TCP_EVT_INIT_HANDLER(_tc, _fmt, ...)
 
#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_UNBIND_HANDLER(_tc, ...)
 
#define TCP_EVT_DELETE_HANDLER(_tc, ...)
 
#define TCP_EVT_SYN_RCVD_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_ACK_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_DUPACK_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_SYN_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_SYN_RTX_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_ACK_RCVD_HANDLER(_tc, ...)
 
#define TCP_EVT_DUPACK_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_CC_EVT_HANDLER(_tc, _sub_evt, ...)
 
#define TCP_EVT_CC_PACK_HANDLER(_tc, ...)
 
#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 182 of file tcp_debug.h.

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

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

Definition at line 91 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") \
_(SYN_RTX, "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") \
_(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 567 of file tcp_debug.h.

#define TCP_DBG (   _tc,
  _evt,
  _args... 
)
Value:
{ \
u8 *_tmp = 0; \
_tmp = format(_tmp, "%U", format_tcp_connection_verbose, _tc); \
clib_warning("%s", _tmp); \
vec_free(_tmp); \
}
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:340
#define clib_warning(format, args...)
Definition: error.h:59
unsigned char u8
Definition: types.h:56

Definition at line 83 of file tcp_debug.h.

#define TCP_DEBUG   (1)

Definition at line 21 of file tcp_debug.h.

#define TCP_DEBUG_CC   (1)

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_DEBUG_SM_VERBOSE   (0)

Definition at line 25 of file tcp_debug.h.

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

Definition at line 474 of file tcp_debug.h.

#define TCP_EVT_ACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 467 of file tcp_debug.h.

#define TCP_EVT_ACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 459 of file tcp_debug.h.

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

Definition at line 134 of file tcp_debug.h.

#define TCP_EVT_CC_EVT_HANDLER (   _tc,
  _sub_evt,
  ... 
)
Value:
{ \
{ \
.format = "cc: %s wnd %u snd_cong %u rxt_bytes %u", \
.format_args = "t4i4i4i4", \
.n_enum_strings = 5, \
.enum_strings = { \
"fast-rxt", \
"rxt-timeout", \
"first-rxt", \
"recovered", \
"congestion", \
}, \
}; \
DECLARE_ETD(_tc, _e, 4); \
ed->data[0] = _sub_evt; \
ed->data[1] = tcp_available_snd_space (_tc); \
ed->data[2] = _tc->snd_congestion - _tc->iss; \
ed->data[3] = _tc->snd_rxt_bytes; \
}
static u32 tcp_available_snd_space(const tcp_connection_t *tc)
Definition: tcp.h:511
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:91

Definition at line 528 of file tcp_debug.h.

#define TCP_EVT_CC_PACK_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "pack: snd_una %u snd_una_max %u", \
.format_args = "i4i4", \
}; \
DECLARE_ETD(_tc, _e, 2); \
ed->data[0] = _tc->snd_una - _tc->iss; \
ed->data[1] = _tc->snd_una_max - _tc->iss; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:91

Definition at line 550 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:540
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define STATS_INTERVAL
Definition: tcp_debug.h:567
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:91

Definition at line 569 of file tcp_debug.h.

#define TCP_EVT_CC_RTX_HANDLER (   _tc,
  offset,
  n_bytes,
  ... 
)
Value:
{ \
{ \
.format = "rxt: snd_nxt %u offset %u snd %u rxt %u", \
.format_args = "i4i4i4i4", \
}; \
DECLARE_ETD(_tc, _e, 4); \
ed->data[0] = _tc->snd_nxt - _tc->iss; \
ed->data[1] = offset; \
ed->data[2] = n_bytes; \
ed->data[3] = _tc->snd_rxt_bytes; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:91
struct clib_bihash_value offset
template key/value backing page structure

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

Definition at line 585 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:91

Definition at line 123 of file tcp_debug.h.

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

Definition at line 183 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:340

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

Definition at line 157 of file tcp_debug.h.

#define TCP_EVT_DUPACK_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 468 of file tcp_debug.h.

#define TCP_EVT_DUPACK_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 460 of file tcp_debug.h.

#define TCP_EVT_FIN_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 465 of file tcp_debug.h.

#define TCP_EVT_FIN_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 463 of file tcp_debug.h.

#define TCP_EVT_INIT_HANDLER (   _tc,
  _fmt,
  ... 
)
Value:
{ \
_tc->c_elog_track.name = \
(char *) format (0, _fmt, _tc->c_c_index, 0); \
}
word elog_track_register(elog_main_t *em, elog_track_t *t)
register an event track
Definition: elog.c:198
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
vlib_main_t vlib_global_main
Definition: main.c:1653
elog_main_t elog_main
Definition: main.h:141

Definition at line 99 of file tcp_debug.h.

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

Definition at line 470 of file tcp_debug.h.

#define TCP_EVT_OPEN_HANDLER (   _tc,
  ... 
)
Value:
{ \
TCP_EVT_INIT_HANDLER(_tc, "s%d%c"); \
{ \
.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, _fmt,...)
Definition: tcp_debug.h:99
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:91

Definition at line 111 of file tcp_debug.h.

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

Definition at line 506 of file tcp_debug.h.

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

Definition at line 473 of file tcp_debug.h.

#define TCP_EVT_PKTIZE_HANDLER (   _tc,
  ... 
)

Definition at line 469 of file tcp_debug.h.

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

Definition at line 475 of file tcp_debug.h.

#define TCP_EVT_RST_RCVD_HANDLER (   _tc,
  ... 
)

Definition at line 466 of file tcp_debug.h.

#define TCP_EVT_RST_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 464 of file tcp_debug.h.

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

Definition at line 472 of file tcp_debug.h.

#define TCP_EVT_SND_WND_HANDLER (   _tc,
  ... 
)

Definition at line 505 of file tcp_debug.h.

#define TCP_EVT_SYN_RCVD_HANDLER (   _tc,
  ... 
)
Value:
{ \
TCP_EVT_INIT_HANDLER(_tc, "s%d%c"); \
{ \
.format = "SYNrx: irs %u", \
.format_args = "i4", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->irs; \
}
#define TCP_EVT_INIT_HANDLER(_tc, _fmt,...)
Definition: tcp_debug.h:99
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:439
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:91

Definition at line 169 of file tcp_debug.h.

#define TCP_EVT_SYN_RTX_HANDLER (   _tc,
  ... 
)

Definition at line 462 of file tcp_debug.h.

#define TCP_EVT_SYN_SENT_HANDLER (   _tc,
  ... 
)

Definition at line 461 of file tcp_debug.h.

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

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

Definition at line 145 of file tcp_debug.h.

#define TRANSPORT_DEBUG   (1)

Definition at line 77 of file tcp_debug.h.

Typedef Documentation

typedef enum _tcp_dbg tcp_dbg_e
typedef enum _tcp_dbg_evt tcp_dbg_evt_e