pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-gprs/+/33981 )
Change subject: rlcmac: llc_queue: Log if LLC-PDU with unexpected radio_prio is enqueued
......................................................................
rlcmac: llc_queue: Log if LLC-PDU with unexpected radio_prio is enqueued
Change-Id: If2d1946522bc4a1c19d65acb23605f1a3f05ab45
---
M src/rlcmac/llc_queue.c
M tests/rlcmac/rlcmac_prim_test.c
M tests/rlcmac/rlcmac_prim_test.err
3 files changed, 35 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/81/33981/1
diff --git a/src/rlcmac/llc_queue.c b/src/rlcmac/llc_queue.c
index 066df47..0c589f8 100644
--- a/src/rlcmac/llc_queue.c
+++ b/src/rlcmac/llc_queue.c
@@ -97,10 +97,13 @@
struct msgb *msg;
/* Trim to expected values 1..4, (3GPP TS 24.008) 10.5.7.2 */
- if (radio_prio < _GPRS_RLCMAC_RADIO_PRIO_HIGHEST)
+ if (radio_prio < _GPRS_RLCMAC_RADIO_PRIO_HIGHEST) {
+ LOGGRE(q->gre, LOGL_NOTICE, "Enqueuing LLC-PDU with unexpected radio_prio=%u
not in range (1..4)\n", radio_prio);
radio_prio = _GPRS_RLCMAC_RADIO_PRIO_HIGHEST;
- else if (radio_prio > _GPRS_RLCMAC_RADIO_PRIO_LOWEST)
+ } else if (radio_prio > _GPRS_RLCMAC_RADIO_PRIO_LOWEST) {
+ LOGGRE(q->gre, LOGL_NOTICE, "Enqueuing LLC-PDU with unexpected radio_prio=%u
not in range (1..4)\n", radio_prio);
radio_prio = _GPRS_RLCMAC_RADIO_PRIO_LOWEST;
+ }
sapi_prio = gprs_rlcmac_llc_sapi2prio(sapi);
diff --git a/tests/rlcmac/rlcmac_prim_test.c b/tests/rlcmac/rlcmac_prim_test.c
index 10f148a..410b266 100644
--- a/tests/rlcmac/rlcmac_prim_test.c
+++ b/tests/rlcmac/rlcmac_prim_test.c
@@ -599,6 +599,7 @@
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, pdu_llc_gmm_att_req,
sizeof(pdu_llc_gmm_att_req));
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_GMM;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 1;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
OSMO_ASSERT(sizeof(ccch_imm_ass_pkt_ul_tbf_normal) == GSM_MACBLOCK_LEN);
@@ -662,6 +663,7 @@
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, pdu_llc_gmm_att_req,
14);
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_GMM;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 1;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
OSMO_ASSERT(sizeof(ccch_imm_ass_pkt_ul_tbf_normal) == GSM_MACBLOCK_LEN);
@@ -696,6 +698,7 @@
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, pdu_llc_gmm_att_req,
14);
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_GMM;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 1;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
/* Trigger transmission of PKT RES REQ: */
@@ -721,6 +724,7 @@
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, pdu_llc_gmm_att_req,
sizeof(pdu_llc_gmm_att_req));
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_GMM;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 1;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
OSMO_ASSERT(sizeof(ccch_imm_ass_pkt_ul_tbf_normal) == GSM_MACBLOCK_LEN);
@@ -757,6 +761,7 @@
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, pdu_llc_gmm_att_req,
sizeof(pdu_llc_gmm_att_req));
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_GMM;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 1;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
for (i = 0; i < 4; i++) {
@@ -806,6 +811,7 @@
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, pdu_llc_gmm_att_req,
sizeof(pdu_llc_gmm_att_req));
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_GMM;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 1;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
OSMO_ASSERT(rc == 0);
}
@@ -853,6 +859,7 @@
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, pdu_llc_gmm_att_req,
sizeof(pdu_llc_gmm_att_req));
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_GMM;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 1;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
ccch_imm_ass_pkt_ul_tbf_normal[7] = last_rach_req_ra; /* Update RA to match */
@@ -910,6 +917,7 @@
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, pdu_llc_gmm_att_req,
sizeof(pdu_llc_gmm_att_req));
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_GMM;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 1;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
ccch_imm_ass_pkt_ul_tbf_normal[7] = last_rach_req_ra; /* Update RA to match */
@@ -980,6 +988,7 @@
memset(msgb_data(llc_msg), 0xab, msgb_length(llc_msg));
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, msgb_data(llc_msg),
msgb_length(llc_msg));
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_SNDCP3;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 2;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
ccch_imm_ass_pkt_ul_tbf_normal[7] = last_rach_req_ra; /* Update RA to match */
@@ -1111,6 +1120,7 @@
/* Submit 14 bytes to fit in 1 RLCMAC block to shorten test and end up in FINISHED state
quickly: */
rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_grr_unitdata_req(tlli, pdu_llc_gmm_att_req,
14);
rlcmac_prim->grr.unitdata_req.sapi = OSMO_GPRS_RLCMAC_LLC_SAPI_GMM;
+ rlcmac_prim->grr.unitdata_req.radio_prio = 1;
rc = osmo_gprs_rlcmac_prim_upper_down(rlcmac_prim);
OSMO_ASSERT(rc == 0);
diff --git a/tests/rlcmac/rlcmac_prim_test.err b/tests/rlcmac/rlcmac_prim_test.err
index 6b84f2c..913c9da 100644
--- a/tests/rlcmac/rlcmac_prim_test.err
+++ b/tests/rlcmac/rlcmac_prim_test.err
@@ -1,7 +1,7 @@
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
DLGLOBAL INFO TLLI=0x00002342 not found, creating entity on the fly
DLGLOBAL INFO DL_TBF_ASS{IDLE}: Allocated
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=1
DLGLOBAL INFO UL_TBF{NEW}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Received Event START
@@ -76,7 +76,7 @@
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
DLGLOBAL INFO TLLI=0x00002342 not found, creating entity on the fly
DLGLOBAL INFO DL_TBF_ASS{IDLE}: Allocated
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=1
DLGLOBAL INFO UL_TBF{NEW}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Received Event START
@@ -181,7 +181,7 @@
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
DLGLOBAL INFO TLLI=0x00002342 not found, creating entity on the fly
DLGLOBAL INFO DL_TBF_ASS{IDLE}: Allocated
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=1
DLGLOBAL INFO UL_TBF{NEW}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Received Event START
@@ -335,7 +335,7 @@
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
DLGLOBAL INFO TLLI=0x00002342 not found, creating entity on the fly
DLGLOBAL INFO DL_TBF_ASS{IDLE}: Allocated
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=1
DLGLOBAL INFO UL_TBF{NEW}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Received Event START
@@ -345,7 +345,7 @@
DLGLOBAL DEBUG Tx to lower layers: L1CTL-RACH.request
DLGLOBAL INFO UL_TBF_ASS{IDLE}: state_chg to WAIT_CCCH_IMM_ASS
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=1
DLGLOBAL DEBUG Rx from lower layers: L1CTL-CCCH_DATA.indication
DLGLOBAL DEBUG Tx to lower layers: L1CTL-PDCH_ESTABLISH.request
DLGLOBAL INFO UL_TBF_ASS{WAIT_CCCH_IMM_ASS}: Received Event RX_CCCH_IMM_ASS
@@ -511,7 +511,7 @@
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
DLGLOBAL INFO TLLI=0x00002342 not found, creating entity on the fly
DLGLOBAL INFO DL_TBF_ASS{IDLE}: Allocated
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=1
DLGLOBAL INFO UL_TBF{NEW}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Received Event START
@@ -579,7 +579,7 @@
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
DLGLOBAL INFO TLLI=0x00002342 not found, creating entity on the fly
DLGLOBAL INFO DL_TBF_ASS{IDLE}: Allocated
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=33 SAPI=GMM radio_prio=1
DLGLOBAL INFO UL_TBF{NEW}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Received Event START
@@ -693,7 +693,7 @@
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
DLGLOBAL INFO TLLI=0x00002342 not found, creating entity on the fly
DLGLOBAL INFO DL_TBF_ASS{IDLE}: Allocated
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=200 SAPI=SNDCP3 radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=200 SAPI=SNDCP3 radio_prio=2
DLGLOBAL INFO UL_TBF{NEW}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Received Event START
@@ -803,7 +803,7 @@
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
DLGLOBAL INFO TLLI=0x00002342 not found, creating entity on the fly
DLGLOBAL INFO DL_TBF_ASS{IDLE}: Allocated
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=14 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=14 SAPI=GMM radio_prio=1
DLGLOBAL INFO UL_TBF{NEW}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Allocated
DLGLOBAL INFO UL_TBF_ASS{IDLE}: Received Event START
@@ -854,7 +854,7 @@
DLGLOBAL INFO UL_TBF{FINISHED}: state_chg to RELEASING
DLGLOBAL DEBUG Register POLL (TS=7 FN=17, reason=UL_ACK)
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
-DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=14 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00002342) Enqueueing LLC-PDU len=14 SAPI=GMM radio_prio=1
DLGLOBAL DEBUG Rx from lower layers: L1CTL-PDCH_RTS.indication
DLGLOBAL DEBUG (ts=7,fn=17,usf=0) Tx Pkt Resource Request (UL ACK/NACK poll)
DLGLOBAL INFO UL_TBF{NEW}: Allocated
@@ -947,7 +947,7 @@
DLGLOBAL INFO DL_TBF{FLOW}: state_chg to FINISHED
DLGLOBAL DEBUG Register POLL (TS=7 FN=21, reason=DL_ACK)
DLGLOBAL INFO Rx from upper layers: GRR-UNITDATA.request
-DLGLOBAL DEBUG GRE(00000001) Enqueueing LLC-PDU len=14 SAPI=GMM radio_prio=0
+DLGLOBAL DEBUG GRE(00000001) Enqueueing LLC-PDU len=14 SAPI=GMM radio_prio=1
DLGLOBAL DEBUG Rx from lower layers: L1CTL-PDCH_RTS.indication
DLGLOBAL DEBUG (ts=7,fn=21,usf=0) Tx DL ACK/NACK FinalAck=1
DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) - SSN 1, V(N):
"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIR" R=Received
I=Invalid, FINAL_ACK=1
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-gprs/+/33981
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: If2d1946522bc4a1c19d65acb23605f1a3f05ab45
Gerrit-Change-Number: 33981
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange