WIP: Delay deleting UL TBF until last Pkt Ctrl Ack is fully transmitted

This in turn delays reconfiguring the lower layers (L1CTL-CFG_UL_TBF.req
mask=0x0) until the last block has been transmited.

Change-Id: Ic38b4207623ccbda3b77d4b0a47431c25de95034
This commit is contained in:
Pau Espin 2024-02-01 21:32:44 +01:00
parent e9ea7fc768
commit c51bfae37c
3 changed files with 40 additions and 4 deletions

View File

@ -633,6 +633,29 @@ static int rlcmac_prim_handle_l1ctl_ccch_data_ind(struct osmo_gprs_rlcmac_prim *
return rc;
}
static int rlcmac_prim_handle_l1ctl_pdch_data_cnf(struct osmo_gprs_rlcmac_prim *rlcmac_prim)
{
int rc;
if (get_rlcmac_block_ctrl_type(rlcmac_prim->l1ctl.ccch_data_cnf.req.data) != OSMO_GPRS_RLCMAC_UL_MSGT_PACKET_CONTROL_ACK)
return 0;
struct gprs_rlcmac_entity *gre;
llist_for_each_entry(gre, &g_rlcmac_ctx->gre_list, entry) {
if (!gre->ul_tbf)
continue;
if (!gprs_rlcmac_ul_tbf_waiting_pkt_ctrl_ack_confirmation(gre->ul_tbf,
rlcmac_prim->l1ctl.ccch_data_cnf.req.fn,
rlcmac_prim->l1ctl.ccch_data_cnf.req.ts))
continue;
osmo_fsm_inst_dispatch(gre->ul_tbf->state_fsm.fi, GPRS_RLCMAC_TBF_UL_EV_TX_COMPL_PKT_CTRL_ACK, NULL);
/* gre->ul_tbf is NULL here. */
break;
}
return 0;
}
static int rlcmac_prim_handle_l1ctl_ccch_ready_ind(struct osmo_gprs_rlcmac_prim *rlcmac_prim)
{
struct gprs_rlcmac_entity *gre;
@ -657,6 +680,9 @@ static int gprs_rlcmac_prim_l1ctl_lower_up(struct osmo_gprs_rlcmac_prim *rlcmac_
case OSMO_PRIM(OSMO_GPRS_RLCMAC_L1CTL_PDCH_DATA, PRIM_OP_INDICATION):
rc = rlcmac_prim_handle_l1ctl_pdch_data_ind(rlcmac_prim);
break;
case OSMO_PRIM(OSMO_GPRS_RLCMAC_L1CTL_PDCH_DATA, PRIM_OP_CONFIRM):
rc = rlcmac_prim_handle_l1ctl_pdch_data_cnf(rlcmac_prim);
break;
case OSMO_PRIM(OSMO_GPRS_RLCMAC_L1CTL_CCCH_DATA, PRIM_OP_INDICATION):
rc = rlcmac_prim_handle_l1ctl_ccch_data_ind(rlcmac_prim);
break;

View File

@ -159,10 +159,11 @@ static struct gprs_rlcmac_ul_tbf *find_requested_ul_tbf_for_dummy(const struct g
* \param[in] bi RTS block indication information.
* \param[in] tbfs TBF candidates having CTRL messages to send, filled in by get_ctrl_msg_tbf_candidates()
* \param[out] tbf_to_free TBF to free after sending the generated message
* TODO: need_block_conf
*/
static struct msgb *sched_select_ctrl_msg(const struct gprs_rlcmac_rts_block_ind *bi,
const struct tbf_sched_ctrl_candidates *tbfs,
struct gprs_rlcmac_tbf **tbf_to_free)
struct gprs_rlcmac_tbf **tbf_to_free, bool *need_block_conf)
{
struct msgb *msg = NULL;
struct gprs_rlcmac_entity *gre;
@ -171,6 +172,9 @@ static struct msgb *sched_select_ctrl_msg(const struct gprs_rlcmac_rts_block_ind
/* No TBF to be freed by default: */
*tbf_to_free = NULL;
/* No TBF needs block conf by default: */
*need_block_conf = false;
/* 8.1.2.2 1) (EGPRS) PACKET DOWNLINK ACK/NACK w/ FinalAckInd=1 */
if (tbfs->poll_dl_ack_final_ack) {
LOGRLCMAC(LOGL_DEBUG, "(ts=%u,fn=%u,usf=%u) Tx DL ACK/NACK FinalAck=1\n",
@ -207,9 +211,10 @@ static struct msgb *sched_select_ctrl_msg(const struct gprs_rlcmac_rts_block_ind
if (tbfs->poll_ul_ack) {
LOGRLCMAC(LOGL_DEBUG, "(ts=%u,fn=%u,usf=%u) Tx Pkt Control Ack (UL ACK/NACK poll)\n",
bi->ts, bi->fn, bi->usf);
/* This needs to be changed to call a UL TBF API which will store at which FN+TN the PKT CTRL ACK was sent. */
msg = gprs_rlcmac_gre_create_pkt_ctrl_ack(ul_tbf_as_tbf(tbfs->poll_ul_ack)->gre);
/* Last UL message, freeing (after passing msg to lower layers) */
*tbf_to_free = ul_tbf_as_tbf(tbfs->poll_ul_ack);
//*tbf_to_free = ul_tbf_as_tbf(tbfs->poll_ul_ack);
return msg;
}
if (tbfs->poll_dl_ass) {
@ -289,6 +294,7 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_rts_block_ind *bi)
struct msgb *msg = NULL;
struct tbf_sched_ctrl_candidates tbf_cand = {0};
struct gprs_rlcmac_tbf *tbf_to_free;
bool need_block_conf;
struct osmo_gprs_rlcmac_prim *rlcmac_prim_tx;
int rc = 0;
@ -296,7 +302,7 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_rts_block_ind *bi)
get_ctrl_msg_tbf_candidates(bi, &tbf_cand);
if ((msg = sched_select_ctrl_msg(bi, &tbf_cand, &tbf_to_free)))
if ((msg = sched_select_ctrl_msg(bi, &tbf_cand, &tbf_to_free, &need_block_conf)))
goto tx_msg;
if ((msg = sched_select_ul_data_msg(bi)))
@ -312,6 +318,7 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_rts_block_ind *bi)
tx_msg:
rlcmac_prim_tx = gprs_rlcmac_prim_alloc_l1ctl_pdch_data_req(bi->ts, bi->fn, msgb_data(msg), 0);
rlcmac_prim_tx->l1ctl.pdch_data_req.data_len = msgb_length(msg);
rlcmac_prim_tx->l1ctl.pdch_data_req.needs_conf = need_block_conf;
rc = gprs_rlcmac_prim_call_down_cb(rlcmac_prim_tx);
msgb_free(msg);
if (tbf_to_free)

View File

@ -266,8 +266,11 @@ static void st_finished(struct osmo_fsm_inst *fi, uint32_t event, void *data)
/* Waiting for scheduler to transmit PKT CTRL ACK for the already received UL ACK/NACK FinalAck=1 */
static void st_releasing(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
//struct gprs_rlcmac_tbf_ul_fsm_ctx *ctx = (struct gprs_rlcmac_tbf_ul_fsm_ctx *)fi->priv;
struct gprs_rlcmac_tbf_ul_fsm_ctx *ctx = (struct gprs_rlcmac_tbf_ul_fsm_ctx *)fi->priv;
switch (event) {
case GPRS_RLCMAC_TBF_UL_EV_TX_COMPL_PKT_CTRL_ACK:
tbf_ul_free(ctx->ul_tbf);
break;
default:
OSMO_ASSERT(0);
}