Change in osmo-pcu[master]: tbf: Get rid of attribute poll_ts

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


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


Change subject: tbf: Get rid of attribute poll_ts
......................................................................

tbf: Get rid of attribute poll_ts

That field is not needed anymore, and it works only under the assumption
that only 1 poll request can be active at a time per TBF, which is not
true.

Change-Id: I9b8bed7741d385bab4cd8c64b841a78a02a05fe1
---
M src/pdch_ul_controller.c
M src/tbf.cpp
M src/tbf.h
M src/tbf_dl.cpp
M tests/tbf/TbfTest.cpp
5 files changed, 22 insertions(+), 29 deletions(-)



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

diff --git a/src/pdch_ul_controller.c b/src/pdch_ul_controller.c
index 5911080..f8089ff 100644
--- a/src/pdch_ul_controller.c
+++ b/src/pdch_ul_controller.c
@@ -318,7 +318,7 @@
 			LOGPDCH(ulc->pdch, DRLCMAC, LOGL_NOTICE,
 				"Timeout for registered POLL (FN=%u): %s\n",
 				item->fn, tbf_name(item->tbf_poll.poll_tbf));
-			tbf_poll_timeout(item->tbf_poll.poll_tbf, item->fn, item->tbf_poll.reason);
+			tbf_poll_timeout(item->tbf_poll.poll_tbf, ulc->pdch, item->fn, item->tbf_poll.reason);
 			break;
 		case PDCH_ULC_NODE_SBA:
 			sba = item->sba.sba;
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 92dede5..69c35f8 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -125,7 +125,6 @@
 	first_ts(0),
 	first_common_ts(0),
 	control_ts(0xff),
-	poll_ts(0),
 	fT(0),
 	num_fT_exp(0),
 	was_releasing(0),
@@ -581,45 +580,44 @@
 			  chan, new_poll_fn, ts);
 		return;
 	}
-	poll_ts = ts;
 
 	switch (reason) {
 	case PDCH_ULC_POLL_UL_ASS:
 		ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK;
 
 		LOGPTBFDL(this, LOGL_INFO, "Scheduled UL Assignment polling on %s (FN=%d, TS=%d)\n",
-			  chan, new_poll_fn, poll_ts);
+			  chan, new_poll_fn, ts);
 		break;
 	case PDCH_ULC_POLL_DL_ASS:
 		dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK;
 
 		LOGPTBFDL(this, LOGL_INFO, "Scheduled DL Assignment polling on %s (FN=%d, TS=%d)\n",
-			  chan, new_poll_fn, poll_ts);
+			  chan, new_poll_fn, ts);
 		break;
 	case PDCH_ULC_POLL_UL_ACK:
 		ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK;
 
 		LOGPTBFUL(this, LOGL_DEBUG, "Scheduled UL Acknowledgement polling on %s (FN=%d, TS=%d)\n",
-			  chan, new_poll_fn, poll_ts);
+			  chan, new_poll_fn, ts);
 		break;
 	case PDCH_ULC_POLL_DL_ACK:
 		LOGPTBFDL(this, LOGL_DEBUG, "Scheduled DL Acknowledgement polling on %s (FN=%d, TS=%d)\n",
-			  chan, new_poll_fn, poll_ts);
+			  chan, new_poll_fn, ts);
 		break;
 	case PDCH_ULC_POLL_CELL_CHG_CONTINUE:
 		LOGPTBFDL(this, LOGL_DEBUG, "Scheduled 'Packet Cell Change Continue' polling on %s (FN=%d, TS=%d)\n",
-			  chan, new_poll_fn, poll_ts);
+			  chan, new_poll_fn, ts);
 		break;
 	}
 }
 
-void gprs_rlcmac_tbf::poll_timeout(uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason)
+void gprs_rlcmac_tbf::poll_timeout(struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason)
 {
 	uint16_t pgroup;
 	gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this);
 
 	LOGPTBF(this, LOGL_NOTICE, "poll timeout for FN=%d, TS=%d (curr FN %d)\n",
-		poll_fn, poll_ts, bts_current_frame_number(bts));
+		poll_fn, pdch->ts_no, bts_current_frame_number(bts));
 
 	if (ul_tbf && ul_tbf->handle_ctrl_ack(reason)) {
 		if (!ul_tbf->ctrl_ack_to_toggle()) {
@@ -679,7 +677,7 @@
 		/* reschedule DL assignment */
 		dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS;
 	} else if (m_ms->nacc && m_ms->nacc->fi->state == NACC_ST_WAIT_CELL_CHG_CONTINUE_ACK &&
-		   m_ms->nacc->continue_poll_fn == poll_fn && m_ms->nacc->continue_poll_ts == poll_ts) {
+		   m_ms->nacc->continue_poll_fn == poll_fn && m_ms->nacc->continue_poll_ts == pdch->ts_no) {
 		/* Timeout waiting for CTRL ACK acking Pkt Cell Change Continue */
 		osmo_fsm_inst_dispatch(m_ms->nacc->fi, NACC_EV_TIMEOUT_CELL_CHG_CONTINUE, NULL);
 		return;
@@ -1209,7 +1207,7 @@
 	return tbf->set_polling(new_poll_fn, ts, t);
 }
 
-void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason)
+void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason)
 {
-	tbf->poll_timeout(poll_fn, reason);
+	tbf->poll_timeout(pdch, poll_fn, reason);
 }
