Track scheduled UL blocks through USF

This way PCU can now detect whether scheduled UL blocks through USF
were never received. This allows in a follow-up patch to start
increasing N3101 properly.

Related: OS#5033
Change-Id: Ia99c9edad6e5bd837e9baeb4fb2683b227887957
This commit is contained in:
Pau Espin 2021-03-24 14:06:15 +01:00
parent ade9c2f553
commit c1f38c7f0b
4 changed files with 313 additions and 4 deletions

View File

@ -479,8 +479,8 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts,
if (poll_tbf->direction == GPRS_RLCMAC_UL_TBF && as_ul_tbf(poll_tbf)->m_usf[ts] != USF_INVALID)
usf_tbf = as_ul_tbf(poll_tbf);
/* else, search for uplink tbf */
} else {
usf_tbf = sched_select_uplink(trx, ts, fn, block_nr, pdch, require_gprs_only);
} else if ((usf_tbf = sched_select_uplink(trx, ts, fn, block_nr, pdch, require_gprs_only))) {
pdch_ulc_reserve_tbf_usf(pdch->ulc, poll_fn, usf_tbf);
}
/* If MS selected for USF is GPRS-only, then it will only be
* able to read USF if dl block uses GMSK * (CS1-4, MCS1-4) */

View File

@ -713,6 +713,7 @@ void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *repor
if ((poll = pdch_ulc_get_node(ulc, fn))) {
switch (poll->type) {
case PDCH_ULC_NODE_TBF_USF:
pdch_ulc_release_fn(ulc, fn);
break;
case PDCH_ULC_NODE_TBF_POLL:
LOGPDCH(this, DRLCMAC, LOGL_INFO, "FN=%" PRIu32 " Rx Meas Report "
@ -868,6 +869,7 @@ int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t f
int rc;
struct gprs_rlc_data_info rlc_dec;
struct gprs_rlcmac_ul_tbf *tbf;
struct pdch_ulc_node *node;
unsigned len = mcs_size_ul(cs);
/* These are always data blocks, since EGPRS still uses CS-1 for
@ -910,6 +912,32 @@ int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t f
return 0;
}
node = pdch_ulc_get_node(ulc, fn);
if (node) {
switch (node->type) {
case PDCH_ULC_NODE_TBF_USF:
if (tbf != node->tbf_usf.ul_tbf)
LOGPDCH(this, DRLCMACUL, LOGL_NOTICE, "FN=%" PRIu32 " "
"Rx UL DATA from unexpected %s vs expected %s\n",
fn, tbf_name(tbf), tbf_name(node->tbf_usf.ul_tbf));
break;
case PDCH_ULC_NODE_TBF_POLL:
LOGPDCH(this, DRLCMACUL, LOGL_NOTICE, "FN=%" PRIu32 " "
"Rx UL DATA from unexpected %s vs expected POLL %s\n",
fn, tbf_name(tbf), tbf_name(node->tbf_poll.poll_tbf));
break;
case PDCH_ULC_NODE_SBA:
LOGPDCH(this, DRLCMACUL, LOGL_NOTICE, "FN=%" PRIu32 " "
"Rx UL DATA from unexpected %s vs expected SBA\n",
fn, tbf_name(tbf));
break;
}
pdch_ulc_release_node(ulc, node);
} else {
LOGPDCH(this, DRLCMACUL, LOGL_NOTICE, "FN=%" PRIu32 " "
"Rx UL DATA from unexpected %s\n", fn, tbf_name(tbf));
}
/* Reset N3101 counter: */
tbf->n_reset(N3101);

View File

@ -164,7 +164,10 @@ static int pdch_ulc_add_node(struct pdch_ulc *ulc, struct pdch_ulc_node *item)
int pdch_ulc_reserve_tbf_usf(struct pdch_ulc *ulc, uint32_t fn, struct gprs_rlcmac_ul_tbf *ul_tbf)
{
return 0; /* TODO: implement */
struct pdch_ulc_node *item = _alloc_node(ulc, fn);
item->type = PDCH_ULC_NODE_TBF_USF;
item->tbf_usf.ul_tbf = ul_tbf;
return pdch_ulc_add_node(ulc, item);
}
int pdch_ulc_reserve_tbf_poll(struct pdch_ulc *ulc, uint32_t fn, struct gprs_rlcmac_tbf *tbf)
@ -255,7 +258,10 @@ void pdch_ulc_expire_fn(struct pdch_ulc *ulc, uint32_t fn)
switch (item->type) {
case PDCH_ULC_NODE_TBF_USF:
/* TODO: increase N3...*/
LOGPDCH(ulc->pdch, DRLCMAC, LOGL_INFO,
"Timeout for registered USF (FN=%u): %s\n",
item->fn, tbf_name((struct gprs_rlcmac_tbf *)item->tbf_usf.ul_tbf));
/* TODO: increase N3101 */
break;
case PDCH_ULC_NODE_TBF_POLL:
LOGPDCH(ulc->pdch, DRLCMAC, LOGL_NOTICE,

File diff suppressed because it is too large Load Diff