pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/31087 )
Change subject: llc: Refactor code checking if PDU expired while dequeueing
......................................................................
llc: Refactor code checking if PDU expired while dequeueing
The previous function name was misleading since it was checking already
for more stuff than pdu containing user data.
Rename the function and move all checks on PDU in there instead of
having it half in one place and half in the other.
Change-Id: Ia0738caa1ccab5f78c2d49db582bdce96f18600a
---
M src/llc.c
1 file changed, 8 insertions(+), 11 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/src/llc.c b/src/llc.c
index c283146..7d39d61 100644
--- a/src/llc.c
+++ b/src/llc.c
@@ -80,9 +80,12 @@
llc->length += len;
}
-static bool llc_is_user_data_frame(const uint8_t *data, size_t len)
+static bool llc_pdu_can_be_discarded(const uint8_t *data, size_t len)
{
- if (len < 2)
+ const unsigned keep_small_thresh = 60;
+
+ /* Is the frame small, perhaps only a TCP ACK? */
+ if (len <= keep_small_thresh)
return false;
if ((data[0] & 0x0f) == 1 /* GPRS_SAPI_GMM */)
@@ -271,7 +274,6 @@
struct gprs_rlcmac_bts *bts = q->ms->bts;
struct gprs_pcu *pcu = bts->pcu;
struct timespec hyst_delta = {0, 0};
- const unsigned keep_small_thresh = 60;
enum gprs_llc_queue_prio prio;
if (pcu->vty.llc_discard_csec)
@@ -306,14 +308,9 @@
/* Hysteresis mode, try to discard LLC messages until
* the low water mark has been reached */
- /* Check whether to abort the hysteresis mode */
-
- /* Is the frame small, perhaps only a TCP ACK? */
- if (msg->len <= keep_small_thresh)
- break;
-
- /* Is it a GMM message? */
- if (!llc_is_user_data_frame(msg->data, msg->len))
+ /* Check whether to abort the hysteresis mode:
+ * Can the PDU be discarded according to its type? */
+ if (!llc_pdu_can_be_discarded(msg->data, msg->len))
break;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/31087
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ia0738caa1ccab5f78c2d49db582bdce96f18600a
Gerrit-Change-Number: 31087
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: fixeria.
Hello osmith, Jenkins Builder, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmocom-bb/+/31077
to look at the new patch set (#5).
Change subject: modem: Initial integration of libosmo-gprs-rlcmac
......................................................................
modem: Initial integration of libosmo-gprs-rlcmac
This commit places code to forward unitdata LLC<->RLCMAC.
Depends: libosmo-gprs.git Change-Id I1870fa6a264612c5a669bfb832e6e8c0a892cb74
Related: OS#5500
Change-Id: I0e628d9ddaa5ad6a205f07746d4176d1b8df7eb0
---
M src/host/layer23/include/osmocom/bb/common/logging.h
M src/host/layer23/include/osmocom/bb/modem/Makefile.am
A src/host/layer23/include/osmocom/bb/modem/rlcmac.h
M src/host/layer23/src/common/logging.c
M src/host/layer23/src/modem/Makefile.am
M src/host/layer23/src/modem/app_modem.c
M src/host/layer23/src/modem/llc.c
A src/host/layer23/src/modem/rlcmac.c
8 files changed, 177 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/77/31077/5
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/31077
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I0e628d9ddaa5ad6a205f07746d4176d1b8df7eb0
Gerrit-Change-Number: 31077
Gerrit-PatchSet: 5
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset