From b3d5ee2934f930e611cd4447b90dce6723340062 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 13 Nov 2013 16:43:26 +0100 Subject: bts: Count the number of llc frames that were "scheduled" to be sent This does not mean that they have been successfully transferred to the SGSN/MS but at least that they have reached a certain point in the message flow. --- src/bts.cpp | 1 + src/bts.h | 11 +++++++---- src/llc.cpp | 2 +- src/tbf.cpp | 6 +++++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/bts.cpp b/src/bts.cpp index e4c4bfa9..409b5d39 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -60,6 +60,7 @@ static const struct rate_ctr_desc bts_ctr_description[] = { { "sba.timedout", "SBA Timeout "}, { "llc.timeout", "Timedout Frames "}, { "llc.dropped", "Dropped Frames "}, + { "llc.scheduled", "Scheduled Frames "}, { "rach.requests", "RACH requests "}, }; diff --git a/src/bts.h b/src/bts.h index 5a55ed08..7aa150b0 100644 --- a/src/bts.h +++ b/src/bts.h @@ -164,6 +164,7 @@ public: CTR_SBA_TIMEDOUT, CTR_LLC_FRAME_TIMEDOUT, CTR_LLC_FRAME_DROPPED, + CTR_LLC_FRAME_SCHED, CTR_RACH_REQUESTS, }; @@ -207,8 +208,9 @@ public: void sba_allocated(); void sba_freed(); void sba_timedout(); - void timedout_frame(); - void dropped_frame(); + void llc_timedout_frame(); + void llc_dropped_frame(); + void llc_frame_sched(); void rach_frame(); /* @@ -269,8 +271,9 @@ CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT) -CREATE_COUNT_INLINE(timedout_frame, CTR_LLC_FRAME_TIMEDOUT); -CREATE_COUNT_INLINE(dropped_frame, CTR_LLC_FRAME_DROPPED); +CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); +CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); +CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); #undef CREATE_COUNT_INLINE diff --git a/src/llc.cpp b/src/llc.cpp index 88b701a1..1787daa6 100644 --- a/src/llc.cpp +++ b/src/llc.cpp @@ -60,7 +60,7 @@ void gprs_llc::clear(BTS *bts) struct msgb *msg; while ((msg = msgb_dequeue(&queue))) { - bts->dropped_frame(); + bts->llc_dropped_frame(); msgb_free(msg); } } diff --git a/src/tbf.cpp b/src/tbf.cpp index 2310f855..aa0f2236 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -101,6 +101,7 @@ int gprs_rlcmac_tbf::append_data(const uint8_t ms_class, #warning "verify that m_llc.index/length is 0... check the state change" bts->tbf_reused(); m_llc.put_frame(data, len); + bts->llc_frame_sched(); /* reset rlc states */ memset(&dir.dl, 0, sizeof(dir.dl)); /* keep to flags */ @@ -190,6 +191,7 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts, /* new TBF, so put first frame */ tbf->m_llc.put_frame(data, len); + tbf->bts->llc_frame_sched(); /* Store IMSI for later look-up and PCH retransmission */ tbf->assign_imsi(imsi); @@ -695,7 +697,7 @@ struct msgb *gprs_rlcmac_tbf::llc_dequeue(bssgp_bvc_ctx *bctx) LOGP(DRLCMACDL, LOGL_NOTICE, "%s Discarding LLC PDU " "because lifetime limit reached\n", tbf_name(this)); - bts->timedout_frame(); + bts->llc_timedout_frame(); frames++; octets += msg->len; msgb_free(msg); @@ -1083,6 +1085,7 @@ do_resend: LOGP(DRLCMACDL, LOGL_INFO, "- Dequeue next LLC for " "%s (len=%d)\n", tbf_name(this), msg->len); m_llc.put_frame(msg->data, msg->len); + bts->llc_frame_sched(); msgb_free(msg); } /* if we have more data and we have space left */ @@ -1538,6 +1541,7 @@ int gprs_rlcmac_tbf::snd_dl_ack(uint8_t final, uint8_t ssn, uint8_t *rbb) } #warning "Copy and paste on the sender path" m_llc.put_frame(msg->data, msg->len); + bts->llc_frame_sched(); msgb_free(msg); /* we have a message, so we trigger downlink assignment, and there -- cgit v1.2.3