FD.io VPP  v17.04-9-g99c0734
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 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, ...)
 
#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_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_FIN_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_RST_SENT_HANDLER(_tc, ...)
 
#define TCP_EVT_SYN_RCVD_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_PKTIZE_HANDLER(_tc, ...)
 
#define TCP_EVT_OUTPUT_HANDLER(_tc, flags, n_bytes, ...)
 
#define TCP_EVT_INPUT_HANDLER(_tc, n_bytes, ...)
 
#define TCP_EVT_TIMER_POP_HANDLER(_tc_index, _timer_id, ...)
 
#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)
 

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

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

Definition at line 299 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:1617
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:386

Definition at line 68 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") \
_(FIN_SENT, "FIN sent") \
_(RST_SENT, "RST sent") \
_(SYN_RCVD, "SYN rcvd") \
_(ACK_RCVD, "ACK rcvd") \
_(FIN_RCVD, "FIN rcvd") \
_(RST_RCVD, "RST rcvd") \
_(PKTIZE, "packetize") \
_(INPUT, "in") \
_(TIMER_POP, "timer pop")

Definition at line 23 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:418
u8 * format_tcp_connection_verbose(u8 *s, va_list *args)
Definition: tcp.c:505
#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 60 of file tcp_debug.h.

#define TCP_DEBUG   (1)

Definition at line 21 of file tcp_debug.h.

#define TCP_EVT_ACK_RCVD_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "ACK: acked %u cwnd %u inflight %u", \
.format_args = "i4i4i4", \
}; \
DECLARE_ETD(_tc, _e, 3); \
ed->data[0] = _tc->bytes_acked; \
ed->data[1] = _tc->cwnd; \
ed->data[2] = tcp_flight_size(_tc); \
}
static u32 tcp_flight_size(const tcp_connection_t *tc)
Definition: tcp.h:399
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 217 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,...)
Definition: tcp_debug.h:76
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 111 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:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 100 of file tcp_debug.h.

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

Definition at line 302 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's memory (no header).
Definition: vec.h:340

Definition at line 83 of file tcp_debug.h.

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

Definition at line 134 of file tcp_debug.h.

#define TCP_EVT_FIN_RCVD_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "FIN rcvd: snd_nxt %d rcv_nxt %d", \
.format_args = "i4i4", \
}; \
DECLARE_ETD(_tc, _e, 2); \
ed->data[0] = _tc->snd_nxt - _tc->iss; \
ed->data[1] = _tc->rcv_nxt - _tc->irs; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 193 of file tcp_debug.h.

#define TCP_EVT_FIN_SENT_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "FIN: snd_nxt %d rcv_nxt %d", \
.format_args = "i4i4", \
}; \
DECLARE_ETD(_tc, _e, 2); \
ed->data[0] = _tc->snd_nxt - _tc->iss; \
ed->data[1] = _tc->rcv_nxt - _tc->irs; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 157 of file tcp_debug.h.

#define TCP_EVT_INIT_HANDLER (   _tc,
  ... 
)
Value:
{ \
_tc->c_elog_track.name = \
(char *) format (0, "%d%c", _tc->c_c_index, 0); \
}
word elog_track_register(elog_main_t *em, elog_track_t *t)
Definition: elog.c:190
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:418
vlib_main_t vlib_global_main
Definition: main.c:1617
elog_main_t elog_main
Definition: main.h:141

Definition at line 76 of file tcp_debug.h.

#define TCP_EVT_INPUT_HANDLER (   _tc,
  n_bytes,
  ... 
)
Value:
{ \
{ \
.format = "in: bytes %u rcv_nxt %u", \
.format_args = "i4i4", \
}; \
DECLARE_ETD(_tc, _e, 2); \
ed->data[0] = n_bytes; \
ed->data[1] = _tc->rcv_nxt - _tc->irs; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 255 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,...)
Definition: tcp_debug.h:76
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 88 of file tcp_debug.h.

