<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25242">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sched: energy saving: Avoid Tx dummy blocks on empty PDCH TS<br><br>Related: SYS#4919<br>Related: OS#4772<br>Change-Id: I8d66dd5e838748611e7b77b504fc86295f02c019<br>---<br>M src/gprs_rlcmac_sched.cpp<br>1 file changed, 23 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/42/25242/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp</span><br><span>index 5427e52..ff5e6bb 100644</span><br><span>--- a/src/gprs_rlcmac_sched.cpp</span><br><span>+++ b/src/gprs_rlcmac_sched.cpp</span><br><span>@@ -485,12 +485,29 @@</span><br><span>             gsmtap_cat = tx_is_egprs ? PCU_GSMTAP_C_DL_DATA_EGPRS :</span><br><span>                                         PCU_GSMTAP_C_DL_DATA_GPRS;</span><br><span>        }</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Prio 3: send dummy contol message */</span><br><span style="color: hsl(0, 100%, 40%);">- else if ((msg = sched_dummy())) {</span><br><span style="color: hsl(0, 100%, 40%);">-               /* increase counter */</span><br><span style="color: hsl(0, 100%, 40%);">-          gsmtap_cat = PCU_GSMTAP_C_DL_DUMMY;</span><br><span style="color: hsl(0, 100%, 40%);">-     } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                return -ENOMEM;</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Prio 3: send dummy control message if need to poll or USF */</span><br><span style="color: hsl(120, 100%, 40%);">+       else {</span><br><span style="color: hsl(120, 100%, 40%);">+                /* If there's no TBF attached to this PDCH, we can early skip since</span><br><span style="color: hsl(120, 100%, 40%);">+                * there's nothing to transmit nor to poll/USF. This way we help BTS</span><br><span style="color: hsl(120, 100%, 40%);">+               * energy saving (on TRX!=C0) by sending nothing instead of a</span><br><span style="color: hsl(120, 100%, 40%);">+          * dummy block. The early return is done here and not at the</span><br><span style="color: hsl(120, 100%, 40%);">+           * start of the function because the condition below</span><br><span style="color: hsl(120, 100%, 40%);">+           * (num_tbfs==0) may not be enough in general, for instance</span><br><span style="color: hsl(120, 100%, 40%);">+            * because temporary tbfs created to send Imm Ass Rej (see</span><br><span style="color: hsl(120, 100%, 40%);">+             * handle_tbf_reject()) don't have a TFI assigned and hence are</span><br><span style="color: hsl(120, 100%, 40%);">+            * not attached to the PDCH TS, so they don't show up in the</span><br><span style="color: hsl(120, 100%, 40%);">+               * count below.</span><br><span style="color: hsl(120, 100%, 40%);">+                */</span><br><span style="color: hsl(120, 100%, 40%);">+           const unsigned num_tbfs = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF)</span><br><span style="color: hsl(120, 100%, 40%);">+                                       + pdch->num_tbfs(GPRS_RLCMAC_UL_TBF);</span><br><span style="color: hsl(120, 100%, 40%);">+              if (trx != 0 && num_tbfs == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+                        return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+             if ((msg = sched_dummy())) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  /* increase counter */</span><br><span style="color: hsl(120, 100%, 40%);">+                        gsmtap_cat = PCU_GSMTAP_C_DL_DUMMY;</span><br><span style="color: hsl(120, 100%, 40%);">+           } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      return -ENOMEM;</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span>    }</span><br><span> </span><br><span>        if (tx_is_egprs && pdch->has_gprs_only_tbf_attached()) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25242">change 25242</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-pcu/+/25242"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I8d66dd5e838748611e7b77b504fc86295f02c019 </div>
<div style="display:none"> Gerrit-Change-Number: 25242 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>