Change in osmo-pcu[master]: Make WaitIndication T3172 configurable

pespin gerrit-no-reply at lists.osmocom.org
Tue Apr 27 10:05:18 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/23908 )

Change subject: Make WaitIndication T3172 configurable
......................................................................

Make WaitIndication T3172 configurable

Tbftest expectatins need to change because 5000/20 = 250 < 255, hence
the message is now sent as units of 20ms instead of seconds.

Related: OS#3928
Change-Id: I48b34b94b1a5dfb046a3a6cf8a0d944a7c9b6754
---
M src/bts.cpp
M src/encoding.cpp
M src/encoding.h
M src/tbf.cpp
M tests/tbf/TbfTest.cpp
M tests/tbf/TbfTest.err
6 files changed, 18 insertions(+), 11 deletions(-)

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



diff --git a/src/bts.cpp b/src/bts.cpp
index 9065c4e..449e1ac 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -76,8 +76,9 @@
 }
 
 static struct osmo_tdef T_defs_bts[] = {
-	{ .T=3142, .default_val=20,  .unit=OSMO_TDEF_S,  .desc="Wait Indication used in Imm Ass Reject during TBF Establishment (s)", .val=0, .min_val = 0, .max_val = 255 }, /* TS 44.018 10.5.2.43 */
+	{ .T=3142, .default_val=20,  .unit=OSMO_TDEF_S,  .desc="Wait Indication used in Imm Ass Reject during TBF Establishment (CCCH) (s)", .val=0, .min_val = 0, .max_val = 255 }, /* TS 44.018 10.5.2.43, TS 44.060 7.1.3.2.1 (T3172) */
 	{ .T=3169, .default_val=5,   .unit=OSMO_TDEF_S,  .desc="Reuse of USF and TFI(s) after the MS uplink TBF assignment is invalid (s)", .val=0 },
+	{ .T=3172, .default_val=5000,.unit=OSMO_TDEF_MS, .desc="Wait Indication used in Imm Ass Reject during TBF Establishment (PACCH) (s)", .val=0, .min_val = 0, .max_val = 255000 }, /* TS 44.060 7.1.3.2.1 */
 	{ .T=3191, .default_val=5,   .unit=OSMO_TDEF_S,  .desc="Reuse of TFI(s) after sending (1) last RLC Data Block on TBF(s), or (2) PACKET TBF RELEASE for an MBMS radio bearer (s)", .val=0 },
 	{ .T=3193, .default_val=100, .unit=OSMO_TDEF_MS, .desc="Reuse of TFI(s) after reception of final PACKET DOWNLINK ACK/NACK from MS for TBF (ms)", .val=0 },
 	{ .T=3195, .default_val=5,   .unit=OSMO_TDEF_S,  .desc="Reuse of TFI(s) upon no response from the MS (radio failure or cell change) for TBF/MBMS radio bearer (s)", .val=0 },
diff --git a/src/encoding.cpp b/src/encoding.cpp
index f91c638..2f58759 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -1711,7 +1711,7 @@
  * 8.1.2.5 Establishment of uplink TBF
  */
 void Encoding::write_packet_access_reject(
-	bitvec * dest, uint32_t tlli)
+	bitvec * dest, uint32_t tlli, unsigned long t3172_ms)
 {
 	unsigned wp = 0;
 
@@ -1725,9 +1725,15 @@
 	bitvec_write_field(dest, &wp, 0x0, 1);  //  TLLI / G-RNTI : bit (32)
 	bitvec_write_field(dest, &wp, tlli, 32); // CONTENTION_RESOLUTION_TLLI
 	bitvec_write_field(dest, &wp, 1, 1);  //  WAIT_INDICATION size in seconds
-	/* TODO: make it configurable */
-	bitvec_write_field(dest, &wp, 5, 8);  //  WAIT_INDICATION value
-	bitvec_write_field(dest, &wp, 0, 1);  //  WAIT_INDICATION size in seconds
+
+	/* WAIT_INDICATION, WAIT_INDICATION_SIZE */
+	if (t3172_ms / 20 <= 255) { /* In units of 20 milliseconds */
+		bitvec_write_field(dest, &wp, t3172_ms/20, 8);
+		bitvec_write_field(dest, &wp, 1, 1);
+	} else { /* value too big to fit in ms, do it in seconds */
+		bitvec_write_field(dest, &wp, t3172_ms/1000, 8);
+		bitvec_write_field(dest, &wp, 0, 1);
+	}
 }
 
 void write_packet_neighbour_cell_data(RlcMacDownlink_t *block,
diff --git a/src/encoding.h b/src/encoding.h
index e7046e2..665bd77 100644
--- a/src/encoding.h
+++ b/src/encoding.h
@@ -78,8 +78,8 @@
 
 	static void encode_rbb(const char *show_rbb, uint8_t *rbb);
 
-	static void write_packet_access_reject(
-		bitvec * dest, uint32_t tlli);
+	static void write_packet_access_reject(bitvec * dest, uint32_t tlli,
+					       unsigned long t3172_ms);
 
 	static void write_packet_uplink_ack(
 			bitvec * dest, struct gprs_rlcmac_ul_tbf *tbf, bool is_final,
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 69c35f8..b51e7de 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -955,8 +955,8 @@
 
 	bitvec_unhex(packet_access_rej, DUMMY_VEC);
 
-	Encoding::write_packet_access_reject(
-		packet_access_rej, tlli());
+	Encoding::write_packet_access_reject(packet_access_rej, tlli(),
+					     osmo_tdef_get(bts->T_defs_bts, 3172, OSMO_TDEF_MS, -1));
 
 	bts_do_rate_ctr_inc(bts, CTR_PKT_ACCESS_REJ);
 
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index cf8e083..e0fd9cc 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -3264,7 +3264,7 @@
 	the_pcu = gprs_pcu_alloc(tall_pcu_ctx);
 	struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu, 0);
 	uint32_t tlli = 0xffeeddcc;
-	static uint8_t exp[] = { 0x40, 0x84, 0x7f, 0xf7, 0x6e, 0xe6, 0x41, 0x4b,
+	static uint8_t exp[] = { 0x40, 0x84, 0x7f, 0xf7, 0x6e, 0xe6, 0x7e, 0xab,
 				 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
 				 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b
 	};
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index e700fe2..be7caf0 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -7615,7 +7615,7 @@
 TBF(TFI=0 TLLI=0xffffffff DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes
-packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 
+packet reject: 40 84 7f f7 6e e6 7e ab 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 
 === end test_packet_access_rej_epdan ===
 === start test_packet_access_rej_prr ===
 MS requests Uplink resource on CCCH/RACH: ra=0x70 (8 bit) Fn=2654167 qta=31

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I48b34b94b1a5dfb046a3a6cf8a0d944a7c9b6754
Gerrit-Change-Number: 23908
Gerrit-PatchSet: 1
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: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210427/da4b6f60/attachment.htm>


More information about the gerrit-log mailing list