#define TCP_EVT_OUTPUT_HANDLER (   _tc,
  flags,
  n_bytes,
  ... 
)
Value:
{ \
{ \
.format = "out: flags %x, bytes %u", \
.format_args = "i4i4", \
}; \
DECLARE_ETD(_tc, _e, 2); \
ed->data[0] = flags; \
ed->data[1] = n_bytes; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68
u32 flags
Definition: vhost-user.h:78

Definition at line 243 of file tcp_debug.h.

#define TCP_EVT_PKTIZE_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "pktize: snd_una %u snd_nxt %u una_max %u", \
.format_args = "i4i4i4", \
}; \
DECLARE_ETD(_tc, _e, 3); \
ed->data[0] = _tc->snd_una - _tc->iss; \
ed->data[1] = _tc->snd_nxt - _tc->iss; \
ed->data[2] = _tc->snd_una_max - _tc->iss; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 230 of file tcp_debug.h.

#define TCP_EVT_RST_RCVD_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "RST rcvd: snd_nxt %d rcv_nxt %d", \
.format_args = "i4i4", \
}; \
DECLARE_ETD(_tc, _e, 2); \
ed->data[0] = _tc->snd_nxt - _tc->iss; \
ed->data[1] = _tc->rcv_nxt - _tc->irs; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 205 of file tcp_debug.h.

#define TCP_EVT_RST_SENT_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "RST: snd_nxt %d rcv_nxt %d", \
.format_args = "i4i4", \
}; \
DECLARE_ETD(_tc, _e, 2); \
ed->data[0] = _tc->snd_nxt - _tc->iss; \
ed->data[1] = _tc->rcv_nxt - _tc->irs; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 169 of file tcp_debug.h.

#define TCP_EVT_SYN_RCVD_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "SYN rcvd: irs %d", \
.format_args = "i4", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->irs; \
}
#define TCP_EVT_INIT_HANDLER(_tc,...)
Definition: tcp_debug.h:76
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 181 of file tcp_debug.h.

#define TCP_EVT_SYN_SENT_HANDLER (   _tc,
  ... 
)
Value:
{ \
{ \
.format = "SYN: iss %d", \
.format_args = "i4", \
}; \
DECLARE_ETD(_tc, _e, 1); \
ed->data[0] = _tc->iss; \
}
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 146 of file tcp_debug.h.

#define TCP_EVT_TIMER_POP_HANDLER (   _tc_index,
  _timer_id,
  ... 
)
Value:
{ \
if (_timer_id == TCP_TIMER_RETRANSMIT_SYN) \
{ \
_tc = tcp_half_open_connection_get (_tc_index); \
} \
else \
{ \
u32 _thread_index = os_get_cpu_number (); \
_tc = tcp_connection_get (_tc_index, _thread_index); \
} \
{ \
.format = "TimerPop: %s (%d)", \
.format_args = "t4i4", \
.n_enum_strings = 7, \
.enum_strings = { \
"retransmit", \
"delack", \
"BUG", \
"keep", \
"waitclose", \
"retransmit syn", \
"establish", \
}, \
}; \
DECLARE_ETD(_tc, _e, 2); \
ed->data[0] = _timer_id; \
ed->data[1] = _timer_id; \
}
static tcp_connection_t * tcp_half_open_connection_get(u32 conn_index)
Definition: tcp.h:369
struct _tcp_connection tcp_connection_t
uword os_get_cpu_number(void)
Definition: unix-misc.c:224
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
unsigned int u32
Definition: types.h:88
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68
static tcp_connection_t * tcp_connection_get(u32 conn_index, u32 thread_index)
Definition: tcp.h:337

Definition at line 267 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:83
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:350
#define DECLARE_ETD(_tc, _e, _size)
Definition: tcp_debug.h:68

Definition at line 122 of file tcp_debug.h.

#define TRANSPORT_DEBUG   (1)

Definition at line 58 of file tcp_debug.h.

Typedef Documentation

typedef enum _tcp_dbg tcp_dbg_e
typedef enum _tcp_dbg_evt tcp_dbg_evt_e