aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bts.cpp4
-rw-r--r--src/bts.h12
-rw-r--r--src/gprs_ms.cpp3
-rw-r--r--src/gprs_ms.h14
-rw-r--r--src/gprs_rlcmac_sched.cpp5
-rw-r--r--src/pcu_vty_functions.cpp9
-rw-r--r--src/tbf.cpp45
-rw-r--r--src/tbf.h22
-rw-r--r--src/tbf_dl.cpp5
-rw-r--r--src/tbf_ul.cpp17
10 files changed, 134 insertions, 2 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 603da56..a47d7d8 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -90,6 +90,10 @@ static const struct rate_ctr_desc bts_ctr_description[] = {
{ "llc.ul_bytes", "full PDUs received "},
{ "rach.requests", "RACH requests "},
{ "11bit_rach.requests", "11BIT_RACH requests "},
+ { "spb.uplink_first_segment", "First seg of UL SPB "},
+ { "spb.uplink_second_segment", "Second seg of UL SPB "},
+ { "spb.downlink_first_segment", "First seg of DL SPB "},
+ { "spb.downlink_second_segment","Second seg of DL SPB "},
{ "immediate.assignment_UL", "Immediate Assign UL "},
{ "immediate.assignment_rej", "Immediate Assign Rej "},
{ "immediate.assignment_DL", "Immediate Assign DL "},
diff --git a/src/bts.h b/src/bts.h
index ac870d5..636c7ec 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -266,6 +266,10 @@ public:
CTR_LLC_DL_BYTES,
CTR_LLC_UL_BYTES,
CTR_RACH_REQUESTS,
+ CTR_SPB_UL_FIRST_SEGMENT,
+ CTR_SPB_UL_SECOND_SEGMENT,
+ CTR_SPB_DL_FIRST_SEGMENT,
+ CTR_SPB_DL_SECOND_SEGMENT,
CTR_11BIT_RACH_REQUESTS,
CTR_IMMEDIATE_ASSIGN_UL_TBF,
CTR_IMMEDIATE_ASSIGN_REJ,
@@ -397,6 +401,10 @@ public:
void llc_dl_bytes(int bytes);
void llc_ul_bytes(int bytes);
void rach_frame();
+ void spb_uplink_first_segment();
+ void spb_uplink_second_segment();
+ void spb_downlink_first_segment();
+ void spb_downlink_second_segment();
void rach_frame_11bit();
void immediate_assignment_ul_tbf();
void immediate_assignment_reject();
@@ -594,6 +602,10 @@ CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED);
CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES);
CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES);
CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS);
+CREATE_COUNT_INLINE(spb_uplink_first_segment, CTR_SPB_UL_FIRST_SEGMENT);
+CREATE_COUNT_INLINE(spb_uplink_second_segment, CTR_SPB_UL_SECOND_SEGMENT);
+CREATE_COUNT_INLINE(spb_downlink_first_segment, CTR_SPB_DL_FIRST_SEGMENT);
+CREATE_COUNT_INLINE(spb_downlink_second_segment, CTR_SPB_DL_SECOND_SEGMENT);
CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS);
CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF);
CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ);
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index 8facc50..c6b7e34 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -108,7 +108,8 @@ GprsMs::GprsMs(BTS *bts, uint32_t tlli) :
m_reserved_ul_slots(0),
m_current_trx(NULL),
m_codel_state(NULL),
- m_mode(GprsCodingScheme::GPRS)
+ m_mode(GprsCodingScheme::GPRS),
+ m_dl_ctrl_msg(0)
{
int codel_interval = LLC_CODEL_USE_DEFAULT;
diff --git a/src/gprs_ms.h b/src/gprs_ms.h
index bcc4fb3..72a86c9 100644
--- a/src/gprs_ms.h
+++ b/src/gprs_ms.h
@@ -130,6 +130,8 @@ public:
void update_l1_meas(const pcu_l1_meas *meas);
const pcu_l1_meas* l1_meas() const {return &m_l1_meas;};
unsigned nack_rate_dl() const;
+ unsigned dl_ctrl_msg() const;
+ void update_dl_ctrl_msg();
/* internal use */
static void timeout(void *priv_);
@@ -180,6 +182,8 @@ private:
struct gprs_codel *m_codel_state;
GprsCodingScheme::Mode m_mode;
+
+ unsigned m_dl_ctrl_msg;
};
inline bool GprsMs::is_idle() const
@@ -263,6 +267,16 @@ inline unsigned GprsMs::nack_rate_dl() const
return m_nack_rate_dl;
}
+inline unsigned GprsMs::dl_ctrl_msg() const
+{
+ return m_dl_ctrl_msg;
+}
+
+inline void GprsMs::update_dl_ctrl_msg()
+{
+ m_dl_ctrl_msg++;
+}
+
inline uint8_t GprsMs::reserved_dl_slots() const
{
return m_reserved_dl_slots;
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index a3723df..fdda79d 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -179,6 +179,8 @@ static struct msgb *sched_select_ctrl_msg(
LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling control "
"message at RTS for %s (TRX=%d, TS=%d)\n",
tbf_name(tbf), trx, ts);
+ /* Updates the dl ctrl msg counter for ms */
+ tbf->ms()->update_dl_ctrl_msg();
return msg;
}
/* schedule PACKET PAGING REQUEST */
@@ -186,6 +188,9 @@ static struct msgb *sched_select_ctrl_msg(
if (msg) {
LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling paging request "
"message at RTS for (TRX=%d, TS=%d)\n", trx, ts);
+
+ /* Updates the dl ctrl msg counter for ms */
+ tbf->ms()->update_dl_ctrl_msg();
return msg;
}
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index 4b4b36d..ce79e05 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -70,6 +70,13 @@ static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf)
gprs_rlc_ul_window *win = &ul_tbf->m_window;
vty_out(vty, " V(Q)=%d V(R)=%d",
win->v_q(), win->v_r());
+ vty_out(vty, "%s", VTY_NEWLINE);
+ vty_out(vty, " TBF Statistics:%s", VTY_NEWLINE);
+ if(GprsCodingScheme::GPRS == tbf->ms()->mode()) {
+ vty_out_rate_ctr_group(vty, " ", ul_tbf->m_ul_gprs_ctrs);
+ } else {
+ vty_out_rate_ctr_group(vty, " ", ul_tbf->m_ul_egprs_ctrs);
+ }
}
if (dl_tbf) {
gprs_rlc_dl_window *win = &dl_tbf->m_window;
@@ -178,6 +185,8 @@ static int show_ms(struct vty *vty, GprsMs *ms)
vty_out(vty, " MS I level (slot %d): %d dB%s",
i, ms->l1_meas()->ts[i].ms_i_level, VTY_NEWLINE);
}
+ vty_out(vty, " RLC/MAC DL Control Msg: %d%s", ms->dl_ctrl_msg(),
+ VTY_NEWLINE);
if (ms->ul_tbf())
vty_out(vty, " Uplink TBF: TFI=%d, state=%s%s",
ms->ul_tbf()->tfi(),
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 60fba68..0e4d6cc 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -66,6 +66,25 @@ static const struct rate_ctr_desc tbf_dl_egprs_ctr_description[] = {
{ "egprs.downlink.mcs9", "MCS9 " },
};
+static const struct rate_ctr_desc tbf_ul_gprs_ctr_description[] = {
+ { "gprs.uplink.cs1", "CS1 " },
+ { "gprs.uplink.cs2", "CS2 " },
+ { "gprs.uplink.cs3", "CS3 " },
+ { "gprs.uplink.cs4", "CS4 " },
+};
+
+static const struct rate_ctr_desc tbf_ul_egprs_ctr_description[] = {
+ { "egprs.uplink.mcs1", "MCS1 " },
+ { "egprs.uplink.mcs2", "MCS2 " },
+ { "egprs.uplink.mcs3", "MCS3 " },
+ { "egprs.uplink.mcs4", "MCS4 " },
+ { "egprs.uplink.mcs5", "MCS5 " },
+ { "egprs.uplink.mcs6", "MCS6 " },
+ { "egprs.uplink.mcs7", "MCS7 " },
+ { "egprs.uplink.mcs8", "MCS8 " },
+ { "egprs.uplink.mcs9", "MCS9 " },
+};
+
static const struct rate_ctr_group_desc tbf_ctrg_desc = {
"pcu.tbf",
"TBF Statistics",
@@ -90,6 +109,22 @@ static const struct rate_ctr_group_desc tbf_dl_egprs_ctrg_desc = {
tbf_dl_egprs_ctr_description,
};
+static const struct rate_ctr_group_desc tbf_ul_gprs_ctrg_desc = {
+ "tbf.gprs",
+ "Data Blocks",
+ OSMO_STATS_CLASS_SUBSCRIBER,
+ ARRAY_SIZE(tbf_ul_gprs_ctr_description),
+ tbf_ul_gprs_ctr_description,
+};
+
+static const struct rate_ctr_group_desc tbf_ul_egprs_ctrg_desc = {
+ "tbf.egprs",
+ "Data Blocks",
+ OSMO_STATS_CLASS_SUBSCRIBER,
+ ARRAY_SIZE(tbf_ul_egprs_ctr_description),
+ tbf_ul_egprs_ctr_description,
+};
+
gprs_rlcmac_tbf::Meas::Meas() :
rssi_sum(0),
rssi_num(0)
@@ -370,9 +405,12 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf)
{
/* update counters */
if (tbf->direction == GPRS_RLCMAC_UL_TBF) {
+ gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf);
tbf->bts->tbf_ul_freed();
if (tbf->state_is(GPRS_RLCMAC_FLOW))
tbf->bts->tbf_ul_aborted();
+ rate_ctr_group_free(ul_tbf->m_ul_egprs_ctrs);
+ rate_ctr_group_free(ul_tbf->m_ul_gprs_ctrs);
} else {
gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf);
if (tbf->is_egprs_enabled()) {
@@ -713,7 +751,9 @@ gprs_rlcmac_ul_tbf::gprs_rlcmac_ul_tbf(BTS *bts_) :
m_rx_counter(0),
m_n3103(0),
m_contention_resolution_done(0),
- m_final_ack_sent(0)
+ m_final_ack_sent(0),
+ m_ul_gprs_ctrs(NULL),
+ m_ul_egprs_ctrs(NULL)
{
memset(&m_usf, 0, sizeof(m_usf));
}
@@ -782,6 +822,9 @@ struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts,
return NULL;
}
+ tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_egprs_ctrg_desc, 0);
+ tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_gprs_ctrg_desc, 0);
+
llist_add(&tbf->list(), &bts->bts->ul_tbfs());
tbf->bts->tbf_ul_created();
diff --git a/src/tbf.h b/src/tbf.h
index 5017d3e..ad1ece2 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -102,6 +102,25 @@ enum tbf_egprs_counters {
TBF_CTR_EGPRS_DL_MCS9,
};
+enum tbf_gprs_ul_counters {
+ TBF_CTR_GPRS_UL_CS1,
+ TBF_CTR_GPRS_UL_CS2,
+ TBF_CTR_GPRS_UL_CS3,
+ TBF_CTR_GPRS_UL_CS4,
+};
+
+enum tbf_egprs_ul_counters {
+ TBF_CTR_EGPRS_UL_MCS1,
+ TBF_CTR_EGPRS_UL_MCS2,
+ TBF_CTR_EGPRS_UL_MCS3,
+ TBF_CTR_EGPRS_UL_MCS4,
+ TBF_CTR_EGPRS_UL_MCS5,
+ TBF_CTR_EGPRS_UL_MCS6,
+ TBF_CTR_EGPRS_UL_MCS7,
+ TBF_CTR_EGPRS_UL_MCS8,
+ TBF_CTR_EGPRS_UL_MCS9,
+};
+
#define GPRS_RLCMAC_FLAG_CCCH 0 /* assignment on CCCH */
#define GPRS_RLCMAC_FLAG_PACCH 1 /* assignment on PACCH */
#define GPRS_RLCMAC_FLAG_UL_DATA 2 /* uplink data received */
@@ -511,6 +530,9 @@ struct gprs_rlcmac_ul_tbf : public gprs_rlcmac_tbf {
uint8_t m_contention_resolution_done; /* set after done */
uint8_t m_final_ack_sent; /* set if we sent final ack */
+ struct rate_ctr_group *m_ul_gprs_ctrs;
+ struct rate_ctr_group *m_ul_egprs_ctrs;
+
protected:
void maybe_schedule_uplink_acknack(const gprs_rlc_data_info *rlc);
};
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 2af2ff0..78f06e9 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -1298,16 +1298,21 @@ enum egprs_rlcmac_dl_spb gprs_rlcmac_dl_tbf::get_egprs_dl_spb(const int bsn)
* other wise it should be 2
*/
if (block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT) {
+
+ /* statistics */
+ bts->spb_downlink_second_segment();
return EGPRS_RLCMAC_DL_SEC_SEG;
} else if ((cs_init.headerTypeData() ==
GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1) ||
(cs_init.headerTypeData() ==
GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2)) {
+ bts->spb_downlink_first_segment();
return EGPRS_RLCMAC_DL_FIRST_SEG;
} else if ((GprsCodingScheme::Scheme(cs_init) ==
GprsCodingScheme::MCS4) &&
(GprsCodingScheme::Scheme(cs_current_trans) ==
GprsCodingScheme::MCS1)) {
+ bts->spb_downlink_first_segment();
return EGPRS_RLCMAC_DL_FIRST_SEG;
}
}
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 420fc1a..0de0127 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -397,6 +397,8 @@ egprs_rlc_ul_reseg_bsn_state gprs_rlcmac_ul_tbf::handle_egprs_ul_second_seg(
union split_block_status *spb_status = &block->spb_status;
uint8_t *rlc_data = &block->block[0];
+ bts->spb_uplink_second_segment();
+
if (spb_status->block_status_ul &
EGPRS_RESEG_FIRST_SEG_RXD) {
LOGP(DRLCMACUL, LOGL_DEBUG,
@@ -433,6 +435,8 @@ egprs_rlc_ul_reseg_bsn_state gprs_rlcmac_ul_tbf::handle_egprs_ul_first_seg(
uint8_t *rlc_data = &block->block[0];
union split_block_status *spb_status = &block->spb_status;
+ bts->spb_uplink_first_segment();
+
if (spb_status->block_status_ul & EGPRS_RESEG_SECOND_SEG_RXD) {
LOGP(DRLCMACUL, LOGL_DEBUG,
"---%s: First seg is received "
@@ -527,45 +531,58 @@ void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme
switch (coding_scheme) {
case GprsCodingScheme::CS1 :
bts->gprs_ul_cs1();
+ rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS1]);
break;
case GprsCodingScheme::CS2 :
bts->gprs_ul_cs2();
+ rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS2]);
break;
case GprsCodingScheme::CS3 :
bts->gprs_ul_cs3();
+ rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS3]);
break;
case GprsCodingScheme::CS4 :
bts->gprs_ul_cs4();
+ rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS4]);
break;
}
} else {
switch (coding_scheme) {
case GprsCodingScheme::MCS1 :
bts->egprs_ul_mcs1();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS1]);
break;
case GprsCodingScheme::MCS2 :
bts->egprs_ul_mcs2();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS2]);
break;
case GprsCodingScheme::MCS3 :
bts->egprs_ul_mcs3();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS3]);
break;
case GprsCodingScheme::MCS4 :
bts->egprs_ul_mcs4();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS4]);
break;
case GprsCodingScheme::MCS5 :
bts->egprs_ul_mcs5();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS5]);
break;
case GprsCodingScheme::MCS6 :
bts->egprs_ul_mcs6();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS6]);
break;
case GprsCodingScheme::MCS7 :
bts->egprs_ul_mcs7();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS7]);
break;
case GprsCodingScheme::MCS8 :
bts->egprs_ul_mcs8();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS8]);
break;
case GprsCodingScheme::MCS9 :
bts->egprs_ul_mcs9();
+ rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS9]);
break;
}
}