Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 1 | /* |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 Cisco and/or its affiliates. |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
| 16 | #ifndef SRC_VNET_TCP_TCP_DEBUG_H_ |
| 17 | #define SRC_VNET_TCP_TCP_DEBUG_H_ |
| 18 | |
| 19 | #include <vlib/vlib.h> |
| 20 | |
| 21 | #define TCP_DEBUG (1) |
Florin Coras | 2f8d8fa | 2018-01-26 06:36:04 -0800 | [diff] [blame] | 22 | #define TCP_DEBUG_SM (0) |
Florin Coras | e5c57d7 | 2019-03-19 19:36:07 -0700 | [diff] [blame] | 23 | #define TCP_DEBUG_CC (0) |
| 24 | #define TCP_DEBUG_CC_STAT (0) |
Florin Coras | f988e69 | 2017-11-27 04:34:14 -0500 | [diff] [blame] | 25 | #define TCP_DEBUG_BUFFER_ALLOCATION (0) |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 26 | |
| 27 | #define foreach_tcp_dbg_evt \ |
| 28 | _(INIT, "") \ |
| 29 | _(DEALLOC, "") \ |
| 30 | _(OPEN, "open") \ |
| 31 | _(CLOSE, "close") \ |
| 32 | _(BIND, "bind") \ |
| 33 | _(UNBIND, "unbind") \ |
| 34 | _(DELETE, "delete") \ |
| 35 | _(SYN_SENT, "SYN sent") \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 36 | _(SYNACK_SENT, "SYNACK sent") \ |
| 37 | _(SYNACK_RCVD, "SYNACK rcvd") \ |
| 38 | _(SYN_RXT, "SYN retransmit") \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 39 | _(FIN_SENT, "FIN sent") \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 40 | _(ACK_SENT, "ACK sent") \ |
| 41 | _(DUPACK_SENT, "DUPACK sent") \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 42 | _(RST_SENT, "RST sent") \ |
| 43 | _(SYN_RCVD, "SYN rcvd") \ |
| 44 | _(ACK_RCVD, "ACK rcvd") \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 45 | _(DUPACK_RCVD, "DUPACK rcvd") \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 46 | _(FIN_RCVD, "FIN rcvd") \ |
| 47 | _(RST_RCVD, "RST rcvd") \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 48 | _(STATE_CHANGE, "state change") \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 49 | _(PKTIZE, "packetize") \ |
| 50 | _(INPUT, "in") \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 51 | _(SND_WND, "snd_wnd update") \ |
| 52 | _(OUTPUT, "output") \ |
| 53 | _(TIMER_POP, "timer pop") \ |
| 54 | _(CC_RTX, "retransmit") \ |
| 55 | _(CC_EVT, "cc event") \ |
| 56 | _(CC_PACK, "cc partial ack") \ |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 57 | _(CC_STAT, "cc stats") \ |
| 58 | _(CC_RTO_STAT, "cc rto stats") \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 59 | _(CC_SCOREBOARD, "scoreboard stats") \ |
| 60 | _(CC_SACKS, "snd sacks stats") \ |
| 61 | _(CC_INPUT, "ooo data delivered") \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 62 | _(SEG_INVALID, "invalid segment") \ |
Florin Coras | c28764f | 2017-04-26 00:08:42 -0700 | [diff] [blame] | 63 | _(PAWS_FAIL, "failed paws check") \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 64 | _(ACK_RCV_ERR, "invalid ack") \ |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 65 | _(RCV_WND_SHRUNK, "shrunk rcv_wnd") \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 66 | |
| 67 | typedef enum _tcp_dbg |
| 68 | { |
| 69 | #define _(sym, str) TCP_DBG_##sym, |
| 70 | foreach_tcp_dbg_evt |
| 71 | #undef _ |
| 72 | } tcp_dbg_e; |
| 73 | |
| 74 | typedef enum _tcp_dbg_evt |
| 75 | { |
| 76 | #define _(sym, str) TCP_EVT_##sym, |
| 77 | foreach_tcp_dbg_evt |
| 78 | #undef _ |
| 79 | } tcp_dbg_evt_e; |
| 80 | |
| 81 | #if TCP_DEBUG |
| 82 | |
| 83 | #define TRANSPORT_DEBUG (1) |
| 84 | |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 85 | /* |
| 86 | * Infra and evt track setup |
| 87 | */ |
| 88 | |
Florin Coras | 9d06304 | 2017-09-14 03:08:00 -0400 | [diff] [blame] | 89 | #define TCP_DBG(_fmt, _args...) clib_warning (_fmt, ##_args) |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 90 | |
| 91 | #define DECLARE_ETD(_tc, _e, _size) \ |
| 92 | struct \ |
| 93 | { \ |
| 94 | u32 data[_size]; \ |
| 95 | } * ed; \ |
| 96 | ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, \ |
| 97 | _e, _tc->c_elog_track) |
| 98 | |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 99 | #define TCP_DBG_IP_TAG_LCL(_tc) \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 100 | { \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 101 | if (_tc->c_is_ip4) \ |
| 102 | { \ |
| 103 | ELOG_TYPE_DECLARE (_e) = \ |
| 104 | { \ |
| 105 | .format = "lcl: %d.%d.%d.%d:%d", \ |
| 106 | .format_args = "i4i4i4i4i4", \ |
| 107 | }; \ |
| 108 | DECLARE_ETD(_tc, _e, 5); \ |
| 109 | ed->data[0] = _tc->c_lcl_ip.ip4.as_u8[0]; \ |
| 110 | ed->data[1] = _tc->c_lcl_ip.ip4.as_u8[1]; \ |
| 111 | ed->data[2] = _tc->c_lcl_ip.ip4.as_u8[2]; \ |
| 112 | ed->data[3] = _tc->c_lcl_ip.ip4.as_u8[3]; \ |
| 113 | ed->data[4] = clib_net_to_host_u16(_tc->c_lcl_port); \ |
| 114 | } \ |
| 115 | } |
| 116 | |
| 117 | #define TCP_DBG_IP_TAG_RMT(_tc) \ |
| 118 | { \ |
| 119 | if (_tc->c_is_ip4) \ |
| 120 | { \ |
| 121 | ELOG_TYPE_DECLARE (_e) = \ |
| 122 | { \ |
| 123 | .format = "rmt: %d.%d.%d.%d:%d", \ |
| 124 | .format_args = "i4i4i4i4i4", \ |
| 125 | }; \ |
| 126 | DECLARE_ETD(_tc, _e, 5); \ |
| 127 | ed->data[0] = _tc->c_rmt_ip.ip4.as_u8[0]; \ |
| 128 | ed->data[1] = _tc->c_rmt_ip.ip4.as_u8[1]; \ |
| 129 | ed->data[2] = _tc->c_rmt_ip.ip4.as_u8[2]; \ |
| 130 | ed->data[3] = _tc->c_rmt_ip.ip4.as_u8[3]; \ |
| 131 | ed->data[4] = clib_net_to_host_u16(_tc->c_rmt_port); \ |
| 132 | } \ |
| 133 | } |
| 134 | |
| 135 | #define TCP_EVT_INIT_HANDLER(_tc, _is_l, ...) \ |
| 136 | { \ |
| 137 | char *_fmt = _is_l ? "l[%d].%d:%d%c" : "[%d].%d:%d->.%d:%d%c"; \ |
| 138 | if (_tc->c_is_ip4) \ |
| 139 | { \ |
| 140 | _tc->c_elog_track.name = \ |
| 141 | (char *) format (0, _fmt, _tc->c_thread_index, \ |
| 142 | _tc->c_lcl_ip.ip4.as_u8[3], \ |
| 143 | clib_net_to_host_u16(_tc->c_lcl_port), \ |
| 144 | _tc->c_rmt_ip.ip4.as_u8[3], \ |
| 145 | clib_net_to_host_u16(_tc->c_rmt_port), 0); \ |
| 146 | } \ |
| 147 | else \ |
| 148 | _tc->c_elog_track.name = \ |
| 149 | (char *) format (0, _fmt, _tc->c_thread_index, \ |
| 150 | _tc->c_lcl_ip.ip6.as_u8[15], \ |
| 151 | clib_net_to_host_u16(_tc->c_lcl_port), \ |
| 152 | _tc->c_rmt_ip.ip6.as_u8[15], \ |
| 153 | clib_net_to_host_u16(_tc->c_rmt_port), 0); \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 154 | elog_track_register (&vlib_global_main.elog_main, &_tc->c_elog_track);\ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 155 | TCP_DBG_IP_TAG_LCL(_tc); \ |
| 156 | TCP_DBG_IP_TAG_RMT(_tc); \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | #define TCP_EVT_DEALLOC_HANDLER(_tc, ...) \ |
| 160 | { \ |
| 161 | vec_free (_tc->c_elog_track.name); \ |
| 162 | } |
| 163 | |
| 164 | #define TCP_EVT_OPEN_HANDLER(_tc, ...) \ |
| 165 | { \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 166 | TCP_EVT_INIT_HANDLER(_tc, 0); \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 167 | ELOG_TYPE_DECLARE (_e) = \ |
| 168 | { \ |
| 169 | .format = "open: index %d", \ |
| 170 | .format_args = "i4", \ |
| 171 | }; \ |
| 172 | DECLARE_ETD(_tc, _e, 1); \ |
| 173 | ed->data[0] = _tc->c_c_index; \ |
| 174 | } |
| 175 | |
| 176 | #define TCP_EVT_CLOSE_HANDLER(_tc, ...) \ |
| 177 | { \ |
| 178 | ELOG_TYPE_DECLARE (_e) = \ |
| 179 | { \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 180 | .format = "close: cidx %d", \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 181 | .format_args = "i4", \ |
| 182 | }; \ |
| 183 | DECLARE_ETD(_tc, _e, 1); \ |
| 184 | ed->data[0] = _tc->c_c_index; \ |
| 185 | } |
| 186 | |
| 187 | #define TCP_EVT_BIND_HANDLER(_tc, ...) \ |
| 188 | { \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 189 | TCP_EVT_INIT_HANDLER(_tc, 1); \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 190 | ELOG_TYPE_DECLARE (_e) = \ |
| 191 | { \ |
| 192 | .format = "bind: listener %d", \ |
| 193 | }; \ |
| 194 | DECLARE_ETD(_tc, _e, 1); \ |
| 195 | ed->data[0] = _tc->c_c_index; \ |
| 196 | } |
| 197 | |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 198 | #define TCP_EVT_SYN_RCVD_HANDLER(_tc,_init, ...) \ |
Florin Coras | 6881062 | 2017-07-24 17:40:28 -0700 | [diff] [blame] | 199 | { \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 200 | if (_init) \ |
| 201 | TCP_EVT_INIT_HANDLER(_tc, 0); \ |
Florin Coras | 6881062 | 2017-07-24 17:40:28 -0700 | [diff] [blame] | 202 | ELOG_TYPE_DECLARE (_e) = \ |
| 203 | { \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 204 | .format = "syn-rx: cidx %u sidx %u irs %u", \ |
| 205 | .format_args = "i4i4i4", \ |
Florin Coras | 6881062 | 2017-07-24 17:40:28 -0700 | [diff] [blame] | 206 | }; \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 207 | DECLARE_ETD(_tc, _e, 3); \ |
Florin Coras | 070fd4b | 2019-04-02 19:03:23 -0700 | [diff] [blame] | 208 | ed->data[0] = _tc->c_c_index; \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 209 | ed->data[1] = _tc->c_s_index; \ |
| 210 | ed->data[2] = _tc->irs; \ |
Florin Coras | 6881062 | 2017-07-24 17:40:28 -0700 | [diff] [blame] | 211 | TCP_EVT_STATE_CHANGE_HANDLER(_tc); \ |
| 212 | } |
| 213 | |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 214 | #define TCP_EVT_UNBIND_HANDLER(_tc, ...) \ |
| 215 | { \ |
| 216 | TCP_EVT_DEALLOC_HANDLER(_tc); \ |
| 217 | ELOG_TYPE_DECLARE (_e) = \ |
| 218 | { \ |
| 219 | .format = "unbind: listener %d", \ |
| 220 | }; \ |
| 221 | DECLARE_ETD(_tc, _e, 1); \ |
| 222 | ed->data[0] = _tc->c_c_index; \ |
| 223 | TCP_EVT_DEALLOC_HANDLER(_tc); \ |
| 224 | } |
| 225 | |
| 226 | #define TCP_EVT_DELETE_HANDLER(_tc, ...) \ |
| 227 | { \ |
| 228 | ELOG_TYPE_DECLARE (_e) = \ |
| 229 | { \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 230 | .format = "delete: cidx %d sidx %d", \ |
| 231 | .format_args = "i4i4", \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 232 | }; \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 233 | DECLARE_ETD(_tc, _e, 2); \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 234 | ed->data[0] = _tc->c_c_index; \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 235 | ed->data[1] = _tc->c_s_index; \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 236 | TCP_EVT_DEALLOC_HANDLER(_tc); \ |
| 237 | } |
| 238 | |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 239 | #define CONCAT_HELPER(_a, _b) _a##_b |
| 240 | #define CC(_a, _b) CONCAT_HELPER(_a, _b) |
| 241 | #define TCP_EVT_DBG(_evt, _args...) CC(_evt, _HANDLER)(_args) |
| 242 | #else |
| 243 | #define TCP_EVT_DBG(_evt, _args...) |
Florin Coras | 9d06304 | 2017-09-14 03:08:00 -0400 | [diff] [blame] | 244 | #define TCP_DBG(_fmt, _args...) |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 245 | #endif |
| 246 | |
| 247 | /* |
| 248 | * State machine |
| 249 | */ |
| 250 | #if TCP_DEBUG_SM |
| 251 | |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 252 | #define TCP_EVT_STATE_CHANGE_HANDLER(_tc, ...) \ |
| 253 | { \ |
| 254 | ELOG_TYPE_DECLARE (_e) = \ |
| 255 | { \ |
| 256 | .format = "state: %s", \ |
| 257 | .format_args = "t4", \ |
| 258 | .n_enum_strings = 11, \ |
| 259 | .enum_strings = { \ |
| 260 | "closed", \ |
| 261 | "listen", \ |
| 262 | "syn-sent", \ |
| 263 | "syn-rcvd", \ |
| 264 | "established", \ |
| 265 | "close_wait", \ |
| 266 | "fin-wait-1", \ |
| 267 | "last-ack", \ |
| 268 | "closing", \ |
| 269 | "fin-wait-2", \ |
| 270 | "time-wait", \ |
| 271 | }, \ |
| 272 | }; \ |
| 273 | DECLARE_ETD(_tc, _e, 1); \ |
| 274 | ed->data[0] = _tc->state; \ |
| 275 | } |
| 276 | |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 277 | #define TCP_EVT_SYN_SENT_HANDLER(_tc, ...) \ |
| 278 | { \ |
| 279 | ELOG_TYPE_DECLARE (_e) = \ |
| 280 | { \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 281 | .format = "syn-tx: iss %u snd_una %u snd_una_max %u snd_nxt %u", \ |
| 282 | .format_args = "i4i4i4i4", \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 283 | }; \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 284 | DECLARE_ETD(_tc, _e, 4); \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 285 | ed->data[0] = _tc->iss; \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 286 | ed->data[1] = _tc->snd_una - _tc->iss; \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 287 | ed->data[2] = _tc->snd_una_max - _tc->iss; \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 288 | ed->data[3] = _tc->snd_nxt - _tc->iss; \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 289 | TCP_EVT_STATE_CHANGE_HANDLER(_tc); \ |
| 290 | } |
| 291 | |
| 292 | #define TCP_EVT_SYNACK_SENT_HANDLER(_tc, ...) \ |
| 293 | { \ |
| 294 | ELOG_TYPE_DECLARE (_e) = \ |
| 295 | { \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 296 | .format = "synack-tx: iss %u irs %u snd_una %u snd_nxt %u rcv_nxt %u",\ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 297 | .format_args = "i4i4i4i4i4", \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 298 | }; \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 299 | DECLARE_ETD(_tc, _e, 5); \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 300 | ed->data[0] = _tc->iss; \ |
| 301 | ed->data[1] = _tc->irs; \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 302 | ed->data[2] = _tc->snd_una - _tc->iss; \ |
| 303 | ed->data[3] = _tc->snd_nxt - _tc->iss; \ |
| 304 | ed->data[4] = _tc->rcv_nxt - _tc->irs; \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 305 | } |
| 306 | |
| 307 | #define TCP_EVT_SYNACK_RCVD_HANDLER(_tc, ...) \ |
| 308 | { \ |
| 309 | ELOG_TYPE_DECLARE (_e) = \ |
| 310 | { \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 311 | .format = "synack-rx: iss %u irs %u snd_una %u snd_nxt %u rcv_nxt %u",\ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 312 | .format_args = "i4i4i4i4i4", \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 313 | }; \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 314 | DECLARE_ETD(_tc, _e, 5); \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 315 | ed->data[0] = _tc->iss; \ |
| 316 | ed->data[1] = _tc->irs; \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 317 | ed->data[2] = _tc->snd_una - _tc->iss; \ |
| 318 | ed->data[3] = _tc->snd_nxt - _tc->iss; \ |
| 319 | ed->data[4] = _tc->rcv_nxt - _tc->irs; \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 320 | TCP_EVT_STATE_CHANGE_HANDLER(_tc); \ |
| 321 | } |
| 322 | |
| 323 | #define TCP_EVT_FIN_SENT_HANDLER(_tc, ...) \ |
| 324 | { \ |
| 325 | ELOG_TYPE_DECLARE (_e) = \ |
| 326 | { \ |
| 327 | .format = "fin-tx: snd_nxt %d rcv_nxt %d", \ |
| 328 | .format_args = "i4i4", \ |
| 329 | }; \ |
| 330 | DECLARE_ETD(_tc, _e, 2); \ |
| 331 | ed->data[0] = _tc->snd_nxt - _tc->iss; \ |
| 332 | ed->data[1] = _tc->rcv_nxt - _tc->irs; \ |
| 333 | } |
| 334 | |
| 335 | #define TCP_EVT_RST_SENT_HANDLER(_tc, ...) \ |
| 336 | { \ |
Florin Coras | fc804d9 | 2018-01-26 01:27:01 -0800 | [diff] [blame] | 337 | if (_tc) \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 338 | { \ |
Florin Coras | fc804d9 | 2018-01-26 01:27:01 -0800 | [diff] [blame] | 339 | ELOG_TYPE_DECLARE (_e) = \ |
| 340 | { \ |
| 341 | .format = "rst-tx: snd_nxt %d rcv_nxt %d", \ |
| 342 | .format_args = "i4i4", \ |
| 343 | }; \ |
| 344 | DECLARE_ETD(_tc, _e, 2); \ |
| 345 | ed->data[0] = _tc->snd_nxt - _tc->iss; \ |
| 346 | ed->data[1] = _tc->rcv_nxt - _tc->irs; \ |
| 347 | TCP_EVT_STATE_CHANGE_HANDLER(_tc); \ |
| 348 | } \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 349 | } |
| 350 | |
| 351 | #define TCP_EVT_FIN_RCVD_HANDLER(_tc, ...) \ |
| 352 | { \ |
| 353 | ELOG_TYPE_DECLARE (_e) = \ |
| 354 | { \ |
| 355 | .format = "fin-rx: snd_nxt %d rcv_nxt %d", \ |
| 356 | .format_args = "i4i4", \ |
| 357 | }; \ |
| 358 | DECLARE_ETD(_tc, _e, 2); \ |
| 359 | ed->data[0] = _tc->snd_nxt - _tc->iss; \ |
| 360 | ed->data[1] = _tc->rcv_nxt - _tc->irs; \ |
| 361 | } |
| 362 | |
| 363 | #define TCP_EVT_RST_RCVD_HANDLER(_tc, ...) \ |
| 364 | { \ |
| 365 | ELOG_TYPE_DECLARE (_e) = \ |
| 366 | { \ |
| 367 | .format = "rst-rx: snd_nxt %d rcv_nxt %d", \ |
| 368 | .format_args = "i4i4", \ |
| 369 | }; \ |
| 370 | DECLARE_ETD(_tc, _e, 2); \ |
| 371 | ed->data[0] = _tc->snd_nxt - _tc->iss; \ |
| 372 | ed->data[1] = _tc->rcv_nxt - _tc->irs; \ |
| 373 | } |
| 374 | |
| 375 | #define TCP_EVT_SYN_RXT_HANDLER(_tc, _type, ...) \ |
| 376 | { \ |
| 377 | ELOG_TYPE_DECLARE (_e) = \ |
| 378 | { \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 379 | .format = "%s-rxt: iss %u irs %u snd_nxt %u rcv_nxt %u", \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 380 | .format_args = "t4i4i4i4i4", \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 381 | .n_enum_strings = 2, \ |
| 382 | .enum_strings = { \ |
| 383 | "syn", \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 384 | "synack", \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 385 | }, \ |
| 386 | }; \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 387 | DECLARE_ETD(_tc, _e, 5); \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 388 | ed->data[0] = _type; \ |
| 389 | ed->data[1] = _tc->iss; \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 390 | ed->data[2] = _tc->irs; \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 391 | ed->data[3] = _tc->snd_nxt - _tc->iss; \ |
| 392 | ed->data[4] = _tc->rcv_nxt - _tc->irs; \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 393 | } |
Florin Coras | 85a3ddd | 2018-12-24 16:54:34 -0800 | [diff] [blame] | 394 | |
| 395 | #define TCP_EVT_TIMER_POP_HANDLER(_tc_index, _timer_id, ...) \ |
| 396 | { \ |
| 397 | tcp_connection_t *_tc; \ |
| 398 | if (_timer_id == TCP_TIMER_RETRANSMIT_SYN \ |
| 399 | || _timer_id == TCP_TIMER_ESTABLISH_AO) \ |
| 400 | { \ |
| 401 | _tc = tcp_half_open_connection_get (_tc_index); \ |
| 402 | } \ |
| 403 | else \ |
| 404 | { \ |
| 405 | u32 _thread_index = vlib_get_thread_index (); \ |
| 406 | _tc = tcp_connection_get (_tc_index, _thread_index); \ |
| 407 | } \ |
| 408 | ELOG_TYPE_DECLARE (_e) = \ |
| 409 | { \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 410 | .format = "timer-pop: %s cidx %u sidx %u", \ |
| 411 | .format_args = "t4i4i4", \ |
Florin Coras | 85a3ddd | 2018-12-24 16:54:34 -0800 | [diff] [blame] | 412 | .n_enum_strings = 8, \ |
| 413 | .enum_strings = { \ |
| 414 | "retransmit", \ |
| 415 | "delack", \ |
| 416 | "persist", \ |
| 417 | "keep", \ |
| 418 | "waitclose", \ |
| 419 | "retransmit syn", \ |
| 420 | "establish", \ |
| 421 | "establish-ao", \ |
| 422 | }, \ |
| 423 | }; \ |
| 424 | if (_tc) \ |
| 425 | { \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 426 | DECLARE_ETD(_tc, _e, 3); \ |
Florin Coras | 85a3ddd | 2018-12-24 16:54:34 -0800 | [diff] [blame] | 427 | ed->data[0] = _timer_id; \ |
Florin Coras | 6416e62 | 2019-04-03 17:52:43 -0700 | [diff] [blame] | 428 | ed->data[1] = _tc->c_c_index; \ |
| 429 | ed->data[2] = _tc->c_s_index; \ |
Florin Coras | 85a3ddd | 2018-12-24 16:54:34 -0800 | [diff] [blame] | 430 | } \ |
| 431 | else \ |
| 432 | { \ |
| 433 | clib_warning ("pop %d for unexisting connection %d", _timer_id, \ |
| 434 | _tc_index); \ |
| 435 | } \ |
| 436 | } |
| 437 | |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 438 | #else |
| 439 | #define TCP_EVT_SYN_SENT_HANDLER(_tc, ...) |
| 440 | #define TCP_EVT_SYNACK_SENT_HANDLER(_tc, ...) |
| 441 | #define TCP_EVT_SYNACK_RCVD_HANDLER(_tc, ...) |
| 442 | #define TCP_EVT_SYN_RXT_HANDLER(_tc, ...) |
| 443 | #define TCP_EVT_FIN_SENT_HANDLER(_tc, ...) |
| 444 | #define TCP_EVT_RST_SENT_HANDLER(_tc, ...) |
| 445 | #define TCP_EVT_FIN_RCVD_HANDLER(_tc, ...) |
| 446 | #define TCP_EVT_RST_RCVD_HANDLER(_tc, ...) |
| 447 | #define TCP_EVT_STATE_CHANGE_HANDLER(_tc, ...) |
Florin Coras | 85a3ddd | 2018-12-24 16:54:34 -0800 | [diff] [blame] | 448 | #define TCP_EVT_TIMER_POP_HANDLER(_tc_index, _timer_id, ...) |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 449 | #endif |
| 450 | |
| 451 | #if TCP_DEBUG_SM > 1 |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 452 | #define TCP_EVT_SEG_INVALID_HANDLER(_tc, _btcp, ...) \ |
| 453 | { \ |
| 454 | ELOG_TYPE_DECLARE (_e) = \ |
| 455 | { \ |
| 456 | .format = "seg-inv: seq %u end %u rcv_las %u rcv_nxt %u rcv_wnd %u",\ |
| 457 | .format_args = "i4i4i4i4i4", \ |
| 458 | }; \ |
| 459 | DECLARE_ETD(_tc, _e, 5); \ |
| 460 | ed->data[0] = _btcp.seq_number - _tc->irs; \ |
| 461 | ed->data[1] = _btcp.seq_end - _tc->irs; \ |
| 462 | ed->data[2] = _tc->rcv_las - _tc->irs; \ |
| 463 | ed->data[3] = _tc->rcv_nxt - _tc->irs; \ |
| 464 | ed->data[4] = _tc->rcv_wnd; \ |
| 465 | } |
| 466 | |
| 467 | #define TCP_EVT_PAWS_FAIL_HANDLER(_tc, _seq, _end, ...) \ |
| 468 | { \ |
| 469 | ELOG_TYPE_DECLARE (_e) = \ |
| 470 | { \ |
| 471 | .format = "paws-err: seq %u end %u tsval %u tsval_recent %u", \ |
| 472 | .format_args = "i4i4i4i4", \ |
| 473 | }; \ |
| 474 | DECLARE_ETD(_tc, _e, 4); \ |
| 475 | ed->data[0] = _seq - _tc->irs; \ |
| 476 | ed->data[1] = _end - _tc->irs; \ |
| 477 | ed->data[2] = _tc->rcv_opts.tsval; \ |
| 478 | ed->data[3] = _tc->tsval_recent; \ |
| 479 | } |
| 480 | |
| 481 | #define TCP_EVT_ACK_RCV_ERR_HANDLER(_tc, _type, _ack, ...) \ |
| 482 | { \ |
| 483 | ELOG_TYPE_DECLARE (_e) = \ |
| 484 | { \ |
| 485 | .format = "ack-err: %s ack %u snd_una %u snd_nxt %u una_max %u", \ |
| 486 | .format_args = "t4i4i4i4i4", \ |
| 487 | .n_enum_strings = 3, \ |
| 488 | .enum_strings = { \ |
| 489 | "invalid", \ |
| 490 | "old", \ |
| 491 | "future", \ |
| 492 | }, \ |
| 493 | }; \ |
| 494 | DECLARE_ETD(_tc, _e, 5); \ |
| 495 | ed->data[0] = _type; \ |
| 496 | ed->data[1] = _ack - _tc->iss; \ |
| 497 | ed->data[2] = _tc->snd_una - _tc->iss; \ |
| 498 | ed->data[3] = _tc->snd_nxt - _tc->iss; \ |
| 499 | ed->data[4] = _tc->snd_una_max - _tc->iss; \ |
| 500 | } |
| 501 | |
| 502 | #define TCP_EVT_RCV_WND_SHRUNK_HANDLER(_tc, _obs, _av, ...) \ |
| 503 | { \ |
| 504 | if (_av > 0) \ |
| 505 | { \ |
| 506 | ELOG_TYPE_DECLARE (_e) = \ |
| 507 | { \ |
| 508 | .format = "huh?: rcv_wnd %u obsd %u av %u rcv_nxt %u rcv_las %u", \ |
| 509 | .format_args = "i4i4i4i4i4", \ |
| 510 | }; \ |
| 511 | DECLARE_ETD(_tc, _e, 5); \ |
| 512 | ed->data[0] = _tc->rcv_wnd; \ |
| 513 | ed->data[1] = _obs; \ |
| 514 | ed->data[2] = _av; \ |
| 515 | ed->data[3] = _tc->rcv_nxt - _tc->irs; \ |
| 516 | ed->data[4] = _tc->rcv_las - _tc->irs; \ |
| 517 | } \ |
| 518 | } |
| 519 | #else |
| 520 | #define TCP_EVT_SEG_INVALID_HANDLER(_tc, _btcp, ...) |
| 521 | #define TCP_EVT_PAWS_FAIL_HANDLER(_tc, _seq, _end, ...) |
| 522 | #define TCP_EVT_ACK_RCV_ERR_HANDLER(_tc, _type, _ack, ...) |
| 523 | #define TCP_EVT_RCV_WND_SHRUNK_HANDLER(_tc, _obs, _av, ...) |
| 524 | #endif |
| 525 | |
| 526 | #if TCP_DEBUG_SM > 2 |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 527 | |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 528 | #define TCP_EVT_ACK_SENT_HANDLER(_tc, ...) \ |
| 529 | { \ |
| 530 | ELOG_TYPE_DECLARE (_e) = \ |
| 531 | { \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 532 | .format = "ack-tx: acked %u rcv_nxt %u rcv_wnd %u snd_nxt %u snd_wnd %u",\ |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 533 | .format_args = "i4i4i4i4i4", \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 534 | }; \ |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 535 | DECLARE_ETD(_tc, _e, 5); \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 536 | ed->data[0] = _tc->rcv_nxt - _tc->rcv_las; \ |
| 537 | ed->data[1] = _tc->rcv_nxt - _tc->irs; \ |
| 538 | ed->data[2] = _tc->rcv_wnd; \ |
| 539 | ed->data[3] = _tc->snd_nxt - _tc->iss; \ |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 540 | ed->data[4] = _tc->snd_wnd; \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 541 | } |
| 542 | |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 543 | #define TCP_EVT_ACK_RCVD_HANDLER(_tc, ...) \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 544 | { \ |
| 545 | ELOG_TYPE_DECLARE (_e) = \ |
| 546 | { \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 547 | .format = "ack-rx: %u snd_una %u snd_wnd %u cwnd %u inflight %u", \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 548 | .format_args = "i4i4i4i4i4", \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 549 | }; \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 550 | DECLARE_ETD(_tc, _e, 5); \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 551 | ed->data[0] = _tc->bytes_acked; \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 552 | ed->data[1] = _tc->snd_una - _tc->iss; \ |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 553 | ed->data[2] = _tc->snd_wnd; \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 554 | ed->data[3] = _tc->cwnd; \ |
| 555 | ed->data[4] = tcp_flight_size(_tc); \ |
| 556 | } |
| 557 | |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 558 | #define TCP_EVT_PKTIZE_HANDLER(_tc, ...) \ |
| 559 | { \ |
| 560 | ELOG_TYPE_DECLARE (_e) = \ |
| 561 | { \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 562 | .format = "tx: una %u snd_nxt %u space %u flight %u rcv_wnd %u",\ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 563 | .format_args = "i4i4i4i4i4", \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 564 | }; \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 565 | DECLARE_ETD(_tc, _e, 5); \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 566 | ed->data[0] = _tc->snd_una - _tc->iss; \ |
| 567 | ed->data[1] = _tc->snd_nxt - _tc->iss; \ |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 568 | ed->data[2] = tcp_available_output_snd_space (_tc); \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 569 | ed->data[3] = tcp_flight_size (_tc); \ |
| 570 | ed->data[4] = _tc->rcv_wnd; \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 571 | } |
| 572 | |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 573 | #define TCP_EVT_INPUT_HANDLER(_tc, _type, _len, _written, ...) \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 574 | { \ |
| 575 | ELOG_TYPE_DECLARE (_e) = \ |
| 576 | { \ |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 577 | .format = "in: %s len %u written %d rcv_nxt %u rcv_wnd(o) %d", \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 578 | .format_args = "t4i4i4i4i4", \ |
| 579 | .n_enum_strings = 2, \ |
| 580 | .enum_strings = { \ |
| 581 | "order", \ |
| 582 | "ooo", \ |
| 583 | }, \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 584 | }; \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 585 | DECLARE_ETD(_tc, _e, 5); \ |
| 586 | ed->data[0] = _type; \ |
| 587 | ed->data[1] = _len; \ |
| 588 | ed->data[2] = _written; \ |
| 589 | ed->data[3] = (_tc->rcv_nxt - _tc->irs) + _written; \ |
| 590 | ed->data[4] = _tc->rcv_wnd - (_tc->rcv_nxt - _tc->rcv_las); \ |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 591 | } |
| 592 | |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 593 | #else |
| 594 | #define TCP_EVT_ACK_SENT_HANDLER(_tc, ...) |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 595 | #define TCP_EVT_ACK_RCVD_HANDLER(_tc, ...) |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 596 | #define TCP_EVT_PKTIZE_HANDLER(_tc, ...) |
| 597 | #define TCP_EVT_INPUT_HANDLER(_tc, _type, _len, _written, ...) |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 598 | #endif |
| 599 | |
| 600 | /* |
| 601 | * State machine verbose |
| 602 | */ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 603 | #if TCP_DEBUG_SM > 3 |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 604 | #define TCP_EVT_SND_WND_HANDLER(_tc, ...) \ |
| 605 | { \ |
| 606 | ELOG_TYPE_DECLARE (_e) = \ |
| 607 | { \ |
Florin Coras | 6534b7a | 2017-07-18 05:38:03 -0400 | [diff] [blame] | 608 | .format = "snd-wnd update: %u ", \ |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 609 | .format_args = "i4", \ |
| 610 | }; \ |
| 611 | DECLARE_ETD(_tc, _e, 1); \ |
| 612 | ed->data[0] = _tc->snd_wnd; \ |
| 613 | } |
| 614 | |
| 615 | #define TCP_EVT_OUTPUT_HANDLER(_tc, flags, n_bytes,...) \ |
| 616 | { \ |
| 617 | ELOG_TYPE_DECLARE (_e) = \ |
| 618 | { \ |
| 619 | .format = "out: flags %x, bytes %u", \ |
| 620 | .format_args = "i4i4", \ |
| 621 | }; \ |
| 622 | DECLARE_ETD(_tc, _e, 2); \ |
| 623 | ed->data[0] = flags; \ |
| 624 | ed->data[1] = n_bytes; \ |
| 625 | } |
| 626 | #else |
| 627 | #define TCP_EVT_SND_WND_HANDLER(_tc, ...) |
| 628 | #define TCP_EVT_OUTPUT_HANDLER(_tc, flags, n_bytes,...) |
| 629 | #endif |
| 630 | |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 631 | /* |
| 632 | * Congestion Control |
| 633 | */ |
| 634 | |
| 635 | #if TCP_DEBUG_CC |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 636 | |
Florin Coras | e55a6d7 | 2018-10-31 23:09:22 -0700 | [diff] [blame] | 637 | #define TCP_EVT_CC_EVT_PRINT(_tc, _sub_evt) \ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 638 | { \ |
| 639 | ELOG_TYPE_DECLARE (_e) = \ |
| 640 | { \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 641 | .format = "cc: %s snd_space %u snd_una %u out %u flight %u", \ |
| 642 | .format_args = "t4i4i4i4i4", \ |
| 643 | .n_enum_strings = 7, \ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 644 | .enum_strings = { \ |
| 645 | "fast-rxt", \ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 646 | "first-rxt", \ |
Florin Coras | e55a6d7 | 2018-10-31 23:09:22 -0700 | [diff] [blame] | 647 | "rxt-timeout", \ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 648 | "recovered", \ |
| 649 | "congestion", \ |
| 650 | "undo", \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 651 | "recovery", \ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 652 | }, \ |
| 653 | }; \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 654 | DECLARE_ETD(_tc, _e, 5); \ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 655 | ed->data[0] = _sub_evt; \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 656 | ed->data[1] = tcp_available_cc_snd_space (_tc); \ |
| 657 | ed->data[2] = _tc->snd_una - _tc->iss; \ |
| 658 | ed->data[3] = tcp_bytes_out(_tc); \ |
| 659 | ed->data[4] = tcp_flight_size (_tc); \ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 660 | } |
Florin Coras | e55a6d7 | 2018-10-31 23:09:22 -0700 | [diff] [blame] | 661 | |
| 662 | #define TCP_EVT_CC_EVT_HANDLER(_tc, _sub_evt, ...) \ |
| 663 | { \ |
| 664 | if (_tc->snd_una != _tc->iss) \ |
| 665 | TCP_EVT_CC_STAT_PRINT (_tc); \ |
| 666 | if ((_sub_evt <= 1 && TCP_DEBUG_CC > 1) \ |
| 667 | || (_sub_evt > 1 && TCP_DEBUG_CC > 0)) \ |
| 668 | TCP_EVT_CC_EVT_PRINT (_tc, _sub_evt); \ |
| 669 | } |
Florin Coras | 537b17e | 2018-09-28 10:35:45 -0700 | [diff] [blame] | 670 | #else |
Florin Coras | e55a6d7 | 2018-10-31 23:09:22 -0700 | [diff] [blame] | 671 | #define TCP_EVT_CC_EVT_HANDLER(_tc, _sub_evt, ...) \ |
| 672 | |
Florin Coras | 537b17e | 2018-09-28 10:35:45 -0700 | [diff] [blame] | 673 | #endif |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 674 | |
Florin Coras | 537b17e | 2018-09-28 10:35:45 -0700 | [diff] [blame] | 675 | #if TCP_DEBUG_CC > 1 |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 676 | #define TCP_EVT_CC_RTX_HANDLER(_tc, offset, n_bytes, ...) \ |
| 677 | { \ |
| 678 | ELOG_TYPE_DECLARE (_e) = \ |
| 679 | { \ |
Florin Coras | 93992a9 | 2017-05-24 18:03:56 -0700 | [diff] [blame] | 680 | .format = "rxt: snd_nxt %u offset %u snd %u rxt %u", \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 681 | .format_args = "i4i4i4i4", \ |
| 682 | }; \ |
| 683 | DECLARE_ETD(_tc, _e, 4); \ |
| 684 | ed->data[0] = _tc->snd_nxt - _tc->iss; \ |
| 685 | ed->data[1] = offset; \ |
| 686 | ed->data[2] = n_bytes; \ |
Florin Coras | 93992a9 | 2017-05-24 18:03:56 -0700 | [diff] [blame] | 687 | ed->data[3] = _tc->snd_rxt_bytes; \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 688 | } |
| 689 | |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 690 | #define TCP_EVT_DUPACK_SENT_HANDLER(_tc, _btcp, ...) \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 691 | { \ |
| 692 | ELOG_TYPE_DECLARE (_e) = \ |
| 693 | { \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 694 | .format = "dack-tx: rcv_nxt %u seq %u rcv_wnd %u snd_nxt %u av_wnd %u",\ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 695 | .format_args = "i4i4i4i4i4", \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 696 | }; \ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 697 | DECLARE_ETD(_tc, _e, 5); \ |
| 698 | ed->data[0] = _tc->rcv_nxt - _tc->irs; \ |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 699 | ed->data[1] = _btcp.seq_number - _tc->irs; \ |
| 700 | ed->data[2] = _tc->rcv_wnd; \ |
| 701 | ed->data[3] = _tc->snd_nxt - _tc->iss; \ |
| 702 | ed->data[4] = tcp_available_snd_wnd(_tc); \ |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 703 | } |
| 704 | |
| 705 | #define TCP_EVT_DUPACK_RCVD_HANDLER(_tc, ...) \ |
| 706 | { \ |
| 707 | ELOG_TYPE_DECLARE (_e) = \ |
| 708 | { \ |
| 709 | .format = "dack-rx: snd_una %u cwnd %u snd_wnd %u flight %u rcv_wnd %u",\ |
| 710 | .format_args = "i4i4i4i4i4", \ |
| 711 | }; \ |
| 712 | DECLARE_ETD(_tc, _e, 5); \ |
| 713 | ed->data[0] = _tc->snd_una - _tc->iss; \ |
| 714 | ed->data[1] = _tc->cwnd; \ |
| 715 | ed->data[2] = _tc->snd_wnd; \ |
| 716 | ed->data[3] = tcp_flight_size(_tc); \ |
| 717 | ed->data[4] = _tc->rcv_wnd; \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 718 | } |
| 719 | |
| 720 | #define TCP_EVT_CC_PACK_HANDLER(_tc, ...) \ |
| 721 | { \ |
| 722 | ELOG_TYPE_DECLARE (_e) = \ |
| 723 | { \ |
| 724 | .format = "pack: snd_una %u snd_una_max %u", \ |
| 725 | .format_args = "i4i4", \ |
| 726 | }; \ |
| 727 | DECLARE_ETD(_tc, _e, 2); \ |
| 728 | ed->data[0] = _tc->snd_una - _tc->iss; \ |
| 729 | ed->data[1] = _tc->snd_una_max - _tc->iss; \ |
| 730 | } |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 731 | #define TCP_EVT_CC_SCOREBOARD_HANDLER(_tc, ...) \ |
| 732 | { \ |
| 733 | if (TCP_DEBUG_CC > 1 && _tc->sack_sb.last_sacked_bytes) \ |
| 734 | { \ |
| 735 | ELOG_TYPE_DECLARE (_e) = \ |
| 736 | { \ |
| 737 | .format = "sb1: holes %u lost %u sacked %u high %u highrxt %u", \ |
| 738 | .format_args = "i4i4i4i4i4", \ |
| 739 | }; \ |
| 740 | DECLARE_ETD(_tc, _e, 5); \ |
| 741 | ed->data[0] = pool_elts(_tc->sack_sb.holes); \ |
| 742 | ed->data[1] = _tc->sack_sb.lost_bytes; \ |
| 743 | ed->data[2] = _tc->sack_sb.sacked_bytes; \ |
| 744 | ed->data[3] = _tc->sack_sb.high_sacked - _tc->iss; \ |
| 745 | ed->data[4] = _tc->sack_sb.high_rxt - _tc->iss; \ |
| 746 | } \ |
| 747 | if (TCP_DEBUG_CC > 1 && _tc->sack_sb.last_sacked_bytes) \ |
| 748 | { \ |
| 749 | sack_scoreboard_hole_t *hole; \ |
| 750 | hole = scoreboard_first_hole (&_tc->sack_sb); \ |
| 751 | ELOG_TYPE_DECLARE (_e) = \ |
| 752 | { \ |
| 753 | .format = "sb2: first start: %u end %u last start %u end %u", \ |
| 754 | .format_args = "i4i4i4i4", \ |
| 755 | }; \ |
| 756 | DECLARE_ETD(_tc, _e, 4); \ |
| 757 | ed->data[0] = hole ? hole->start - _tc->iss : 0; \ |
| 758 | ed->data[1] = hole ? hole->end - _tc->iss : 0; \ |
| 759 | hole = scoreboard_last_hole (&_tc->sack_sb); \ |
| 760 | ed->data[2] = hole ? hole->start - _tc->iss : 0; \ |
| 761 | ed->data[3] = hole ? hole->end - _tc->iss : 0; \ |
| 762 | } \ |
| 763 | } |
| 764 | #define TCP_EVT_CC_SACKS_HANDLER(_tc, ...) \ |
| 765 | { \ |
| 766 | if (TCP_DEBUG_CC > 1) \ |
| 767 | { \ |
| 768 | ELOG_TYPE_DECLARE (_e) = \ |
| 769 | { \ |
| 770 | .format = "sacks: blocks %u bytes %u", \ |
| 771 | .format_args = "i4i4", \ |
| 772 | }; \ |
| 773 | DECLARE_ETD(_tc, _e, 2); \ |
| 774 | ed->data[0] = vec_len (_tc->snd_sacks); \ |
| 775 | ed->data[1] = tcp_sack_list_bytes (_tc); \ |
| 776 | } \ |
| 777 | } |
| 778 | #define TCP_EVT_CC_INPUT_HANDLER(_tc, _len, _written, ...) \ |
| 779 | { \ |
| 780 | ELOG_TYPE_DECLARE (_e) = \ |
| 781 | { \ |
| 782 | .format = "cc input: len %u written %d rcv_nxt %u rcv_wnd(o) %d", \ |
| 783 | .format_args = "i4i4i4i4", \ |
| 784 | }; \ |
| 785 | DECLARE_ETD(_tc, _e, 4); \ |
| 786 | ed->data[0] = _len; \ |
| 787 | ed->data[1] = _written; \ |
| 788 | ed->data[2] = _tc->rcv_nxt - _tc->irs; \ |
| 789 | ed->data[3] = _tc->rcv_wnd - (_tc->rcv_nxt - _tc->rcv_las); \ |
| 790 | } |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 791 | #else |
| 792 | #define TCP_EVT_CC_RTX_HANDLER(_tc, offset, n_bytes, ...) |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 793 | #define TCP_EVT_DUPACK_SENT_HANDLER(_tc, _btcp, ...) |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 794 | #define TCP_EVT_DUPACK_RCVD_HANDLER(_tc, ...) |
| 795 | #define TCP_EVT_CC_PACK_HANDLER(_tc, ...) |
Florin Coras | ca1c8f3 | 2018-05-23 21:01:30 -0700 | [diff] [blame] | 796 | #define TCP_EVT_CC_SCOREBOARD_HANDLER(_tc, ...) |
| 797 | #define TCP_EVT_CC_SACKS_HANDLER(_tc, ...) |
| 798 | #define TCP_EVT_CC_INPUT_HANDLER(_tc, _len, _written, ...) |
Florin Coras | f1762d6 | 2017-09-24 19:43:08 -0400 | [diff] [blame] | 799 | #endif |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 800 | |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 801 | /* |
| 802 | * Congestion control stats |
| 803 | */ |
| 804 | #if TCP_DEBUG_CC_STAT |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 805 | |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 806 | #define STATS_INTERVAL 1 |
| 807 | |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 808 | #define tcp_cc_time_to_print_stats(_tc) \ |
| 809 | _tc->c_cc_stat_tstamp + STATS_INTERVAL < tcp_time_now() \ |
| 810 | || tcp_in_fastrecovery (_tc) \ |
| 811 | |
| 812 | #define TCP_EVT_CC_RTO_STAT_PRINT(_tc) \ |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 813 | { \ |
| 814 | ELOG_TYPE_DECLARE (_e) = \ |
| 815 | { \ |
Florin Coras | efefc6b | 2018-11-07 12:49:19 -0800 | [diff] [blame] | 816 | .format = "rcv_stat: rto %u srtt %u mrtt-us %u rttvar %u", \ |
| 817 | .format_args = "i4i4i4i4", \ |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 818 | }; \ |
Florin Coras | efefc6b | 2018-11-07 12:49:19 -0800 | [diff] [blame] | 819 | DECLARE_ETD(_tc, _e, 4); \ |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 820 | ed->data[0] = _tc->rto; \ |
| 821 | ed->data[1] = _tc->srtt; \ |
Florin Coras | efefc6b | 2018-11-07 12:49:19 -0800 | [diff] [blame] | 822 | ed->data[2] = (u32) (_tc->mrtt_us * 1e6); \ |
| 823 | ed->data[3] = _tc->rttvar; \ |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 824 | } |
| 825 | |
| 826 | #define TCP_EVT_CC_RTO_STAT_HANDLER(_tc, ...) \ |
| 827 | { \ |
| 828 | if (tcp_cc_time_to_print_stats (_tc)) \ |
| 829 | { \ |
| 830 | TCP_EVT_CC_RTO_STAT_PRINT (_tc); \ |
Florin Coras | 3c514d5 | 2018-12-22 11:39:33 -0800 | [diff] [blame] | 831 | _tc->c_cc_stat_tstamp = tcp_time_now (); \ |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 832 | } \ |
| 833 | } |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 834 | |
| 835 | #define TCP_EVT_CC_SND_STAT_PRINT(_tc) \ |
Florin Coras | 6216600 | 2018-04-18 16:40:55 -0700 | [diff] [blame] | 836 | { \ |
| 837 | ELOG_TYPE_DECLARE (_e) = \ |
| 838 | { \ |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 839 | .format = "snd_stat: cc_space %u sacked %u lost %u out %u rxt %u", \ |
Florin Coras | 6216600 | 2018-04-18 16:40:55 -0700 | [diff] [blame] | 840 | .format_args = "i4i4i4i4i4", \ |
| 841 | }; \ |
| 842 | DECLARE_ETD(_tc, _e, 5); \ |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 843 | ed->data[0] = tcp_available_cc_snd_space (_tc); \ |
Florin Coras | 6216600 | 2018-04-18 16:40:55 -0700 | [diff] [blame] | 844 | ed->data[1] = _tc->sack_sb.sacked_bytes; \ |
| 845 | ed->data[2] = _tc->sack_sb.lost_bytes; \ |
| 846 | ed->data[3] = tcp_bytes_out (_tc); \ |
| 847 | ed->data[3] = _tc->snd_rxt_bytes; \ |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 848 | } |
| 849 | |
| 850 | #define TCP_EVT_CC_SND_STAT_HANDLER(_tc, ...) \ |
| 851 | { \ |
| 852 | if (tcp_cc_time_to_print_stats (_tc)) \ |
| 853 | { \ |
| 854 | TCP_EVT_CC_SND_STAT_PRINT(_tc); \ |
Florin Coras | 3c514d5 | 2018-12-22 11:39:33 -0800 | [diff] [blame] | 855 | _tc->c_cc_stat_tstamp = tcp_time_now (); \ |
Florin Coras | 6216600 | 2018-04-18 16:40:55 -0700 | [diff] [blame] | 856 | } \ |
| 857 | } |
Florin Coras | 3e350af | 2017-03-30 02:54:28 -0700 | [diff] [blame] | 858 | |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 859 | #define TCP_EVT_CC_STAT_PRINT(_tc) \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 860 | { \ |
| 861 | ELOG_TYPE_DECLARE (_e) = \ |
| 862 | { \ |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 863 | .format = "cc_stat: cwnd %u flight %u space %u ssthresh %u snd_wnd %u",\ |
| 864 | .format_args = "i4i4i4i4i4", \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 865 | }; \ |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 866 | DECLARE_ETD(_tc, _e, 5); \ |
| 867 | ed->data[0] = _tc->cwnd; \ |
| 868 | ed->data[1] = tcp_flight_size (_tc); \ |
| 869 | ed->data[2] = tcp_snd_space (_tc); \ |
| 870 | ed->data[3] = _tc->ssthresh; \ |
| 871 | ed->data[4] = _tc->snd_wnd; \ |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 872 | TCP_EVT_CC_RTO_STAT_PRINT (_tc); \ |
| 873 | TCP_EVT_CC_SND_STAT_PRINT (_tc); \ |
| 874 | } |
| 875 | |
| 876 | #define TCP_EVT_CC_STAT_HANDLER(_tc, ...) \ |
| 877 | { \ |
| 878 | if (tcp_cc_time_to_print_stats (_tc)) \ |
| 879 | { \ |
| 880 | TCP_EVT_CC_STAT_PRINT (_tc); \ |
Florin Coras | f03a59a | 2017-06-09 21:07:32 -0700 | [diff] [blame] | 881 | _tc->c_cc_stat_tstamp = tcp_time_now(); \ |
| 882 | } \ |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 883 | } |
Florin Coras | c1a448b | 2018-04-20 10:51:49 -0700 | [diff] [blame] | 884 | #else |
| 885 | #define TCP_EVT_CC_STAT_HANDLER(_tc, ...) |
Florin Coras | 0702554 | 2019-01-19 16:45:13 -0800 | [diff] [blame] | 886 | #define TCP_EVT_CC_STAT_PRINT(_tc) |
Florin Coras | c1a448b | 2018-04-20 10:51:49 -0700 | [diff] [blame] | 887 | #endif |
Florin Coras | 6792ec0 | 2017-03-13 03:49:51 -0700 | [diff] [blame] | 888 | |
Florin Coras | f988e69 | 2017-11-27 04:34:14 -0500 | [diff] [blame] | 889 | /* |
| 890 | * Buffer allocation |
| 891 | */ |
| 892 | #if TCP_DEBUG_BUFFER_ALLOCATION |
| 893 | |
| 894 | #define TCP_DBG_BUFFER_ALLOC_MAYBE_FAIL(thread_index) \ |
| 895 | { \ |
| 896 | static u32 *buffer_fail_counters; \ |
Florin Coras | c1a448b | 2018-04-20 10:51:49 -0700 | [diff] [blame] | 897 | if (PREDICT_FALSE (buffer_fail_counters == 0)) \ |
Florin Coras | f988e69 | 2017-11-27 04:34:14 -0500 | [diff] [blame] | 898 | { \ |
| 899 | u32 num_threads; \ |
Florin Coras | c1a448b | 2018-04-20 10:51:49 -0700 | [diff] [blame] | 900 | vlib_thread_main_t *vtm = vlib_get_thread_main (); \ |
Florin Coras | f988e69 | 2017-11-27 04:34:14 -0500 | [diff] [blame] | 901 | num_threads = 1 /* main thread */ + vtm->n_threads; \ |
| 902 | vec_validate (buffer_fail_counters, num_threads - 1); \ |
| 903 | } \ |
| 904 | if (PREDICT_FALSE (tcp_main.buffer_fail_fraction != 0.0)) \ |
| 905 | { \ |
Florin Coras | c1a448b | 2018-04-20 10:51:49 -0700 | [diff] [blame] | 906 | if (PREDICT_TRUE (buffer_fail_counters[thread_index] > 0)) \ |
Florin Coras | f988e69 | 2017-11-27 04:34:14 -0500 | [diff] [blame] | 907 | { \ |
Florin Coras | c1a448b | 2018-04-20 10:51:49 -0700 | [diff] [blame] | 908 | if ((1.0 / (f32) (buffer_fail_counters[thread_index])) \ |
Florin Coras | f988e69 | 2017-11-27 04:34:14 -0500 | [diff] [blame] | 909 | < tcp_main.buffer_fail_fraction) \ |
| 910 | { \ |
| 911 | buffer_fail_counters[thread_index] = 0.0000001; \ |
Florin Coras | c1a448b | 2018-04-20 10:51:49 -0700 | [diff] [blame] | 912 | return -1; \ |
Florin Coras | f988e69 | 2017-11-27 04:34:14 -0500 | [diff] [blame] | 913 | } \ |
| 914 | } \ |
| 915 | buffer_fail_counters[thread_index] ++; \ |
| 916 | } \ |
| 917 | } |
| 918 | #else |
| 919 | #define TCP_DBG_BUFFER_ALLOC_MAYBE_FAIL(thread_index) |
| 920 | #endif |
| 921 | |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 922 | #endif /* SRC_VNET_TCP_TCP_DEBUG_H_ */ |
| 923 | /* |
| 924 | * fd.io coding-style-patch-verification: ON |
| 925 | * |
| 926 | * Local Variables: |
| 927 | * eval: (c-set-style "gnu") |
| 928 | * End: |
| 929 | */ |