diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-08-25 16:49:48 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-08-26 12:51:15 +0200 |
commit | a89a23881f26ea16b53a1736b2e617b3bf831965 (patch) | |
tree | d00970eca043cbb0b1038641218e12b42735ac94 | |
parent | c4fe1f97b49f337957d26af5859f70f8403f194d (diff) |
sched: energy saving: Avoid Tx dummy blocks on empty PDCH TS
-rw-r--r-- | src/gprs_rlcmac_sched.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 5427e52b..00f740ed 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -485,12 +485,28 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, gsmtap_cat = tx_is_egprs ? PCU_GSMTAP_C_DL_DATA_EGPRS : PCU_GSMTAP_C_DL_DATA_GPRS; } - /* Prio 3: send dummy contol message */ - else if ((msg = sched_dummy())) { - /* increase counter */ - gsmtap_cat = PCU_GSMTAP_C_DL_DUMMY; - } else { - return -ENOMEM; + /* Prio 3: send dummy control message if need to poll or USF */ + else { + /* If there's no TBF attached to this PDCH, we can early skip + * since there's nothing to transmit nor to poll/USF. This way + * we help BTS energy saving (on TRX!=C0) by sending nothing + * instead of a dummy block. The early return is done here and + * not at the start of the function because the condition below + * (num_tbfs==0) may not be enough, because temporary dummy TBFs + * created to send Imm Ass Rej (see handle_tbf_reject()) don't + * have a TFI assigned and hence are not attached to the PDCH + * TS, so they don't show up in the count below. + */ + const unsigned num_tbfs = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + + pdch->num_tbfs(GPRS_RLCMAC_UL_TBF); + if (trx != 0 && num_tbfs == 0) + return 0; + if ((msg = sched_dummy())) { + /* increase counter */ + gsmtap_cat = PCU_GSMTAP_C_DL_DUMMY; + } else { + return -ENOMEM; + } } if (tx_is_egprs && pdch->has_gprs_only_tbf_attached()) { |