trxcon: l1sched_prim_dequeue(): check TDMA Fn in PDCH prims

We shall never be transmitting Uplink PDCH blocks if the current
TDMA Fn does not match the requested TDMA Fn, because Tx timing
is critical for PDCH timeslots.  Drop and log an error message.

Change-Id: I6b2d9cc93ce266524f56a1b6a97beecfc0ad042d
Related: OS#5500
This commit is contained in:
Vadim Yanitskiy 2023-03-25 04:41:51 +07:00 committed by fixeria
parent 2a4fb97341
commit a80957b617
3 changed files with 20 additions and 0 deletions

View File

@ -354,6 +354,8 @@ struct l1sched_ts_prim {
enum l1sched_ts_prim_type type;
/*! Logical channel type */
enum l1sched_lchan_type chan;
/*! TDMA Fn for L1SCHED_{PDTCH,PTCCH} */
uint32_t fn;
/*! Payload length */
size_t payload_len;
/*! Payload */

View File

@ -421,6 +421,8 @@ no_facch:
struct l1sched_ts_prim *l1sched_prim_dequeue(struct llist_head *queue,
uint32_t fn, struct l1sched_lchan_state *lchan)
{
struct l1sched_ts_prim *prim;
/* SACCH is unorthodox, see 3GPP TS 04.08, section 3.4.1 */
if (L1SCHED_CHAN_IS_SACCH(lchan->type))
return prim_dequeue_sacch(queue, lchan);
@ -439,6 +441,20 @@ struct l1sched_ts_prim *l1sched_prim_dequeue(struct llist_head *queue,
case L1SCHED_TCHH_1:
return prim_dequeue_tch_h(queue, fn, lchan->type);
/* PDCH is timing critical, we need to check TDMA Fn */
case L1SCHED_PDTCH:
case L1SCHED_PTCCH:
prim = prim_dequeue_one(queue, lchan->type);
if (prim == NULL)
return NULL;
if (OSMO_LIKELY(prim->fn == fn))
return prim;
LOGP_LCHAND(lchan, LOGL_ERROR,
"%s(): dropping Tx primitive (current Fn=%u, prim Fn=%u)\n",
__func__, fn, prim->fn);
talloc_free(prim);
return NULL;
/* Other kinds of logical channels */
default:
return prim_dequeue_one(queue, lchan->type);

View File

@ -560,6 +560,8 @@ static void trxcon_st_packet_data_action(struct osmo_fsm_inst *fi,
LOGPFSML(fi, LOGL_ERROR, "Failed to enqueue a prim\n");
return;
}
prim->fn = block_req.hdr.fn;
break;
}
case TRXCON_EV_RX_DATA_IND: