Change in osmo-pcu[master]: tbf: Merge handle_ack_nack() into handle_ack_nack()

pespin gerrit-no-reply at lists.osmocom.org
Wed Jul 28 19:59:36 UTC 2021


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


Change subject: tbf: Merge handle_ack_nack() into handle_ack_nack()
......................................................................

tbf: Merge handle_ack_nack() into handle_ack_nack()

There's no real use in having those 2 methods separately, and only adds
complexity. Let's merge it to have 1 TBF code path handling DL ACK/NACK.

Change-Id: I546d2e46bda96a2f551b28673464e57831c71828
---
M src/pdch.cpp
M src/tbf_dl.cpp
M src/tbf_dl.h
M tests/tbf/TbfTest.err
4 files changed, 9 insertions(+), 24 deletions(-)



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

diff --git a/src/pdch.cpp b/src/pdch.cpp
index 618dbf4..9477178 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -450,8 +450,6 @@
 	/* Reset N3101 counter: */
 	tbf->n_reset(N3101);
 
-	if (tbf->handle_ack_nack())
-		LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n");
 	pdch_ulc_release_fn(ulc, fn);
 
 	LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n");
@@ -519,9 +517,6 @@
 
 	/* Reset N3101 counter: */
 	tbf->n_reset(N3101);
-
-	if (tbf->handle_ack_nack())
-		LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n");
 	pdch_ulc_release_fn(ulc, fn);
 
 	LOGPTBF(tbf, LOGL_DEBUG,
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 40b52e5..10492d9 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -774,22 +774,6 @@
 	return bsn;
 }
 
-bool gprs_rlcmac_dl_tbf::handle_ack_nack()
-{
-	bool ack_recovered = false;
-
-	state_fsm.state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK);
-	if (check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ACK)) {
-		ack_recovered = true;
-	}
-
-	/* reset N3105 */
-	n_reset(N3105);
-	t_stop(T3191, "ACK/NACK received");
-
-	return ack_recovered;
-}
-
 struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
 				const uint32_t fn, const uint8_t ts,
 				int index, int index2)
@@ -1200,6 +1184,13 @@
 	int rc;
 	LOGPTBFDL(this, LOGL_DEBUG, "downlink acknowledge\n");
 
+	state_fsm.state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK);
+	state_fsm.state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK);
+
+	/* reset N3105 */
+	n_reset(N3105);
+	t_stop(T3191, "ACK/NACK received");
+
 	rc = update_window(first_bsn, rbb);
 
 	if (final_ack) {
diff --git a/src/tbf_dl.h b/src/tbf_dl.h
index 67c05ad..9719327 100644
--- a/src/tbf_dl.h
+++ b/src/tbf_dl.h
@@ -52,7 +52,6 @@
 	struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts, enum mcs_kind req_mcs_kind = EGPRS);
 	void trigger_ass(struct gprs_rlcmac_tbf *old_tbf);
 
-	bool handle_ack_nack();
 	void request_dl_ack();
 	bool need_control_ts() const;
 	bool have_data() const;
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 98c9d49..b66707a 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -526,6 +526,7 @@
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=216, TS=4
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) msg block (BSN 21, CS-1): 0f 01 2a 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) downlink acknowledge
+TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) stopping timer T3191 [ACK/NACK received]
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) ack:  (BSN=21)"R"(BSN=21)  R=ACK I=NACK
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=21, info='R...............................................................'
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) V(B): (V(A)=22)""(V(S)-1=21)  A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid
@@ -535,7 +536,6 @@
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 100000 microsec, cur_fn=2654167
 TBF(DL-TFI_0){WAIT_RELEASE}: Received Event ASSIGN_DEL_CCCH
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE) free
-TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE) stopping timer T3191 [freeing TBF]
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE) stopping timer T3193 [freeing TBF]
 PDCH(bts=0,trx=0,ts=4) Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE), 0 TBFs, USFs = 00, TFIs = 00000000.
 MS(TLLI=0xffeeddcc, IMSI=, TA=0, 45/0,) Detaching TBF: TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE)
@@ -3204,10 +3204,10 @@
 Detected FN jump! 2654288 -> 2654379
 PDCH(bts=0,trx=0,ts=7) FN=2654379 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
 PDCH(bts=0,trx=0,ts=7) FN=2654379 ------------------------- RX : Uplink Control Block -------------------------
-TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) stopping timer T3191 [ACK/NACK received]
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) RX: [PCU <- BTS] Packet Downlink Ack/Nack
 PDCH(bts=0,trx=0,ts=7) Got GPRS DL ACK bitmap: SSN: 0, BSN 0 to 28 - 1 (28 blocks), "RRRRRRRRRRRRRRRRRRRRRRRRRRRR"
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) downlink acknowledge
+TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) stopping timer T3191 [ACK/NACK received]
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) ack:  (BSN=0)"RRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=27)  R=ACK I=NACK
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) DL analysis, range=0:28, lost=0, recv=28, skipped=0, bsn=0, info='RRRRRRRRRRRRRRRRRRRRRRRRRRRR....................................'
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) V(B): (V(A)=28)""(V(S)-1=27)  A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I546d2e46bda96a2f551b28673464e57831c71828
Gerrit-Change-Number: 25094
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/20210728/d9341b9a/attachment.htm>


More information about the gerrit-log mailing list