Change in osmo-pcu[master]: tbf: Drop impossible paths in create_dl_ass()

pespin gerrit-no-reply at lists.osmocom.org
Thu Jul 22 18:26:16 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/25010 )


Change subject: tbf: Drop impossible paths in create_dl_ass()
......................................................................

tbf: Drop impossible paths in create_dl_ass()

create_dl_ass() is only called in gprs_rlcmac_sched.cpp on
tbf_cand->dl_ass pointer, which is always assigned under the guard
"!tbf->is_control_ts(pdch->ts_no)", since we only send CTRL messages for
a TBF on its control TS.
Hence, condition "!is_control_ts(ts)" in create_dl_ass will always be
false, and as a result poll_ass_dl will always be 1.
So we can drop different code paths.

Change-Id: Ibea4100a5dc8bd49303cb6a3d02417038c3d3887
---
M src/tbf.cpp
1 file changed, 13 insertions(+), 27 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/10/25010/1

diff --git a/src/tbf.cpp b/src/tbf.cpp
index e83f472..fcad879 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -852,29 +852,24 @@
 	struct msgb *msg;
 	struct gprs_rlcmac_dl_tbf *new_dl_tbf = NULL;
 	RlcMacDownlink_t *mac_control_block = NULL;
-	int poll_ass_dl = 1;
+	const int poll_ass_dl = 1;
 	unsigned int rrbp = 0;
 	uint32_t new_poll_fn = 0;
 	int rc;
 	bool old_tfi_is_valid = is_tfi_assigned();
 
-	if (direction == GPRS_RLCMAC_DL_TBF && !is_control_ts(ts)) {
-		LOGPTBF(this, LOGL_NOTICE,
-			"Cannot poll for downlink assignment, because MS cannot reply. (TS=%d, first common TS=%d)\n",
-			ts, first_common_ts);
-		poll_ass_dl = 0;
+	/* We only use this function in control TS (PACCH) so that MS can always answer the poll */
+	OSMO_ASSERT(is_control_ts(ts));
+
+	if (ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK)
+	{
+		LOGPTBF(this, LOGL_DEBUG,
+			  "Polling is already scheduled, so we must wait for the uplink assignment...\n");
+		return NULL;
 	}
-	if (poll_ass_dl) {
-		if (ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK)
-		{
-			LOGPTBF(this, LOGL_DEBUG,
-				  "Polling is already scheduled, so we must wait for the uplink assignment...\n");
-			return NULL;
-		}
-		rc = check_polling(fn, ts, &new_poll_fn, &rrbp);
-		if (rc < 0)
-			return NULL;
-	}
+	rc = check_polling(fn, ts, &new_poll_fn, &rrbp);
+	if (rc < 0)
+		return NULL;
 
 	/* on uplink TBF we get the downlink TBF to be assigned. */
 	if (direction == GPRS_RLCMAC_UL_TBF) {
@@ -938,16 +933,7 @@
 	LOGP(DTBF, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n");
 	bts_do_rate_ctr_inc(bts, CTR_PKT_DL_ASSIGNMENT);
 
-	if (poll_ass_dl) {
-		set_polling(new_poll_fn, ts, PDCH_ULC_POLL_DL_ASS);
-	} else {
-		dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE;
-		TBF_SET_STATE(new_dl_tbf, TBF_ST_FLOW);
-		tbf_assign_control_ts(new_dl_tbf);
-		/* stop pending assignment timer */
-		new_dl_tbf->t_stop(T0, "assignment (DL-TBF)");
-
-	}
+	set_polling(new_poll_fn, ts, PDCH_ULC_POLL_DL_ASS);
 
 	talloc_free(mac_control_block);
 	return msg;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/25010
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ibea4100a5dc8bd49303cb6a3d02417038c3d3887
Gerrit-Change-Number: 25010
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210722/67ccdb24/attachment.htm>


More information about the gerrit-log mailing list