Change in osmo-pcu[master]: alloc_algorithm_b: Rearrange variable initialization

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Mon May 10 17:53:38 UTC 2021


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


Change subject: alloc_algorithm_b: Rearrange variable initialization
......................................................................

alloc_algorithm_b: Rearrange variable initialization

Untangle variable assignment at the start of the function. Changes end
up in same kind of assignment, but are far easier to understand based on
the variable use later on.
* reserved_{dl,ul}_slots contain mask of TS either "previously-reserved" or
  "intended to be reserved now" based on MS's ms_class.
* {dl,ul}_slots contain a derived mask from the one above, filtered
  further based on more factors like type of allocation requested (multi
  vs single), available USFs (UL), etc.

Change-Id: If3cfa82f8b793a87e97145ee8a6fc0fe1a61add6
---
M src/gprs_rlcmac_ts_alloc.cpp
1 file changed, 6 insertions(+), 9 deletions(-)



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

diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index e8c9bc4..5ccbb9f 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -883,10 +883,8 @@
 
 	/* Step 1: Get current state from the MS object */
 
-	OSMO_ASSERT(ms);
-
-	dl_slots = ms_reserved_dl_slots(ms);
-	ul_slots = ms_reserved_ul_slots(ms);
+	reserved_dl_slots = ms_reserved_dl_slots(ms);
+	reserved_ul_slots = ms_reserved_ul_slots(ms);
 	first_common_ts = ms_first_common_ts(ms);
 	trx = ms_current_trx(ms);
 
@@ -901,14 +899,13 @@
 	if (!trx)
 		trx = &bts->trx[trx_no];
 
-	if (!dl_slots || !ul_slots) {
-		rc = find_multi_slots(trx, ms_ms_class(ms), &ul_slots, &dl_slots);
+	if (!reserved_dl_slots || !reserved_ul_slots) {
+		rc = find_multi_slots(trx, ms_ms_class(ms), &reserved_ul_slots, &reserved_dl_slots);
 		if (rc < 0)
 			return rc;
 	}
-
-	reserved_dl_slots = dl_slots;
-	reserved_ul_slots = ul_slots;
+	dl_slots = reserved_dl_slots;
+	ul_slots = reserved_ul_slots;
 
 	/* Step 3a: Derive the slot set for the current TBF */
 	rc = tbf_select_slot_set(tbf, trx, single, ul_slots, dl_slots, reserved_ul_slots, reserved_dl_slots,

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: If3cfa82f8b793a87e97145ee8a6fc0fe1a61add6
Gerrit-Change-Number: 24187
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/20210510/6d7fa72a/attachment.htm>


More information about the gerrit-log mailing list