diff --git a/src/tbf.h b/src/tbf.h
index b0bec31..ca6de0f 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -193,7 +193,7 @@
 int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf);
 int tbf_check_polling(const struct gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp);
 void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason t);
-void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason);
+void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason);
 #ifdef __cplusplus
 }
 #endif
@@ -251,7 +251,7 @@
 	int check_polling(uint32_t fn, uint8_t ts,
 		uint32_t *poll_fn, unsigned int *rrbp) const;
 	void set_polling(uint32_t poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason reason);
-	void poll_timeout(uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason);
+	void poll_timeout(struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason);
 
 	/** tlli handling */
 	uint32_t tlli() const;
@@ -291,9 +291,6 @@
 	struct gprs_rlcmac_pdch *pdch[8]; /* list of PDCHs allocated to TBF */
 
 	gprs_llc m_llc;
-
-	uint8_t poll_ts; /* TS to poll */
-
 	gprs_rlc m_rlc;
 
 	unsigned int fT; /* fTxxxx number */
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index c122bba..dd5d0f2 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -994,7 +994,7 @@
 
 			LOGPTBFDL(this, LOGL_INFO,
 				  "Scheduled Ack/Nack polling on FN=%d, TS=%d\n",
-				  new_poll_fn, poll_ts);
+				  new_poll_fn, ts);
 		}
 	}
 
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 8fbdde6..5ce2611 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -671,16 +671,14 @@
 {
 	RlcMacUplink_t ulreq = {0};
 
-	OSMO_ASSERT(tbf->is_control_ts(tbf->poll_ts));
-
 	ulreq.u.MESSAGE_TYPE = MT_PACKET_CONTROL_ACK;
 	Packet_Control_Acknowledgement_t *ctrl_ack =
 		&ulreq.u.Packet_Control_Acknowledgement;
 
 	ctrl_ack->PayloadType = GPRS_RLCMAC_CONTROL_BLOCK;
 	ctrl_ack->TLLI = tbf->tlli();
-	send_ul_mac_block(tbf->bts, tbf->trx->trx_no, tbf->poll_ts,
-		&ulreq, get_poll_fn(tbf, tbf->poll_ts));
+	send_ul_mac_block(tbf->bts, tbf->trx->trx_no, tbf->control_ts,
+		&ulreq, get_poll_fn(tbf, tbf->control_ts));
 }
 
 static void send_empty_block(gprs_rlcmac_tbf *tbf, unsigned ts_no, unsigned fn)
@@ -1939,8 +1937,8 @@
 
 	dl_tbf = ms_dl_tbf(ms1);
 	OSMO_ASSERT(dl_tbf);
-	fn = get_poll_fn(dl_tbf, dl_tbf->poll_ts);
-	send_empty_block(dl_tbf, dl_tbf->poll_ts, fn);
+	fn = get_poll_fn(dl_tbf, dl_tbf->control_ts);
+	send_empty_block(dl_tbf, dl_tbf->control_ts, fn);
 	fn = fn_add_blocks(fn, 1);
 
 	/* Now establish a new TBF for the RA UPDATE COMPLETE (new TLLI) */
@@ -2164,7 +2162,7 @@
 	ack->DOWNLINK_TFI = dl_tbf1->tfi();
 	ack->Ack_Nack_Description.FINAL_ACK_INDICATION = 1;
 
-	send_ul_mac_block(bts, 0, dl_tbf1->poll_ts, &ulreq, get_poll_fn(dl_tbf1, dl_tbf1->poll_ts));
+	send_ul_mac_block(bts, 0, dl_tbf1->control_ts, &ulreq, get_poll_fn(dl_tbf1, dl_tbf1->control_ts));
 
 	OSMO_ASSERT(dl_tbf1->state_is(GPRS_RLCMAC_WAIT_RELEASE));
 
@@ -2713,7 +2711,7 @@
 		/* Request to send one RLC/MAC block */
 		request_dl_rlc_block(dl_tbf, &fn);
 	}
-	send_empty_block(dl_tbf, dl_tbf->poll_ts, fn);
+	send_empty_block(dl_tbf, dl_tbf->control_ts, fn);
 
 	/* Schedule a large LLC frame */
 	dl_tbf->append_data(1000, test_data, sizeof(test_data));
@@ -2725,7 +2723,7 @@
 		/* Request to send one RLC/MAC block */
 		request_dl_rlc_block(dl_tbf, &fn);
 	}
-	send_empty_block(dl_tbf, dl_tbf->poll_ts, fn);
+	send_empty_block(dl_tbf, dl_tbf->control_ts, fn);
 
 	OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_FLOW));
 
@@ -3069,7 +3067,7 @@
 		MAKE_ACKED(msg, dl_tbf, fn, mcs, true);
 	}
 	/* Clean up pending items in UL controller: */
-	send_empty_block(dl_tbf, dl_tbf->poll_ts, fn+50);
+	send_empty_block(dl_tbf, dl_tbf->control_ts, fn+50);
 	tbf_cleanup(dl_tbf);
 }
 

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I9b8bed7741d385bab4cd8c64b841a78a02a05fe1
Gerrit-Change-Number: 23532
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/20210329/6580b666/attachment.htm>


More information about the gerrit-log mailing list