From 6e5fc3ecdeea4d3de91afdd9c5ca99c87ed34ce0 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 20 Apr 2022 10:36:46 +0200 Subject: [PATCH] e1oip: Add rate_ctr for IP->E1 RIFO overflows This typically happens if the remote IP peer is transmitting at a faster rate than the E1 side is consuming. Let's add a way to monitor it. Change-Id: Ie0e8bb2f5d2ae4256952f6bf69e514d5c2627a76 --- src/octoi/e1oip.c | 6 +++++- src/octoi/e1oip.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/octoi/e1oip.c b/src/octoi/e1oip.c index b767ba7..7f15e45 100644 --- a/src/octoi/e1oip.c +++ b/src/octoi/e1oip.c @@ -46,6 +46,7 @@ static const struct rate_ctr_desc iline_ctr_description[] = { [LINE_CTR_E1oIP_UNDERRUN] = { "e1oip:underrun", "Frames underrun / slipped in IP->E1 direction"}, [LINE_CTR_E1oIP_SUBSTITUTED] = { "e1oip:substituted", "Frames substituted in E1->IP direction"}, + [LINE_CTR_E1oIP_E1T_OVERFLOW] = { "e1oip:e1t_overflow", "Frames overflowing the RIFO in E1->IP direction"}, [LINE_CTR_E1oIP_E1O_OVERFLOW] = { "e1oip:e1o_overflow", "Frames overflowed in IP->E1 direction"}, [LINE_CTR_E1oIP_RX_OUT_OF_ORDER] = { "e1oip:rx:pkt_out_of_order", "Packets out-of-order in IP->E1 direction"}, [LINE_CTR_E1oIP_RX_OUT_OF_WIN] = { "e1oip:rx:pkt_out_of_win", "Packets out-of-rx-window in IP->E1 direction"}, @@ -245,12 +246,15 @@ int e1oip_rcvmsg_tdm_data(struct e1oip_line *iline, struct msgb *msg) memcpy(frame_buf, iline->e1t.last_frame, BYTES_PER_FRAME); for (unsigned int i = 0; i < n_frames; i++) { + int rc; for (unsigned int j = 0; j < num_ts; j++) { uint8_t ts_nr = idx2ts[j]; frame_buf[ts_nr] = e1th->data[i*num_ts + j]; } /* FIXME: what to do about TS0? */ - frame_rifo_in(&iline->e1t.rifo, frame_buf, fn32+i); + rc = frame_rifo_in(&iline->e1t.rifo, frame_buf, fn32+i); + if (rc < 0) + iline_ctr_add(iline, LINE_CTR_E1oIP_E1T_OVERFLOW, 1); } /* update local state */ memcpy(iline->e1t.last_frame, frame_buf, BYTES_PER_FRAME); diff --git a/src/octoi/e1oip.h b/src/octoi/e1oip.h index 65ae473..54d299a 100644 --- a/src/octoi/e1oip.h +++ b/src/octoi/e1oip.h @@ -16,6 +16,7 @@ enum e1oip_line_ctr { LINE_CTR_E1oIP_UNDERRUN, LINE_CTR_E1oIP_SUBSTITUTED, + LINE_CTR_E1oIP_E1T_OVERFLOW, LINE_CTR_E1oIP_E1O_OVERFLOW, LINE_CTR_E1oIP_RX_OUT_OF_ORDER, LINE_CTR_E1oIP_RX_OUT_OF_WIN,