aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-03-29 19:10:19 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-03-31 17:39:50 +0200
commit16e1678bfc1ecc83908b73b8d3fafa3ec34d71d5 (patch)
tree64b2b88d903a9f04ebfd9511f13e34deba01fd01
parent58046e45d13c2881e5f150973655240a23f6db04 (diff)
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
-rw-r--r--src/pdch_ul_controller.c2
-rw-r--r--src/tbf.cpp22
-rw-r--r--src/tbf.h7
-rw-r--r--src/tbf_dl.cpp2
-rw-r--r--tests/tbf/TbfTest.cpp18
5 files changed, 22 insertions, 29 deletions
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 @@ void pdch_ulc_expire_fn(struct pdch_ulc *ulc, uint32_t fn)
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 @@ gprs_rlcmac_tbf::gprs_rlcmac_tbf(struct gprs_rlcmac_bts *bts_, GprsMs *ms, gprs_
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 @@ void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum pdch_ul
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 @@ void gprs_rlcmac_tbf::poll_timeout(uint32_t poll_fn, enum pdch_ulc_tbf_poll_reas
/* 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 @@ void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, uint32_t new_poll_fn, uint8_t
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 @@ uint8_t tbf_tfi(const struct gprs_rlcmac_tbf *tbf);
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 @@ struct gprs_rlcmac_tbf {
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_tbf {
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 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
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 @@ static void send_control_ack(gprs_rlcmac_tbf *tbf)
{
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 @@ static void test_tbf_ra_update_rach()
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 @@ static void test_tbf_dl_reuse()
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 @@ static void establish_and_use_egprs_dl_tbf(struct gprs_rlcmac_bts *bts, int mcs)
/* 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 @@ static void establish_and_use_egprs_dl_tbf(struct gprs_rlcmac_bts *bts, int mcs)
/* 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 @@ static void establish_and_use_egprs_dl_tbf_for_retx(struct gprs_rlcmac_bts *bts,
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);
}