[PATCH] osmo-pcu[master]: Fix DL window calculation during tbf update

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/.

arvind.sirsikar gerrit-no-reply at lists.osmocom.org
Tue Aug 30 10:15:23 UTC 2016


Review at  https://gerrit.osmocom.org/798

Fix DL window calculation during tbf update

Earlier there was no handling for recalculation of DL window
size during tbf update. Which has been fixed in this patch.

Related: OS#1808
Change-Id: I41aa807068520460fd665a55e3529e60f6bbb630
---
M src/tbf.cpp
M tests/tbf/TbfTest.cpp
M tests/tbf/TbfTest.err
3 files changed, 22 insertions(+), 6 deletions(-)


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

diff --git a/src/tbf.cpp b/src/tbf.cpp
index 1fc1aef..871708e 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -375,6 +375,23 @@
 		return -rc;
 	}
 
+	unsigned int num_pdch = pcu_bitcount(dl_slots());
+	unsigned int ws = bts->bts_data()->ws_base +
+				num_pdch * bts->bts_data()->ws_pdch;
+	ws = (ws / 32) * 32;
+	ws = OSMO_MAX(64, ws);
+
+	if (num_pdch == 1)
+		ws = OSMO_MIN(192, ws);
+	else
+		ws = OSMO_MIN(128 * num_pdch, ws);
+	LOGP(DRLCMAC, LOGL_INFO, "%s: Setting DL window size to %d\n"
+		"num_pdch(%d) ws_base(%d) ws_pdch(%d)\n",
+		name(), ws, num_pdch, bts->bts_data()->ws_base,
+		bts->bts_data()->ws_pdch);
+
+	window()->set_ws(ws);
+
 	return 0;
 }
 
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index ca5a3c8..e74c676 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -1814,17 +1814,14 @@
 
 	dl_tbf->update();
 
-	/*
-	 * TODO: Should not expect window size as 192.
-	 * should be fixed in subsequent patch
-	 */
+	/* window size should be 384 */
 	OSMO_ASSERT(dl_tbf != NULL);
 	fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n",
 		dl_tbf->dl_slots(),
 		pcu_bitcount(dl_tbf->dl_slots()),
 		dl_tbf->window()->ws());
 	OSMO_ASSERT(pcu_bitcount(dl_tbf->dl_slots()) == 4);
-	OSMO_ASSERT(dl_tbf->window()->ws() == 128 + 1 * 64);
+	OSMO_ASSERT(dl_tbf->window()->ws() == 128 + 4 * 64);
 
 	tbf_free(dl_tbf);
 
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 67aade9..1e40906 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -6374,7 +6374,9 @@
 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
 - Assigning DL TS 5
 PDCH(TS 5, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
-DL TBF slots: 0x3c, N: 4, WS: 192
+TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting DL window size to 384
+num_pdch(4) ws_base(128) ws_pdch(64)
+DL TBF slots: 0x3c, N: 4, WS: 384
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to RELEASING
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS) free
 PDCH(TS 2, TRX 0): Detaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000.

-- 
To view, visit https://gerrit.osmocom.org/798
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41aa807068520460fd665a55e3529e60f6bbb630
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: arvind.sirsikar <arvind.sirsikar at radisys.com>



More information about the gerrit-log mailing list