Change in osmo-ttcn3-hacks[master]: pcu: Avoid early TBF release due to N3101 in TC_multiplex_dl_gprs_egprs

pespin gerrit-no-reply at lists.osmocom.org
Mon Mar 29 14:02:05 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23485 )

Change subject: pcu: Avoid early TBF release due to N3101 in TC_multiplex_dl_gprs_egprs
......................................................................

pcu: Avoid early TBF release due to N3101 in TC_multiplex_dl_gprs_egprs

Also change a bit expectations, since it can actually happen that DL
blocks for GPRS-only MS never signal USF for itself, which is
still fine.

Change-Id: Iedff87cedf55ab18b32bd0f159d1145901878203
---
M pcu/PCU_Tests.ttcn
1 file changed, 35 insertions(+), 8 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index bea9ddd..5f60cef 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -3717,7 +3717,7 @@
 	var octetstring data := f_rnd_octstring(10);
 	var RlcmacDlBlock dl_block;
 	var integer tx_data_remain := 5;
-	var integer tgt_ms;
+	var integer tgt_ms, usf_ms;
 	var integer ms_gprs_usf_count[num_ms] := { 0, 0 };
 	var integer ms_egprs_usf_count[num_ms] := { 0, 0 };
 
@@ -3799,6 +3799,8 @@
 			break;
 		}
 
+		usf_ms := -1;
+
 		if (ischosen(dl_block.ctrl)) {
 			setverdict(fail, "Unexpected DL CTRL block ", dl_block);
 			f_shutdown(__BFILE__, __LINE__);
@@ -3813,14 +3815,16 @@
 					setverdict(fail, "Signalling USF ", dl_block.data_egprs.mac_hdr.usf, " for GPRS-only MS using MCS > 4: ", dl_block);
 					f_shutdown(__BFILE__, __LINE__);
 				}
-				ms_egprs_usf_count[0] := ms_egprs_usf_count[0] + 1;
+				usf_ms := 0;
+				ms_egprs_usf_count[usf_ms] := ms_egprs_usf_count[usf_ms] + 1;
 			} else {
 				if (dl_block.data_egprs.mcs <= MCS_4) {
 					setverdict(fail, "Using too-low MCS for EGPRS MS: ", dl_block.data_egprs.mcs);
 					f_shutdown(__BFILE__, __LINE__);
 				}
 				if (match(dl_block.data_egprs.mac_hdr.usf, g_ms[1].ul_tbf.usf[7])) {
-					ms_egprs_usf_count[1] := ms_egprs_usf_count[1] + 1;
+					usf_ms := 1;
+					ms_egprs_usf_count[usf_ms] := ms_egprs_usf_count[usf_ms] + 1;
 				}
 			}
 		} else {
@@ -3830,9 +3834,11 @@
 			}
 			tgt_ms := 0;
 			if (match(dl_block.data.mac_hdr.mac_hdr.usf, g_ms[0].ul_tbf.usf[7])) {
-				ms_gprs_usf_count[0] := ms_gprs_usf_count[0] + 1;
+				usf_ms := 0;
+				ms_gprs_usf_count[usf_ms] := ms_gprs_usf_count[usf_ms] + 1;
 			} else if (match(dl_block.data.mac_hdr.mac_hdr.usf, g_ms[1].ul_tbf.usf[7])) {
-				ms_gprs_usf_count[1] := ms_gprs_usf_count[1] + 1;
+				usf_ms := 1;
+				ms_gprs_usf_count[usf_ms] := ms_gprs_usf_count[usf_ms] + 1;
 			}
 		}
 
@@ -3849,15 +3855,36 @@
 				BSSGP[0].send(ts_BSSGP_DL_UD(g_ms[1].tlli, data));
 				tx_data_remain := tx_data_remain - 1;
 			}
+		} else if (tx_data_remain != 0) {
+			/* keep sending UL blocks when requested by USF to avoid
+			 * UL TBF timeout and hence stop receival of USFs */
+			if (usf_ms != -1) {
+				f_ms_tx_ul_data_block(g_ms[usf_ms], f_rnd_octstring(10), cv := 15);
+			}
 		}
 	}
 
 	log("results: ms_gprs_usf_count=", ms_gprs_usf_count, " / ms_egprs_usf_count=", ms_egprs_usf_count);
-	if (ms_gprs_usf_count[0] == 0 or ms_gprs_usf_count[1] == 0 or
-	    ms_egprs_usf_count[0] == 0 or ms_egprs_usf_count[1] == 0) {
-		    setverdict(fail, "USF thresholds not met!");
+	/* He we check that DL blocks scheduled at GPRS can still request UL
+	 * blocks for EGPRS MS, and the other way around. Furthermore, the 2nd
+	 * condition also ensures the downgrade to <=MCS4 condition is tested
+	 * above */
+	if (ms_gprs_usf_count[1] == 0 or ms_egprs_usf_count[0] == 0) {
+		    setverdict(fail, "USF exchange thresholds not met!");
 		    f_shutdown(__BFILE__, __LINE__);
 	}
+	/* Here check for some level of fairness between them (at least ~40%): */
+	var integer gprs_usf_cnt := ms_gprs_usf_count[0] + ms_egprs_usf_count[0];
+	var integer egprs_usf_cnt := ms_gprs_usf_count[1] + ms_egprs_usf_count[1];
+	var integer total_usf_cnt := gprs_usf_cnt + egprs_usf_cnt;
+	if (gprs_usf_cnt < total_usf_cnt * 4 / 10) {
+		setverdict(fail, "USF GPRS-only MS ", gprs_usf_cnt, " < ", total_usf_cnt * 4 / 10);
+		f_shutdown(__BFILE__, __LINE__);
+	}
+	if (egprs_usf_cnt < total_usf_cnt * 4 / 10) {
+		setverdict(fail, "USF EGPRS MS ", egprs_usf_cnt, " < ", total_usf_cnt * 4 / 10);
+		f_shutdown(__BFILE__, __LINE__);
+	}
 
 	f_shutdown(__BFILE__, __LINE__, final := true);
 }

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iedff87cedf55ab18b32bd0f159d1145901878203
Gerrit-Change-Number: 23485
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210329/5dde702b/attachment.htm>


More information about the gerrit-log mailing list