X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fhs_apps%2Fsapi%2Fvpp_echo.c;h=739797a28e2998b6434c9ca1c258f9605d404d49;hb=380e857830985e1b50257b39ba6045b829c833c1;hp=019860a47c7c9c313fe3c233607f01f817e896c8;hpb=407f593dc0d06453f0b5c124b3a48edd52da6704;p=vpp.git diff --git a/src/plugins/hs_apps/sapi/vpp_echo.c b/src/plugins/hs_apps/sapi/vpp_echo.c index 019860a47c7..739797a28e2 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo.c +++ b/src/plugins/hs_apps/sapi/vpp_echo.c @@ -150,7 +150,7 @@ print_global_json_stats (echo_main_t * em) fformat (stdout, " \"end_evt_missing\": \"%s\",\n", end_evt_missing ? "True" : "False"); fformat (stdout, " \"rx_data\": %lld,\n", em->stats.rx_total); - fformat (stdout, " \"tx_rx\": %lld,\n", em->stats.tx_total); + fformat (stdout, " \"tx_data\": %lld,\n", em->stats.tx_total); fformat (stdout, " \"closing\": {\n"); fformat (stdout, " \"reset\": { \"q\": %d, \"s\": %d },\n", em->stats.reset_count.q, em->stats.reset_count.s); @@ -244,10 +244,15 @@ echo_update_count_on_session_close (echo_main_t * em, echo_session_t * s) s->bytes_received, s->bytes_received + s->bytes_to_receive, echo_format_session, s, s->bytes_sent, s->bytes_sent + s->bytes_to_send); + + ASSERT (em->stats.tx_total + s->bytes_sent <= em->stats.tx_expected); + ASSERT (em->stats.rx_total + s->bytes_received <= em->stats.rx_expected); clib_atomic_fetch_add (&em->stats.tx_total, s->bytes_sent); clib_atomic_fetch_add (&em->stats.rx_total, s->bytes_received); - if (PREDICT_FALSE (em->stats.rx_total == em->stats.rx_expected)) + if (PREDICT_FALSE + ((em->stats.rx_total == em->stats.rx_expected) + && (em->stats.tx_total == em->stats.tx_expected))) echo_notify_event (em, ECHO_EVT_LAST_BYTE); } @@ -413,7 +418,7 @@ echo_handle_data (echo_main_t * em, echo_session_t * s, u8 * rx_buf) { if (n_sent || n_read) s->idle_cycles = 0; - else if (s->idle_cycles++ == 1e7) + else if (s->idle_cycles++ == LOG_EVERY_N_IDLE_CYCLES) { s->idle_cycles = 0; ECHO_LOG (2, "Idle client TX:%dB RX:%dB", s->bytes_to_send,