Change in osmo-pcu[master]: Split ul_tbf alloc on CCCH into new function

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:39 UTC 2021


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


Change subject: Split ul_tbf alloc on CCCH into new function
......................................................................

Split ul_tbf alloc on CCCH into new function

This allows more easily finding when this specific scenario happens, and
can easily be compared against the PACCH one.

Change-Id: I609792a40fda2a798ca71a0e9f5639d0a0f011d7
---
M src/bts.cpp
M src/tbf_ul.cpp
M src/tbf_ul.h
M tests/tbf/TbfTest.err
4 files changed, 29 insertions(+), 15 deletions(-)



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

diff --git a/src/bts.cpp b/src/bts.cpp
index 4fe529e..261da19 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -867,18 +867,13 @@
 		     "SBFn=%u TRX=%u TS=%u\n", sb_fn, trx_no, ts_no);
 	} else {
 		GprsMs *ms = bts_alloc_ms(bts, 0, chan_req.egprs_mslot_class);
-		tbf = tbf_alloc_ul_tbf(bts, ms, -1, true);
+		tbf = tbf_alloc_ul_ccch(bts, ms);
 		if (!tbf) {
-			LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource for Uplink TBF\n");
 			/* Send RR Immediate Assignment Reject */
 			rc = -EBUSY;
 			goto send_imm_ass_rej;
 		}
-
-		/* FIXME: Copy and paste with other routines.. */
 		tbf->set_ta(ta);
-		TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW);
-		TBF_ASS_TYPE_SET(tbf, GPRS_RLCMAC_FLAG_CCCH);
 		trx_no = tbf->trx->trx_no;
 		ts_no = tbf->first_ts;
 		usf = tbf->m_usf[ts_no];
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index cf8c75c..686eea5 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -160,6 +160,24 @@
 	return tbf;
 }
 
