<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25752">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">tbf_dl_ass_fsm: Move block msg generation conditions to rts() function<br><br>Move the required conditions to generate a message to the rts()<br>function, this way the scheduler knows this TBF cannot yet attempt the<br>procedure and hence will not request it to create a message which will<br>fail.<br><br>This way the scheduler will schedule other itneresting messages instead<br>of failing and scheduling a dummy block as a result.<br><br>Change-Id: Idbe4f9bbd23005a43c586b737cf9adc2114287e2<br>---<br>M src/tbf_dl_ass_fsm.c<br>1 file changed, 22 insertions(+), 23 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/52/25752/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/tbf_dl_ass_fsm.c b/src/tbf_dl_ass_fsm.c</span><br><span>index 5ac1c1a..37ced61 100644</span><br><span>--- a/src/tbf_dl_ass_fsm.c</span><br><span>+++ b/src/tbf_dl_ass_fsm.c</span><br><span>@@ -65,31 +65,10 @@</span><br><span>       /* We only use this function in control TS (PACCH) so that MS can always answer the poll */</span><br><span>  OSMO_ASSERT(tbf_is_control_ts(ctx->tbf, d->ts));</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      if (tbf_ul_ass_fi(ctx->tbf)->state == TBF_UL_ASS_WAIT_ACK)</span><br><span style="color: hsl(0, 100%, 40%);">-        {</span><br><span style="color: hsl(0, 100%, 40%);">-               LOGPTBF(ctx->tbf, LOGL_DEBUG,</span><br><span style="color: hsl(0, 100%, 40%);">-                          "Polling is already scheduled, so we must wait for the uplink assignment...\n");</span><br><span style="color: hsl(0, 100%, 40%);">-            // FIXME: call tbf_dl_ass_fsm_state_chg(ctx->fi, TBF_DL_ASS_NONE); ?</span><br><span style="color: hsl(0, 100%, 40%);">-         return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span>    rc = tbf_check_polling(ctx->tbf, d->fn, d->ts, &new_poll_fn, &rrbp);</span><br><span>        if (rc < 0)</span><br><span>               return NULL;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        /* on uplink TBF we get the downlink TBF to be assigned. */</span><br><span style="color: hsl(0, 100%, 40%);">-     if (tbf_direction(ctx->tbf) == GPRS_RLCMAC_UL_TBF) {</span><br><span style="color: hsl(0, 100%, 40%);">-         struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(ctx->tbf);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-             /* be sure to check first, if contention resolution is done,</span><br><span style="color: hsl(0, 100%, 40%);">-             * otherwise we cannot send the assignment yet (3GPP TS 44.060 sec 7.1.3.1) */</span><br><span style="color: hsl(0, 100%, 40%);">-          if (!ul_tbf_contention_resolution_done(ul_tbf)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       LOGPTBF(ctx->tbf, LOGL_DEBUG,</span><br><span style="color: hsl(0, 100%, 40%);">-                                "Cannot assign DL TBF now, because contention resolution is not finished.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                        // FIXME: call tbf_dl_ass_fsm_state_chg(ctx->fi, TBF_DL_ASS_NONE); ?</span><br><span style="color: hsl(0, 100%, 40%);">-                 return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-            }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    new_dl_tbf = ms_dl_tbf(ms);</span><br><span>  if (!new_dl_tbf) {</span><br><span>           LOGPTBF(ctx->tbf, LOGL_ERROR,</span><br><span>@@ -273,8 +252,28 @@</span><br><span>      return data_ctx.msg;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-bool tbf_dl_ass_rts(const struct gprs_rlcmac_tbf* tbf)</span><br><span style="color: hsl(120, 100%, 40%);">+bool tbf_dl_ass_rts(const struct gprs_rlcmac_tbf *tbf)</span><br><span> {</span><br><span>     struct osmo_fsm_inst *fi = tbf_dl_ass_fi(tbf);</span><br><span style="color: hsl(0, 100%, 40%);">-  return fi->state == TBF_DL_ASS_SEND_ASS;</span><br><span style="color: hsl(120, 100%, 40%);">+   if (fi->state != TBF_DL_ASS_SEND_ASS)</span><br><span style="color: hsl(120, 100%, 40%);">+              return false;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       if (tbf_ul_ass_fi(tbf)->state == TBF_UL_ASS_WAIT_ACK) {</span><br><span style="color: hsl(120, 100%, 40%);">+            LOGPTBF(tbf, LOGL_DEBUG,</span><br><span style="color: hsl(120, 100%, 40%);">+                      "Polling is already scheduled, so we must wait for the uplink assignment...\n");</span><br><span style="color: hsl(120, 100%, 40%);">+            return false;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* on uplink TBF we get the downlink TBF to be assigned. */</span><br><span style="color: hsl(120, 100%, 40%);">+   if (tbf_direction(tbf) == GPRS_RLCMAC_UL_TBF) {</span><br><span style="color: hsl(120, 100%, 40%);">+               const struct gprs_rlcmac_ul_tbf *ul_tbf = (const struct gprs_rlcmac_ul_tbf *)tbf;</span><br><span style="color: hsl(120, 100%, 40%);">+             /* be sure to check first, if contention resolution is done,</span><br><span style="color: hsl(120, 100%, 40%);">+           * otherwise we cannot send the assignment yet (3GPP TS 44.060 sec 7.1.3.1) */</span><br><span style="color: hsl(120, 100%, 40%);">+                if (!ul_tbf_contention_resolution_done(ul_tbf)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     LOGPTBF(tbf, LOGL_DEBUG,</span><br><span style="color: hsl(120, 100%, 40%);">+                              "Cannot assign DL TBF now, because contention resolution is not finished.\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                      return false;</span><br><span style="color: hsl(120, 100%, 40%);">+         }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+     return true;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25752">change 25752</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/+/25752"/><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: Idbe4f9bbd23005a43c586b737cf9adc2114287e2 </div>
<div style="display:none"> Gerrit-Change-Number: 25752 </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-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>