aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-02-25 18:30:33 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2021-03-01 13:18:36 +0100
commit9688dc9acaa86b9c9f181d822482d08b8308d146 (patch)
tree6648010f2229d26ac9696664ad4d2149cbfb15b2 /src
parentc85e093969d64ec99f1dec1ece3f2ff92d70dd51 (diff)
bts: Add new stats to detect TBF allocation failure reasons
This is specially useful to detect for instance if a cell is handling too many users, ending up in TFI or USF exhaustions. This information can be later in the future used to tune TBF allocation algorithm behavior (either manually/statially through config file, or automatically/dynamically in code based on some thresholds). Related: OS#5042 Change-Id: I5402e937ff8d800684655e500ef8e5c867141dc3
Diffstat (limited to 'src')
-rw-r--r--src/bts.cpp7
-rw-r--r--src/bts.h8
-rw-r--r--src/gprs_rlcmac_ts_alloc.cpp3
3 files changed, 15 insertions, 3 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 8d1fb3f0..55d45b8c 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -100,7 +100,11 @@ static const struct rate_ctr_desc bts_ctr_description[] = {
{ "tbf:reused", "TBF Reused "},
{ "tbf:alloc:algo-a", "TBF Alloc Algo A "},
{ "tbf:alloc:algo-b", "TBF Alloc Algo B "},
- { "tbf:alloc:failed", "TBF Alloc Failure "},
+ { "tbf:alloc:failed", "TBF Alloc Failure (any reason)"},
+ { "tbf:alloc:failed:no_tfi", "TBF Alloc Failure (TFIs exhausted)"},
+ { "tbf:alloc:failed:no_usf", "TBF Alloc Failure (USFs exhausted)"},
+ { "tbf:alloc:failed:no_slot_combi", "TBF Alloc Failure (No valid UL/DL slot combination found)"},
+ { "tbf:alloc:failed:no_slot_avail", "TBF Alloc Failure (No slot available)"},
{ "rlc:sent", "RLC Sent "},
{ "rlc:resent", "RLC Resent "},
{ "rlc:restarted", "RLC Restarted "},
@@ -609,6 +613,7 @@ int bts_tfi_find_free(const struct gprs_rlcmac_bts *bts, enum gprs_rlcmac_tbf_di
if (best_trx_nr == 0xff || best_cnt == 0) {
LOGP(DRLCMAC, LOGL_NOTICE, "No TFI available (suggested TRX: %d).\n", use_trx);
+ bts_do_rate_ctr_inc(bts, CTR_TBF_ALLOC_FAIL_NO_TFI);
return -EBUSY;
}
diff --git a/src/bts.h b/src/bts.h
index d321b8d0..15a72bdc 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -88,6 +88,10 @@ enum {
CTR_TBF_ALLOC_ALGO_A,
CTR_TBF_ALLOC_ALGO_B,
CTR_TBF_ALLOC_FAIL,
+ CTR_TBF_ALLOC_FAIL_NO_TFI,
+ CTR_TBF_ALLOC_FAIL_NO_USF,
+ CTR_TBF_ALLOC_FAIL_NO_SLOT_COMBI,
+ CTR_TBF_ALLOC_FAIL_NO_SLOT_AVAIL,
CTR_RLC_SENT,
CTR_RLC_RESENT,
CTR_RLC_RESTARTED,
@@ -319,11 +323,11 @@ static inline struct osmo_stat_item_group *bts_stat_items(struct gprs_rlcmac_bts
return bts->statg;
}
-static inline void bts_do_rate_ctr_inc(struct gprs_rlcmac_bts *bts, unsigned int ctr_id) {
+static inline void bts_do_rate_ctr_inc(const struct gprs_rlcmac_bts *bts, unsigned int ctr_id) {
rate_ctr_inc(&bts->ratectrs->ctr[ctr_id]);
}
-static inline void bts_do_rate_ctr_add(struct gprs_rlcmac_bts *bts, unsigned int ctr_id, int inc) {
+static inline void bts_do_rate_ctr_add(const struct gprs_rlcmac_bts *bts, unsigned int ctr_id, int inc) {
rate_ctr_add(&bts->ratectrs->ctr[ctr_id], inc);
}
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index 1dc31f6f..dd921e71 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -647,6 +647,7 @@ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *
if (!max_ul_slots || !max_dl_slots) {
LOGP(DRLCMAC, LOGL_NOTICE,
"No valid UL/DL slot combination found\n");
+ bts_do_rate_ctr_inc(trx->bts, CTR_TBF_ALLOC_FAIL_NO_SLOT_COMBI);
return -EINVAL;
}
@@ -719,6 +720,7 @@ static int tbf_select_slot_set(const gprs_rlcmac_tbf *tbf, const gprs_rlcmac_trx
if (!sl) {
LOGP(DRLCMAC, LOGL_NOTICE, "No %s slots available\n",
tbf->direction != GPRS_RLCMAC_DL_TBF ? "uplink" : "downlink");
+ bts_do_rate_ctr_inc(trx->bts, CTR_TBF_ALLOC_FAIL_NO_SLOT_AVAIL);
return -EINVAL;
}
@@ -771,6 +773,7 @@ static int allocate_usf(const gprs_rlcmac_trx *trx, uint8_t selected_ul_slots, u
if (!ul_slots) {
LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n");
+ bts_do_rate_ctr_inc(trx->bts, CTR_TBF_ALLOC_FAIL_NO_USF);
return -EBUSY;
}