+/* Alloc a UL TBF to be assigned over CCCH */
+struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_ccch(struct gprs_rlcmac_bts *bts, struct GprsMs *ms)
+{
+	struct gprs_rlcmac_ul_tbf *tbf;
+
+	tbf = tbf_alloc_ul_tbf(bts, ms, -1, true);
+	if (!tbf) {
+		LOGP(DTBF, LOGL_NOTICE, "No PDCH resource for Uplink TBF\n");
+		/* Caller will most probably send a Imm Ass Reject after return */
+		return NULL;
+	}
+	TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW);
+	TBF_ASS_TYPE_SET(tbf, GPRS_RLCMAC_FLAG_CCCH);
+	OSMO_ASSERT(tbf->ms());
+
+	return tbf;
+}
+
 /* Create a temporary dummy TBF to Tx a ImmAssReject if allocating a new one during
  * packet resource Request failed. This is similar as tbf_alloc_ul() but without
  * calling tbf->setup() (in charge of TFI/USF allocation), and reusing resources
diff --git a/src/tbf_ul.h b/src/tbf_ul.h
index 4207deb..0b9be28 100644
--- a/src/tbf_ul.h
+++ b/src/tbf_ul.h
@@ -120,6 +120,7 @@
 struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, bool single_slot);
 struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_pacch(struct gprs_rlcmac_bts *bts, GprsMs *ms,
 					      int8_t use_trx, uint32_t tlli);
+struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_ccch(struct gprs_rlcmac_bts *bts, struct GprsMs *ms);
 struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts,
 	GprsMs *ms, uint8_t trx_no, uint8_t ts_no);
 
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 0a826a7..f1cab16 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -1454,9 +1454,9 @@
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL) Setting Control TS 7
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00
 MS(TLLI=0xffffffff, IMSI=, TA=220, 0/0,) Attaching UL TBF: TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL)
-Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL) changes state from NULL to FLOW
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0]
+Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 Tx Immediate Assignment on AGCH: TRX=0 (ARFCN 0) TS=7 TA=7 TSC=0 TFI=0 USF=0
 PDCH(bts=0,trx=0,ts=7) Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184
 PDCH(bts=0,trx=0,ts=7) FN=2654167 Rx UL DATA from unexpected TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=FLOW)
@@ -2060,9 +2060,9 @@
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL) Setting Control TS 7
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00
 MS(TLLI=0xffffffff, IMSI=, TA=220, 0/0,) Attaching UL TBF: TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL)
-Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL) changes state from NULL to FLOW
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0]
+Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 Tx Immediate Assignment on AGCH: TRX=0 (ARFCN 0) TS=7 TA=7 TSC=0 TFI=0 USF=0
 PDCH(bts=0,trx=0,ts=7) Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184
 PDCH(bts=0,trx=0,ts=7) FN=2654275 Rx UL DATA from unexpected TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=FLOW)
@@ -6210,9 +6210,9 @@
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL) Setting Control TS 7
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00
 MS(TLLI=0xffffffff, IMSI=, TA=220, 0/0,) Attaching UL TBF: TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL)
-Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=NULL) changes state from NULL to FLOW
 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0]
+Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 Tx Immediate Assignment on AGCH: TRX=0 (ARFCN 0) TS=7 TA=7 TSC=0 TFI=0 USF=0
 MS requests Uplink resource on CCCH/RACH: ra=0x79 (8 bit) Fn=2654167 qta=31
 Creating MS object, TLLI = 0xffffffff
@@ -6231,9 +6231,9 @@
 TBF(TFI=1 TLLI=0xffffffff DIR=UL STATE=NULL) Setting Control TS 7
 TBF(TFI=1 TLLI=0xffffffff DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00
 MS(TLLI=0xffffffff, IMSI=, TA=220, 0/0,) Attaching UL TBF: TBF(TFI=1 TLLI=0xffffffff DIR=UL STATE=NULL)
-Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 TBF(TFI=1 TLLI=0xffffffff DIR=UL STATE=NULL) changes state from NULL to FLOW
 TBF(TFI=1 TLLI=0xffffffff DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0]
+Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 Tx Immediate Assignment on AGCH: TRX=0 (ARFCN 0) TS=7 TA=7 TSC=0 TFI=1 USF=1
 MS requests Uplink resource on CCCH/RACH: ra=0x7a (8 bit) Fn=2654167 qta=31
 Creating MS object, TLLI = 0xffffffff
@@ -6252,9 +6252,9 @@
 TBF(TFI=2 TLLI=0xffffffff DIR=UL STATE=NULL) Setting Control TS 7
 TBF(TFI=2 TLLI=0xffffffff DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00
 MS(TLLI=0xffffffff, IMSI=, TA=220, 0/0,) Attaching UL TBF: TBF(TFI=2 TLLI=0xffffffff DIR=UL STATE=NULL)
-Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 TBF(TFI=2 TLLI=0xffffffff DIR=UL STATE=NULL) changes state from NULL to FLOW
 TBF(TFI=2 TLLI=0xffffffff DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0]
+Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 Tx Immediate Assignment on AGCH: TRX=0 (ARFCN 0) TS=7 TA=7 TSC=0 TFI=2 USF=2
 MS requests Uplink resource on CCCH/RACH: ra=0x7b (8 bit) Fn=2654167 qta=31
 Creating MS object, TLLI = 0xffffffff
@@ -6273,9 +6273,9 @@
 TBF(TFI=3 TLLI=0xffffffff DIR=UL STATE=NULL) Setting Control TS 7
 TBF(TFI=3 TLLI=0xffffffff DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00
 MS(TLLI=0xffffffff, IMSI=, TA=220, 0/0,) Attaching UL TBF: TBF(TFI=3 TLLI=0xffffffff DIR=UL STATE=NULL)
-Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 TBF(TFI=3 TLLI=0xffffffff DIR=UL STATE=NULL) changes state from NULL to FLOW
 TBF(TFI=3 TLLI=0xffffffff DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0]
+Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 Tx Immediate Assignment on AGCH: TRX=0 (ARFCN 0) TS=7 TA=7 TSC=0 TFI=3 USF=3
 MS requests Uplink resource on CCCH/RACH: ra=0x7c (8 bit) Fn=2654167 qta=31
 Creating MS object, TLLI = 0xffffffff
@@ -6294,9 +6294,9 @@
 TBF(TFI=4 TLLI=0xffffffff DIR=UL STATE=NULL) Setting Control TS 7
 TBF(TFI=4 TLLI=0xffffffff DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00
 MS(TLLI=0xffffffff, IMSI=, TA=220, 0/0,) Attaching UL TBF: TBF(TFI=4 TLLI=0xffffffff DIR=UL STATE=NULL)
-Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 TBF(TFI=4 TLLI=0xffffffff DIR=UL STATE=NULL) changes state from NULL to FLOW
 TBF(TFI=4 TLLI=0xffffffff DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0]
+Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 Tx Immediate Assignment on AGCH: TRX=0 (ARFCN 0) TS=7 TA=7 TSC=0 TFI=4 USF=4
 MS requests Uplink resource on CCCH/RACH: ra=0x7d (8 bit) Fn=2654167 qta=31
 Creating MS object, TLLI = 0xffffffff
@@ -6315,9 +6315,9 @@
 TBF(TFI=5 TLLI=0xffffffff DIR=UL STATE=NULL) Setting Control TS 7
 TBF(TFI=5 TLLI=0xffffffff DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00
 MS(TLLI=0xffffffff, IMSI=, TA=220, 0/0,) Attaching UL TBF: TBF(TFI=5 TLLI=0xffffffff DIR=UL STATE=NULL)
-Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 TBF(TFI=5 TLLI=0xffffffff DIR=UL STATE=NULL) changes state from NULL to FLOW
 TBF(TFI=5 TLLI=0xffffffff DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0]
+Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 Tx Immediate Assignment on AGCH: TRX=0 (ARFCN 0) TS=7 TA=7 TSC=0 TFI=5 USF=5
 MS requests Uplink resource on CCCH/RACH: ra=0x7e (8 bit) Fn=2654167 qta=31
 Creating MS object, TLLI = 0xffffffff
@@ -6336,9 +6336,9 @@
 TBF(TFI=6 TLLI=0xffffffff DIR=UL STATE=NULL) Setting Control TS 7
 TBF(TFI=6 TLLI=0xffffffff DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00
 MS(TLLI=0xffffffff, IMSI=, TA=220, 0/0,) Attaching UL TBF: TBF(TFI=6 TLLI=0xffffffff DIR=UL STATE=NULL)
-Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 TBF(TFI=6 TLLI=0xffffffff DIR=UL STATE=NULL) changes state from NULL to FLOW
 TBF(TFI=6 TLLI=0xffffffff DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0]
+Modifying MS object, TLLI = 0xffffffff, TA 220 -> 7
 Tx Immediate Assignment on AGCH: TRX=0 (ARFCN 0) TS=7 TA=7 TSC=0 TFI=6 USF=6
 MS requests Uplink resource on CCCH/RACH: ra=0x7f (8 bit) Fn=2654167 qta=31
 Creating MS object, TLLI = 0xffffffff

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I609792a40fda2a798ca71a0e9f5639d0a0f011d7
Gerrit-Change-Number: 24189
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/1e9405bc/attachment.htm>


More information about the gerrit-log mailing list