fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34520?usp=email )
Change subject: gsm: add gsm0502_fn_compare() for comparing TDMA FNs
......................................................................
Set Ready For Review
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34520?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9590f2e836fc48650decf1564b6ab46306c4fe2d
Gerrit-Change-Number: 34520
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 25 Sep 2023 17:42:01 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/34523?usp=email )
Change subject: trxcon/l1sched: rework dequeueing of PDCH Tx prims
......................................................................
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 https://gerrit.osmocom.org/c/osmocom-bb/+/34523?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I439615639b8e840b9fd4f3af6934d9f298f32216
Gerrit-Change-Number: 34523
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange