fixeria has uploaded this change for review.
trxcon/l1sched: rework dequeueing of PDCH Tx prims
When an UL BLOCK.req is received late, i.e. after the first Tx burst
of the respective TDMA Fn was requested by the PHY, a domino effect
can be observed: the stale Tx primitive remains in the queue and
prevents transmission of the next primitive, even if the later was
received in time. This breaks transmission of consecutive UL blocks.
Don't let stale primitives poison the Tx queue: drop them like before,
but keep looking for a primitive with the matching TDMA Fn. If found
a primitive with TDMA Fn past the current one, stop the iteration.
Change-Id: I439615639b8e840b9fd4f3af6934d9f298f32216
Depends: libosmocore.git I9590f2e836fc48650decf1564b6ab46306c4fe2d
Related: OS#5500
---
M src/host/trxcon/src/sched_lchan_pdtch.c
1 file changed, 38 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/23/34523/1
diff --git a/src/host/trxcon/src/sched_lchan_pdtch.c b/src/host/trxcon/src/sched_lchan_pdtch.c
index 0f8a25f..d1f426b 100644
--- a/src/host/trxcon/src/sched_lchan_pdtch.c
+++ b/src/host/trxcon/src/sched_lchan_pdtch.c
@@ -26,6 +26,7 @@
#include <osmocom/core/logging.h>
#include <osmocom/core/bits.h>
+#include <osmocom/gsm/gsm0502.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/coding/gsm0503_coding.h>
@@ -104,20 +105,25 @@
static struct msgb *prim_dequeue_pdtch(struct l1sched_lchan_state *lchan, uint32_t fn)
{
- const struct l1sched_prim *prim;
struct msgb *msg;
- msg = msgb_dequeue(&lchan->tx_prims);
- if (msg == NULL)
- return NULL;
- prim = l1sched_prim_from_msgb(msg);
+ llist_for_each_entry(msg, &lchan->tx_prims, list) {
+ const struct l1sched_prim *prim = l1sched_prim_from_msgb(msg);
+ int ret = gsm0502_fn_compare(prim->data_req.frame_nr, fn);
- if (OSMO_LIKELY(prim->data_req.frame_nr == fn))
- return msg;
- LOGP_LCHAND(lchan, LOGL_ERROR,
- "%s(): dropping Tx primitive (current Fn=%u, prim Fn=%u)\n",
- __func__, fn, prim->data_req.frame_nr);
- msgb_free(msg);
+ if (OSMO_LIKELY(ret == 0)) { /* it's a match! */
+ llist_del(msg->list);
+ return msg;
+ } else if (ret > 0) { /* not now, come back later */
+ break;
+ } /* else: the ship has sailed, drop your ticket */
+
+ LOGP_LCHAND(lchan, LOGL_ERROR,
+ "%s(): dropping stale Tx primitive (current Fn=%u, prim Fn=%u)\n",
+ __func__, fn, prim->data_req.frame_nr);
+ msgb_free(msg);
+ }
+
return NULL;
}
To view, visit change 34523. To unsubscribe, or for help writing mail filters, visit settings.