#define TCP_DEBUG (1)
#define TCP_DEBUG_SM (0)
#define TCP_DEBUG_CC (0)
-#define TCP_DEBUG_CC_STAT (1)
+#define TCP_DEBUG_CC_STAT (0)
#define TCP_DEBUG_BUFFER_ALLOCATION (0)
#define foreach_tcp_dbg_evt \
#define TCP_EVT_RST_SENT_HANDLER(_tc, ...) \
{ \
- ELOG_TYPE_DECLARE (_e) = \
+if (_tc) \
{ \
- .format = "rst-tx: 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; \
- TCP_EVT_STATE_CHANGE_HANDLER(_tc); \
+ ELOG_TYPE_DECLARE (_e) = \
+ { \
+ .format = "rst-tx: 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; \
+ TCP_EVT_STATE_CHANGE_HANDLER(_tc); \
+ } \
}
#define TCP_EVT_FIN_RCVD_HANDLER(_tc, ...) \
{ \
ELOG_TYPE_DECLARE (_e) = \
{ \
- .format = "cc: %s wnd %u snd_cong %u rxt_bytes %u", \
+ .format = "cc: %s snd_space %u snd_cong %u rxt_bytes %u", \
.format_args = "t4i4i4i4", \
.n_enum_strings = 6, \
.enum_strings = { \
{ \
ELOG_TYPE_DECLARE (_e) = \
{ \
- .format = "rto_stat: rto %u srtt %u rttvar %u ", \
+ .format = "rcv_stat: rto %u srtt %u rttvar %u ", \
.format_args = "i4i4i4", \
}; \
DECLARE_ETD(_tc, _e, 3); \
ed->data[2] = _tc->rttvar; \
} \
}
+#define TCP_EVT_CC_SND_STAT_HANDLER(_tc, ...) \
+{ \
+if (_tc->c_cc_stat_tstamp + STATS_INTERVAL < tcp_time_now()) \
+{ \
+ ELOG_TYPE_DECLARE (_e) = \
+ { \
+ .format = "snd_stat: dack %u sacked %u lost %u out %u rxt %u", \
+ .format_args = "i4i4i4i4i4", \
+ }; \
+ DECLARE_ETD(_tc, _e, 5); \
+ ed->data[0] = _tc->rcv_dupacks; \
+ ed->data[1] = _tc->sack_sb.sacked_bytes; \
+ ed->data[2] = _tc->sack_sb.lost_bytes; \
+ ed->data[3] = tcp_bytes_out (_tc); \
+ ed->data[3] = _tc->snd_rxt_bytes; \
+} \
+}
#define TCP_EVT_CC_STAT_HANDLER(_tc, ...) \
{ \
_tc->c_cc_stat_tstamp = tcp_time_now(); \
} \
}
+#else
+#define TCP_EVT_CC_STAT_HANDLER(_tc, ...)
+#endif
/*
* Buffer allocation
#define TCP_DBG_BUFFER_ALLOC_MAYBE_FAIL(thread_index) \
{ \
static u32 *buffer_fail_counters; \
- if (PREDICT_FALSE (buffer_fail_counters == 0)) \
+ if (PREDICT_FALSE (buffer_fail_counters == 0)) \
{ \
u32 num_threads; \
- vlib_thread_main_t *vtm = vlib_get_thread_main (); \
+ vlib_thread_main_t *vtm = vlib_get_thread_main (); \
num_threads = 1 /* main thread */ + vtm->n_threads; \
vec_validate (buffer_fail_counters, num_threads - 1); \
} \
if (PREDICT_FALSE (tcp_main.buffer_fail_fraction != 0.0)) \
{ \
- if (PREDICT_TRUE (buffer_fail_counters[thread_index] > 0)) \
+ if (PREDICT_TRUE (buffer_fail_counters[thread_index] > 0)) \
{ \
- if ((1.0 / (f32) (buffer_fail_counters[thread_index])) \
+ if ((1.0 / (f32) (buffer_fail_counters[thread_index])) \
< tcp_main.buffer_fail_fraction) \
{ \
buffer_fail_counters[thread_index] = 0.0000001; \
- return -1; \
+ return -1; \
} \
} \
buffer_fail_counters[thread_index] ++; \
#define TCP_DBG_BUFFER_ALLOC_MAYBE_FAIL(thread_index)
#endif
-#else
-#define TCP_EVT_CC_STAT_HANDLER(_tc, ...)
-#endif
-
#endif /* SRC_VNET_TCP_TCP_DEBUG_H_ */
/*
* fd.io coding-style-patch-verification: ON