Change in libosmocore[rel-1.4.1]: lapdm: fix SAPI-0/SAPI-3 frame prioritization on DCCH

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri Aug 28 10:52:32 UTC 2020


Hello fixeria,

I'd like you to do a code review. Please visit

    https://gerrit.osmocom.org/c/libosmocore/+/19867

to review the following change.


Change subject: lapdm: fix SAPI-0/SAPI-3 frame prioritization on DCCH
......................................................................

lapdm: fix SAPI-0/SAPI-3 frame prioritization on DCCH

According to 3GPP TS 44.005, section 4.2.2 "Priority":

  a) on DCCH, a SAPI=0 frame always has higher priority than SAPI=3;
  b) on ACCH, the priority arrangement is more complex:
    b1) if a SAPI = 3 frame is awaiting transmission, two SAPI=0
        frames shall not be sent in consecutive SACCH frames;
    b2) on the network side (LAPDM_MODE_BTS), it must also be ensured
        that any SAPI=3 frame is followed by at least one SAPI=0 frame;
    b3) a SAPI = 0 frame may be repeated in the next SACCH period
        if the Repeated SACCH is supported (see 3GPP TS 44.006, section 11).

We definitely need to extend our testing coverage to ensure that
we implement b) correctly, but for now let's focus on DCCH:

  a) for DCCH, ensure that SAPI=0 frames preceed SAPI=3 ones;
  b) for ACCH, re-use the existing round-robin implementation.

Change-Id: Ia3780bce1222b312ae2fd2d21496a4d6c5ccb6e0
Related: SYS#5047, OS#4731
---
M src/gsm/lapdm.c
1 file changed, 21 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/19867/1

diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index e5fbaf0..fa928c5 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -380,7 +380,21 @@
 	return le->l1_prim_cb(&pp.oph, le->l1_ctx);
 }
 
-static struct msgb *tx_dequeue_msgb(struct lapdm_entity *le)
+/* Dequeue a Downlink message for DCCH (dedicated channel) */
+static struct msgb *tx_dequeue_dcch_msgb(struct lapdm_entity *le)
+{
+	struct msgb *msg;
+
+	/* SAPI=0 always has higher priority than SAPI=3 */
+	msg = msgb_dequeue(&le->datalink[DL_SAPI0].dl.tx_queue);
+	if (msg == NULL) /* no SAPI=0 messages, dequeue SAPI=3 (if any) */
+		msg = msgb_dequeue(&le->datalink[DL_SAPI3].dl.tx_queue);
+
+	return msg;
+}
+
+/* Dequeue a Downlink message for ACCH (associated channel) */
+static struct msgb *tx_dequeue_acch_msgb(struct lapdm_entity *le)
 {
 	struct lapdm_datalink *dl;
 	int last = le->last_tx_dequeue;
@@ -411,7 +425,12 @@
 	struct msgb *msg;
 	uint8_t pad;
 
-	msg = tx_dequeue_msgb(le);
+	/* Dequeue depending on channel type: DCCH or ACCH.
+	 * See 3GPP TS 44.005, section 4.2.2 "Priority". */
+	if (le == &le->lapdm_ch->lapdm_dcch)
+		msg = tx_dequeue_dcch_msgb(le);
+	else
+		msg = tx_dequeue_acch_msgb(le);
 	if (!msg)
 		return -ENODEV;
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/19867
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: rel-1.4.1
Gerrit-Change-Id: Ia3780bce1222b312ae2fd2d21496a4d6c5ccb6e0
Gerrit-Change-Number: 19867
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200828/e193ef7a/attachment.htm>


More information about the gerrit-log mailing list