lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

September 2023

  • 1 participants
  • 1947 discussions
[M] Change in libosmo-gprs[master]: tbf_ul_ass_fsm: Listen only on 1 TS for PKT UL ASS when assignment do...
by pespin 05 Sep '23

05 Sep '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/34313?usp=email ) Change subject: tbf_ul_ass_fsm: Listen only on 1 TS for PKT UL ASS when assignment done from DL TBF ...................................................................... tbf_ul_ass_fsm: Listen only on 1 TS for PKT UL ASS when assignment done from DL TBF This also fixes a memcpy writing out of bounds reported by Coverity CID#323120 in gprs_rlcmac_tbf_ul_ass_start_from_dl_tbf_ack_nack(), due to the difference of size between struct gprs_rlcmac_ul_tbf_allocation and struct gprs_rlcmac_dl_tbf_allocation. While fixing it, actually properly implement passing of the 1 only interesting TS to the tbf_ul_ass_fsm at that point in time. Change-Id: I89b15982b73f00599183981142495d7b9befbb78 --- M include/osmocom/gprs/rlcmac/rlcmac_enc.h M include/osmocom/gprs/rlcmac/tbf_dl.h M include/osmocom/gprs/rlcmac/tbf_ul_ass_fsm.h M src/rlcmac/rlcmac_enc.c M src/rlcmac/sched.c M src/rlcmac/tbf_dl.c M src/rlcmac/tbf_ul_ass_fsm.c M tests/rlcmac/rlcmac_prim_test.err 8 files changed, 47 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/13/34313/1 diff --git a/include/osmocom/gprs/rlcmac/rlcmac_enc.h b/include/osmocom/gprs/rlcmac/rlcmac_enc.h index 298d364..1ed02be 100644 --- a/include/osmocom/gprs/rlcmac/rlcmac_enc.h +++ b/include/osmocom/gprs/rlcmac/rlcmac_enc.h @@ -47,6 +47,6 @@ void gprs_rlcmac_enc_prepare_pkt_resource_req(RlcMacUplink_t *block, struct gprs_rlcmac_ul_tbf *ul_tbf, enum gprs_rlcmac_access_type acc_type); -void gprs_rlcmac_enc_prepare_pkt_downlink_ack_nack(RlcMacUplink_t *block, const struct gprs_rlcmac_dl_tbf *dl_tbf); +void gprs_rlcmac_enc_prepare_pkt_downlink_ack_nack(RlcMacUplink_t *block, const struct gprs_rlcmac_dl_tbf *dl_tbf, bool chan_req); void gprs_rlcmac_enc_prepare_pkt_ctrl_ack(RlcMacUplink_t *block, uint32_t tlli); diff --git a/include/osmocom/gprs/rlcmac/tbf_dl.h b/include/osmocom/gprs/rlcmac/tbf_dl.h index fe0b2ef..fc75972 100644 --- a/include/osmocom/gprs/rlcmac/tbf_dl.h +++ b/include/osmocom/gprs/rlcmac/tbf_dl.h @@ -45,7 +45,7 @@ int gprs_rlcmac_dl_tbf_configure_l1ctl(struct gprs_rlcmac_dl_tbf *dl_tbf); -struct msgb *gprs_rlcmac_dl_tbf_create_pkt_dl_ack_nack(struct gprs_rlcmac_dl_tbf *dl_tbf); +struct msgb *gprs_rlcmac_dl_tbf_create_pkt_dl_ack_nack(struct gprs_rlcmac_dl_tbf *dl_tbf, uint8_t tn); int gprs_rlcmac_dl_tbf_rcv_data_block(struct gprs_rlcmac_dl_tbf *dl_tbf, const struct gprs_rlcmac_rlc_data_info *rlc, diff --git a/include/osmocom/gprs/rlcmac/tbf_ul_ass_fsm.h b/include/osmocom/gprs/rlcmac/tbf_ul_ass_fsm.h index ea9e521..ad32471 100644 --- a/include/osmocom/gprs/rlcmac/tbf_ul_ass_fsm.h +++ b/include/osmocom/gprs/rlcmac/tbf_ul_ass_fsm.h @@ -82,7 +82,7 @@ int gprs_rlcmac_tbf_ul_ass_start(struct gprs_rlcmac_ul_tbf *ul_tbf, enum gprs_rlcmac_tbf_ul_ass_type type); int gprs_rlcmac_tbf_ul_ass_start_from_releasing_ul_tbf(struct gprs_rlcmac_ul_tbf *ul_tbf, struct gprs_rlcmac_ul_tbf *old_ul_tbf); -int gprs_rlcmac_tbf_ul_ass_start_from_dl_tbf_ack_nack(struct gprs_rlcmac_ul_tbf *ul_tbf, const struct gprs_rlcmac_dl_tbf *dl_tbf); +int gprs_rlcmac_tbf_ul_ass_start_from_dl_tbf_ack_nack(struct gprs_rlcmac_ul_tbf *ul_tbf, const struct gprs_rlcmac_dl_tbf *dl_tbf, uint8_t tn); bool gprs_rlcmac_tbf_ul_ass_pending(struct gprs_rlcmac_ul_tbf *ul_tbf); bool gprs_rlcmac_tbf_ul_ass_match_rach_req(struct gprs_rlcmac_ul_tbf *ul_tbf, uint8_t ra); diff --git a/src/rlcmac/rlcmac_enc.c b/src/rlcmac/rlcmac_enc.c index d8cd61e..dec2fa6 100644 --- a/src/rlcmac/rlcmac_enc.c +++ b/src/rlcmac/rlcmac_enc.c @@ -384,11 +384,9 @@ /* TODO: fill cqr from info stored probably in the gre object. */ } -void gprs_rlcmac_enc_prepare_pkt_downlink_ack_nack(RlcMacUplink_t *block, const struct gprs_rlcmac_dl_tbf *dl_tbf) +void gprs_rlcmac_enc_prepare_pkt_downlink_ack_nack(RlcMacUplink_t *block, const struct gprs_rlcmac_dl_tbf *dl_tbf, bool chan_req) { Packet_Downlink_Ack_Nack_t *ack = &block->u.Packet_Downlink_Ack_Nack; - struct gprs_rlcmac_entity *gre = dl_tbf->tbf.gre; - int rc; memset(block, 0, sizeof(*block)); ack->MESSAGE_TYPE = OSMO_GPRS_RLCMAC_UL_MSGT_PACKET_DOWNLINK_ACK_NACK; @@ -398,9 +396,7 @@ ack->DOWNLINK_TFI = dl_tbf->cur_alloc.dl_tfi; gprs_rlcmac_enc_prepare_pkt_ack_nack_desc_gprs(&ack->Ack_Nack_Description, dl_tbf); - /* Channel Request Description. Request a UL-TBF if we have UL data - * queued to send and no active UL BF (TS 44.060 8.1.2.5) */ - if (!gre->ul_tbf && gprs_rlcmac_entity_have_tx_data_queued(gre)) { + if (chan_req) { Channel_Request_Description_t *chan_req = &ack->Channel_Request_Description; ack->Exist_Channel_Request_Description = 1; chan_req->PEAK_THROUGHPUT_CLASS = 0; /* TODO */ @@ -408,11 +404,6 @@ chan_req->RLC_MODE = GPRS_RLCMAC_RLC_MODE_ACKNOWLEDGED; chan_req->LLC_PDU_TYPE = GPRS_RLCMAC_LLC_PDU_TYPE_ACKNOWLEDGED; chan_req->RLC_OCTET_COUNT = 0; /* TODO */ - - gre->ul_tbf = gprs_rlcmac_ul_tbf_alloc(gre); - rc = gprs_rlcmac_tbf_ul_ass_start_from_dl_tbf_ack_nack(gre->ul_tbf, dl_tbf); - if (rc < 0) - LOGPTBFDL(dl_tbf, LOGL_ERROR, "Failed starting assignment of requested UL TBF (%d)\n", rc); } else { ack->Exist_Channel_Request_Description = 0; } diff --git a/src/rlcmac/sched.c b/src/rlcmac/sched.c index 6af2b6a..faa9ff1 100644 --- a/src/rlcmac/sched.c +++ b/src/rlcmac/sched.c @@ -175,7 +175,7 @@ if (tbfs->poll_dl_ack_final_ack) { LOGRLCMAC(LOGL_DEBUG, "(ts=%u,fn=%u,usf=%u) Tx DL ACK/NACK FinalAck=1\n", bi->ts, bi->fn, bi->usf); - msg = gprs_rlcmac_dl_tbf_create_pkt_dl_ack_nack(tbfs->poll_dl_ack_final_ack); + msg = gprs_rlcmac_dl_tbf_create_pkt_dl_ack_nack(tbfs->poll_dl_ack_final_ack, bi->ts); if (msg) return msg; } @@ -237,7 +237,7 @@ if (tbfs->poll_dl_ack) { LOGRLCMAC(LOGL_DEBUG, "(ts=%u,fn=%u,usf=%u) Tx DL ACK/NACK\n", bi->ts, bi->fn, bi->usf); - msg = gprs_rlcmac_dl_tbf_create_pkt_dl_ack_nack(tbfs->poll_dl_ack); + msg = gprs_rlcmac_dl_tbf_create_pkt_dl_ack_nack(tbfs->poll_dl_ack, bi->ts); if (msg) return msg; } diff --git a/src/rlcmac/tbf_dl.c b/src/rlcmac/tbf_dl.c index a7f0ea9..b8d37a8 100644 --- a/src/rlcmac/tbf_dl.c +++ b/src/rlcmac/tbf_dl.c @@ -160,11 +160,13 @@ return gprs_rlcmac_prim_call_down_cb(rlcmac_prim); } -struct msgb *gprs_rlcmac_dl_tbf_create_pkt_dl_ack_nack(struct gprs_rlcmac_dl_tbf *dl_tbf) +struct msgb *gprs_rlcmac_dl_tbf_create_pkt_dl_ack_nack(struct gprs_rlcmac_dl_tbf *dl_tbf, uint8_t tn) { struct msgb *msg; struct bitvec bv; RlcMacUplink_t ul_block; + bool chan_req = false; + struct gprs_rlcmac_entity *gre = dl_tbf->tbf.gre; int rc; OSMO_ASSERT(dl_tbf); @@ -173,6 +175,17 @@ if (!msg) return NULL; + /* Channel Request Description. Request a UL-TBF if we have UL data + * queued to send and no active UL TBF (TS 44.060 8.1.2.5) */ + if (!gre->ul_tbf && gprs_rlcmac_entity_have_tx_data_queued(gre)) { + gre->ul_tbf = gprs_rlcmac_ul_tbf_alloc(gre); + rc = gprs_rlcmac_tbf_ul_ass_start_from_dl_tbf_ack_nack(gre->ul_tbf, dl_tbf, tn); + if (rc < 0) + LOGPTBFDL(dl_tbf, LOGL_ERROR, "Failed starting assignment of requested UL TBF (%d)\n", rc); + else + chan_req = true; + } + /* Initialize a bit vector that uses allocated msgb as the data buffer. */ bv = (struct bitvec){ .data = msgb_put(msg, GSM_MACBLOCK_LEN), @@ -180,7 +193,7 @@ }; bitvec_unhex(&bv, GPRS_RLCMAC_DUMMY_VEC); - gprs_rlcmac_enc_prepare_pkt_downlink_ack_nack(&ul_block, dl_tbf); + gprs_rlcmac_enc_prepare_pkt_downlink_ack_nack(&ul_block, dl_tbf, chan_req); rc = osmo_gprs_rlcmac_encode_uplink(&bv, &ul_block); if (rc < 0) { LOGPTBFDL(dl_tbf, LOGL_ERROR, "Encoding of Packet Downlink ACK/NACK failed (%d)\n", rc); diff --git a/src/rlcmac/tbf_ul_ass_fsm.c b/src/rlcmac/tbf_ul_ass_fsm.c index 6262926..5587ddb 100644 --- a/src/rlcmac/tbf_ul_ass_fsm.c +++ b/src/rlcmac/tbf_ul_ass_fsm.c @@ -680,17 +680,17 @@ /* A DL-TBF requested a UL TBF over DL ACK/NACK, wait to receive Pkt Ul Ass for * it, aka switch the FSM to trigger the 2hpase directly (tx Pkt Res Req) */ -int gprs_rlcmac_tbf_ul_ass_start_from_dl_tbf_ack_nack(struct gprs_rlcmac_ul_tbf *ul_tbf, const struct gprs_rlcmac_dl_tbf *dl_tbf) +int gprs_rlcmac_tbf_ul_ass_start_from_dl_tbf_ack_nack(struct gprs_rlcmac_ul_tbf *ul_tbf, const struct gprs_rlcmac_dl_tbf *dl_tbf, uint8_t tn) { - uint8_t tn; int rc; ul_tbf->ul_ass_fsm.dl_tbf = dl_tbf; - /* FIXME: Ideally this should only be the TS where the PKT UL ASS was received... */ - ul_tbf->ul_ass_fsm.phase1_alloc.num_ts = dl_tbf->cur_alloc.num_ts; - for (tn = 0; tn < ARRAY_SIZE(ul_tbf->ul_ass_fsm.phase1_alloc.ts); tn++) { - ul_tbf->ul_ass_fsm.phase1_alloc.ts[0].allocated = dl_tbf->cur_alloc.ts[0].allocated; - ul_tbf->ul_ass_fsm.phase1_alloc.ts[0].usf = 0xff; - } + + /* The TS where the PKT UL ASS is to be received is the one where the DL + * ACK/NACK was sent in the DL TBF (control TS): */ + ul_tbf->ul_ass_fsm.phase1_alloc.num_ts = 1; + ul_tbf->ul_ass_fsm.phase1_alloc.ts[tn].allocated = true; + ul_tbf->ul_ass_fsm.phase1_alloc.ts[tn].usf = 0xff; + rc = osmo_fsm_inst_dispatch(ul_tbf->ul_ass_fsm.fi, GPRS_RLCMAC_TBF_UL_ASS_EV_START_FROM_DL_TBF, NULL); diff --git a/tests/rlcmac/rlcmac_prim_test.err b/tests/rlcmac/rlcmac_prim_test.err index 95dc475..41773b2 100644 --- a/tests/rlcmac/rlcmac_prim_test.err +++ b/tests/rlcmac/rlcmac_prim_test.err @@ -950,13 +950,13 @@ 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 DLGLOBAL INFO UL_TBF{NEW}: Allocated DLGLOBAL INFO UL_TBF_ASS{IDLE}: Allocated DLGLOBAL INFO UL_TBF_ASS{IDLE}: Received Event START_FROM_DL_TBF DLGLOBAL INFO UL_TBF{NEW}: Received Event UL_ASS_START DLGLOBAL INFO UL_TBF{NEW}: state_chg to ASSIGN DLGLOBAL INFO UL_TBF_ASS{IDLE}: state_chg to WAIT_PKT_UL_ASS +DLGLOBAL DEBUG TBF(DL:NR-0:TLLI-00000001) - SSN 1, V(N): "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIR" R=Received I=Invalid, FINAL_ACK=1 DLGLOBAL INFO TBF(DL:NR-0:TLLI-00000001) Starting T3192 (0 ms) DLGLOBAL DEBUG Tx to lower layers: L1CTL-PDCH_DATA.request DLGLOBAL DEBUG Rx from lower layers: L1CTL-PDCH_DATA.indication -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/34313?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: I89b15982b73f00599183981142495d7b9befbb78 Gerrit-Change-Number: 34313 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-netif[master]: contrib/jenkins.sh: run "make check"
by laforge 05 Sep '23

05 Sep '23
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email ) Change subject: contrib/jenkins.sh: run "make check" ...................................................................... Patch Set 1: (1 comment) File contrib/jenkins.sh: https://gerrit.osmocom.org/c/libosmo-netif/+/34311/comment/2a863f62_f1e328b2 PS1, Line 42: distcheck > "make distcheck" indeed contains running "make check": https://www.gnu. […] Done -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ic4f36e85823295c353789886af98eb3fe7eda039 Gerrit-Change-Number: 34311 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 05 Sep 2023 09:38:08 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-netif[master]: contrib/jenkins.sh: run "make check"
by laforge 05 Sep '23

05 Sep '23
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email ) Change subject: contrib/jenkins.sh: run "make check" ...................................................................... Patch Set 1: (1 comment) File contrib/jenkins.sh: https://gerrit.osmocom.org/c/libosmo-netif/+/34311/comment/ca9deff6_a87ae24d PS1, Line 42: distcheck > Hmm, in `libosmo-abis.git` we don't run `make check` either. […] "make distcheck" indeed contains running "make check": https://www.gnu.org/software/automake/manual/html_node/Checking-the-Distrib… Maybe @osmith@sysmocom.de can explain why a separate `make check` is desirable. -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ic4f36e85823295c353789886af98eb3fe7eda039 Gerrit-Change-Number: 34311 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 05 Sep 2023 09:37:48 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-netif[master]: contrib/jenkins.sh: run "make check"
by osmith 05 Sep '23

05 Sep '23
osmith has abandoned this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email ) Change subject: contrib/jenkins.sh: run "make check" ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ic4f36e85823295c353789886af98eb3fe7eda039 Gerrit-Change-Number: 34311 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: abandon
1 0
0 0
[S] Change in libosmo-netif[master]: contrib/jenkins.sh: run "make check"
by osmith 05 Sep '23

05 Sep '23
Attention is currently required from: fixeria. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email ) Change subject: contrib/jenkins.sh: run "make check" ...................................................................... Patch Set 1: (1 comment) File contrib/jenkins.sh: https://gerrit.osmocom.org/c/libosmo-netif/+/34311/comment/adebaa40_863c0c3c PS1, Line 42: distcheck > Hmm, in `libosmo-abis.git` we don't run `make check` either. […] Oh right, I see in the log output that it runs twice now. Then this is not needed, abandoning the patch. -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ic4f36e85823295c353789886af98eb3fe7eda039 Gerrit-Change-Number: 34311 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 05 Sep 2023 09:35:53 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-netif[master]: contrib/jenkins.sh: run "make check"
by fixeria 05 Sep '23

05 Sep '23
Attention is currently required from: osmith. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email ) Change subject: contrib/jenkins.sh: run "make check" ...................................................................... Patch Set 1: (1 comment) File contrib/jenkins.sh: https://gerrit.osmocom.org/c/libosmo-netif/+/34311/comment/1f6dee7e_b7201ac1 PS1, Line 42: distcheck Hmm, in `libosmo-abis.git` we don't run `make check` either. AFAIR, `make distcheck` includes `make check` too. -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ic4f36e85823295c353789886af98eb3fe7eda039 Gerrit-Change-Number: 34311 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 05 Sep 2023 09:31:26 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[L] Change in libosmo-netif[master]: stream: Add client-side (segmentation) support for IPA
by osmith 05 Sep '23

05 Sep '23
Attention is currently required from: arehbein, daniel, fixeria, pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33198?usp=email ) Change subject: stream: Add client-side (segmentation) support for IPA ...................................................................... Patch Set 21: (1 comment) Patchset: PS21: > the actual error is further above in the log: […] patch for running "make check" in jenkins.sh: https://gerrit.osmocom.org/c/libosmo-netif/+/34311 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33198?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I822abf52c6ae396c90b5c50228a0a39c848d3de6 Gerrit-Change-Number: 33198 Gerrit-PatchSet: 21 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: daniel <dwillmann(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Tue, 05 Sep 2023 09:16:55 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Comment-In-Reply-To: arehbein <arehbein(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-netif[master]: contrib/jenkins.sh: run "make check"
by osmith 05 Sep '23

05 Sep '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email ) Change subject: contrib/jenkins.sh: run "make check" ...................................................................... contrib/jenkins.sh: run "make check" Run "make check" in jenkins.sh, as we do it in most other Osmocom projects. Change-Id: Ic4f36e85823295c353789886af98eb3fe7eda039 --- M contrib/jenkins.sh 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/11/34311/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 543671c..1a1d3b5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -37,6 +37,8 @@ autoreconf --install --force ./configure --enable-sanitize --enable-werror --enable-lapd-examples $MAKE $PARALLEL_MAKE +$MAKE check \ + || cat-testlogs.sh $MAKE $PARALLEL_MAKE distcheck \ || cat-testlogs.sh $MAKE $PARALLEL_MAKE maintainer-clean -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34311?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ic4f36e85823295c353789886af98eb3fe7eda039 Gerrit-Change-Number: 34311 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in libosmo-netif[master]: stream: Add client-side (segmentation) support for IPA
by osmith 05 Sep '23

05 Sep '23
Attention is currently required from: arehbein, daniel, fixeria, pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33198?usp=email ) Change subject: stream: Add client-side (segmentation) support for IPA ...................................................................... Patch Set 21: (1 comment) Patchset: PS21: > Excerpt from current build failure: […] the actual error is further above in the log: ``` 1. testsuite.at:4: testing stream_test ... ./testsuite.at:8: $abs_top_builddir/tests/stream/stream_test --- expout 2023-09-04 17:53:46.409216560 +0000 +++ /obs/_temp/binpkgs/libosmo-netif/tests/testsuite.dir/at-groups/1/stdout 2023-09-04 17:53:46.637217558 +0000 @@ -169,21 +169,21 @@ {20.625031} [NA|OK] Server's send_last_third_srv(): Sending:[ Last third of IPAC_MSGT_ID_GET | IPAC_MSGT_PONG | IPAC_MSGT_PONG ] {20.625031} [NA|OK] Server's send_last_third_srv(): (msg dump: 01 01 00 01 fe 01 00 01 fe 01 ) -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [5-cli] Received message from stream (len = 3) -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): msg buff data: 04 01 01 -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): IPA payload: 04 01 01 -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): Type: IPAC_MSGT_ID_GET -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): (msg dump (including stripped headers): 00 03 fe 04 01 01 ) -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [6-cli] Received message from stream (len = 1) -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): msg buff data: 01 -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): IPA payload: 01 -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): Type: IPAC_MSGT_PONG -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): (msg dump (including stripped headers): 00 01 fe 01 ) -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [7-cli] Received message from stream (len = 1) -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): msg buff data: 01 -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): IPA payload: 01 -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): Type: IPAC_MSGT_PONG -{20.625033} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): (msg dump (including stripped headers): 00 01 fe 01 ) +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [5-cli] Received message from stream (len = 3) +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): msg buff data: 04 01 01 +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): IPA payload: 04 01 01 +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): Type: IPAC_MSGT_ID_GET +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): (msg dump (including stripped headers): 00 03 fe 04 01 01 ) +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [6-cli] Received message from stream (len = 1) +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): msg buff data: 01 +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): IPA payload: 01 +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): Type: IPAC_MSGT_PONG +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): (msg dump (including stripped headers): 00 01 fe 01 ) +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): [7-cli] Received message from stream (len = 1) +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): msg buff data: 01 +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): IPA payload: 01 +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): Type: IPAC_MSGT_PONG +{20.625576} [OK] Client's test_segm_ipa_stream_cli_cli_read_cb(): (msg dump (including stripped headers): 00 01 fe 01 ) ==================================Test test_segm_ipa_stream_cli complete======================================== Stream tests completed 1. testsuite.at:4: 1. stream_test (testsuite.at:4): FAILED (testsuite.at:8) ``` In addition to that, there is a bug in contrib/jenkins.sh: it does not run "make check" as it is doing in most other Osmocom projects. Otherwise the testsuite would fail there as well. -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33198?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I822abf52c6ae396c90b5c50228a0a39c848d3de6 Gerrit-Change-Number: 33198 Gerrit-PatchSet: 21 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: daniel <dwillmann(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Tue, 05 Sep 2023 09:13:52 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: arehbein <arehbein(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmocom-bb[master]: l1gprs/l1ctl: Decouple RTS.ind from DL_BLOCK.ind
by pespin 05 Sep '23

05 Sep '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/34310?usp=email ) Change subject: l1gprs/l1ctl: Decouple RTS.ind from DL_BLOCK.ind ...................................................................... l1gprs/l1ctl: Decouple RTS.ind from DL_BLOCK.ind Before this patch, the RTS:ind was crafted up in the stack when receiving the DL_BLOCK.ind. This created some problems since the internal low level state has to be updated in between signalling DL_BLOCK.ind and RTS.ind, as there's a fn-advnace of one block between those 2 signals (hence the timeslot allocation has to be applied at the time when the fn-advance is applied). This is actually not fixing the whole issue, since there's several timeslots and hence the following events will have the internal timeslot updated during the event in the middle, hence potentially causing problems in the remaining TS: DL_BLOCK.ind(FN=N, TS=1), RTS.ind(FN=N+4, TS=1), DL_BLOCK.ind(FN=N, TS=2) In any case, this decoupling already improves the situation and is step needed anyway towards fully fixing the problem (by, for instance, maintaining a timeslot state duplicated both for DL and Ul directions, since they drive based on differnet FN time (1 PDCH block). Change-Id: I1494e0aac7555f6e01b4b435b77140afc42c098e --- M include/l1ctl_proto.h M include/l1gprs.h M src/host/layer23/include/osmocom/bb/common/ms.h M src/host/layer23/include/osmocom/bb/modem/grr.h M src/host/layer23/src/common/l1ctl.c M src/host/layer23/src/modem/grr.c M src/host/layer23/src/modem/rlcmac.c M src/host/trxcon/src/trxcon_fsm.c M src/host/virt_phy/src/virt_prim_pdch.c M src/shared/l1gprs.c 10 files changed, 153 insertions(+), 12 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h index f0bc56d..8bf44cf 100644 --- a/include/l1ctl_proto.h +++ b/include/l1ctl_proto.h @@ -59,6 +59,7 @@ L1CTL_GPRS_DL_BLOCK_IND = 0x23, /* Extended (11-bit) RACH (see 3GPP TS 05.02, section 5.2.7) */ L1CTL_EXT_RACH_REQ = 0x24, + L1CTL_GPRS_RTS_IND = 0x25, }; enum ccch_mode { @@ -387,4 +388,11 @@ uint8_t data[0]; } __attribute__((packed)); +/* payload of L1CTL_GPRS_RTS_IND */ +struct l1ctl_gprs_rts_ind { + uint32_t fn; + uint8_t tn; + uint8_t usf; +} __attribute__((packed)); + #endif /* __L1CTL_PROTO_H__ */ diff --git a/include/l1gprs.h b/include/l1gprs.h index eb15726..57380d3 100644 --- a/include/l1gprs.h +++ b/include/l1gprs.h @@ -112,4 +112,5 @@ struct l1gprs_prim_ul_block_req *req, const struct msgb *msg); struct msgb *l1gprs_handle_dl_block_ind(struct l1gprs_state *gprs, - const struct l1gprs_prim_dl_block_ind *ind); + const struct l1gprs_prim_dl_block_ind *ind, uint8_t *usf); +struct msgb *l1gprs_handle_rts_ind(struct l1gprs_state *gprs, uint32_t fn, uint8_t tn, uint8_t usf); diff --git a/src/host/layer23/include/osmocom/bb/common/ms.h b/src/host/layer23/include/osmocom/bb/common/ms.h index 8d1ffc4..f08e977 100644 --- a/src/host/layer23/include/osmocom/bb/common/ms.h +++ b/src/host/layer23/include/osmocom/bb/common/ms.h @@ -43,6 +43,7 @@ struct osmol1_entity { int (*l1_traffic_ind)(struct osmocom_ms *ms, struct msgb *msg); int (*l1_gprs_dl_block_ind)(struct osmocom_ms *ms, struct msgb *msg); + int (*l1_gprs_rts_ind)(struct osmocom_ms *ms, struct msgb *msg); }; struct osmomncc_entity { diff --git a/src/host/layer23/include/osmocom/bb/modem/grr.h b/src/host/layer23/include/osmocom/bb/modem/grr.h index 3472a10..8235d59 100644 --- a/src/host/layer23/include/osmocom/bb/modem/grr.h +++ b/src/host/layer23/include/osmocom/bb/modem/grr.h @@ -25,6 +25,7 @@ GRR_EV_PDCH_DL_TBF_CFG_REQ, GRR_EV_PDCH_BLOCK_REQ, GRR_EV_PDCH_BLOCK_IND, + GRR_EV_PDCH_RTS_IND, }; extern struct osmo_fsm grr_fsm_def; diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c index 38510d8..e3a4015 100644 --- a/src/host/layer23/src/common/l1ctl.c +++ b/src/host/layer23/src/common/l1ctl.c @@ -986,6 +986,35 @@ return 0; } +/* Receive L1CTL_GPRS_RTS_IND */ +static int rx_l1_gprs_rts_ind(struct osmocom_ms *ms, struct msgb *msg) +{ + const struct l1ctl_gprs_rts_ind *ind = (void *)msg->l1h; + + if (msgb_l1len(msg) < sizeof(*ind)) { + LOGP(DL1C, LOGL_ERROR, + "Rx malformed GPRS RTS.ind (len=%u < %zu)\n", + msgb_l1len(msg), sizeof(*ind)); + return -EINVAL; + } + if (OSMO_UNLIKELY(ind->tn >= 8)) { + LOGP(DL1C, LOGL_ERROR, + "Rx malformed GPRS RTS.ind (tn=%u)\n", + ind->tn); + return -EINVAL; + } + + DEBUGP(DL1C, "Rx RTS.ind (fn=%u, tn=%u, usf=%u)\n", + ntohl(ind->fn), ind->tn, ind->usf); + + /* distribute or drop */ + if (ms->l1_entity.l1_gprs_rts_ind) + return ms->l1_entity.l1_gprs_rts_ind(ms, msg); + + msgb_free(msg); + return 0; +} + /* Transmit L1CTL_GPRS_UL_BLOCK_REQ */ int l1ctl_tx_gprs_ul_block_req(struct osmocom_ms *ms, uint32_t fn, uint8_t tn, const uint8_t *data, size_t data_len) @@ -1132,6 +1161,9 @@ case L1CTL_GPRS_DL_BLOCK_IND: rc = rx_l1_gprs_dl_block_ind(ms, msg); break; + case L1CTL_GPRS_RTS_IND: + rc = rx_l1_gprs_rts_ind(ms, msg); + break; default: LOGP(DL1C, LOGL_ERROR, "Unknown MSG: %u\n", hdr->msg_type); msgb_free(msg); diff --git a/src/host/layer23/src/modem/grr.c b/src/host/layer23/src/modem/grr.c index 7eec935..1f4a3d7 100644 --- a/src/host/layer23/src/modem/grr.c +++ b/src/host/layer23/src/modem/grr.c @@ -469,16 +469,15 @@ } }; osmo_gprs_rlcmac_prim_lower_up(prim); +} - /* Do not send RTS.ind if we got PTCCH/D */ - if (fn % 104 == 12) - return; +static void handle_pdch_rts_ind(struct osmocom_ms *ms, struct msgb *msg) +{ + const struct l1ctl_gprs_rts_ind *ind = (void *)msg->l1h; + const uint32_t fn = osmo_load32be(&ind->fn); + struct osmo_gprs_rlcmac_prim *prim; - /* Every fn % 13 == 12 we have either a PTCCH or an IDLE slot, thus - * every fn % 13 == 8 we add 5 frames, or 4 frames othrwise. The - * resulting value is first fn of the next block. */ - const uint32_t rts_fn = GSM_TDMA_FN_SUM(fn, (fn % 13 == 8) ? 5 : 4); - prim = osmo_gprs_rlcmac_prim_alloc_l1ctl_pdch_rts_ind(ind->hdr.tn, rts_fn, ind->usf); + prim = osmo_gprs_rlcmac_prim_alloc_l1ctl_pdch_rts_ind(ind->tn, fn, ind->usf); osmo_gprs_rlcmac_prim_lower_up(prim); } @@ -693,6 +692,9 @@ case GRR_EV_PDCH_BLOCK_IND: handle_pdch_block_ind(ms, (struct msgb *)data); break; + case GRR_EV_PDCH_RTS_IND: + handle_pdch_rts_ind(ms, (struct msgb *)data); + break; case GRR_EV_PDCH_RELEASE_REQ: modem_sync_to_cell(ms); osmo_fsm_inst_state_chg(fi, GRR_ST_PACKET_NOT_READY, 0, 0); @@ -729,6 +731,7 @@ | S(GRR_EV_PDCH_DL_TBF_CFG_REQ) | S(GRR_EV_PDCH_BLOCK_REQ) | S(GRR_EV_PDCH_BLOCK_IND) + | S(GRR_EV_PDCH_RTS_IND) | S(GRR_EV_PDCH_RELEASE_REQ), .action = &grr_st_packet_transfer_action, .onenter = &grr_st_packet_transfer_onenter, @@ -747,6 +750,7 @@ OSMO_VALUE_STRING(GRR_EV_PDCH_DL_TBF_CFG_REQ), OSMO_VALUE_STRING(GRR_EV_PDCH_BLOCK_REQ), OSMO_VALUE_STRING(GRR_EV_PDCH_BLOCK_IND), + OSMO_VALUE_STRING(GRR_EV_PDCH_RTS_IND), { 0, NULL } }; diff --git a/src/host/layer23/src/modem/rlcmac.c b/src/host/layer23/src/modem/rlcmac.c index 0f98e79..5037d99 100644 --- a/src/host/layer23/src/modem/rlcmac.c +++ b/src/host/layer23/src/modem/rlcmac.c @@ -167,6 +167,11 @@ return osmo_fsm_inst_dispatch(ms->grr_fi, GRR_EV_PDCH_BLOCK_IND, msg); } +static int l1ctl_rts_cb(struct osmocom_ms *ms, struct msgb *msg) +{ + return osmo_fsm_inst_dispatch(ms->grr_fi, GRR_EV_PDCH_RTS_IND, msg); +} + int modem_rlcmac_init(struct osmocom_ms *ms) { int rc; @@ -182,6 +187,7 @@ osmo_gprs_rlcmac_prim_set_down_cb(modem_rlcmac_prim_down_cb, ms); ms->l1_entity.l1_gprs_dl_block_ind = &l1ctl_dl_block_cb; + ms->l1_entity.l1_gprs_rts_ind = &l1ctl_rts_cb; return rc; } diff --git a/src/host/trxcon/src/trxcon_fsm.c b/src/host/trxcon/src/trxcon_fsm.c index e7c60f2..29caeef 100644 --- a/src/host/trxcon/src/trxcon_fsm.c +++ b/src/host/trxcon/src/trxcon_fsm.c @@ -607,6 +607,7 @@ const struct trxcon_param_rx_data_ind *ind = data; struct l1gprs_prim_dl_block_ind block_ind; struct msgb *msg; + uint8_t usf = 0xff; block_ind = (struct l1gprs_prim_dl_block_ind) { .hdr = { @@ -627,7 +628,14 @@ else block_ind.meas.ber10k = 10000 * ind->n_errors / ind->n_bits_total; - msg = l1gprs_handle_dl_block_ind(trxcon->gprs, &block_ind); + msg = l1gprs_handle_dl_block_ind(trxcon->gprs, &block_ind, &usf); + if (msg != NULL) + trxcon_l1ctl_send(trxcon, msg); + /* Every fn % 13 == 12 we have either a PTCCH or an IDLE slot, thus + * every fn % 13 == 8 we add 5 frames, or 4 frames othrwise. The + * resulting value is first fn of the next block. */ + const uint32_t rts_fn = GSM_TDMA_FN_SUM(ind->frame_nr, (ind->frame_nr % 13 == 8) ? 5 : 4); + msg = l1gprs_handle_rts_ind(trxcon->gprs, rts_fn, ind->chan_nr & 0x07, usf); if (msg != NULL) trxcon_l1ctl_send(trxcon, msg); break; diff --git a/src/host/virt_phy/src/virt_prim_pdch.c b/src/host/virt_phy/src/virt_prim_pdch.c index 65551d3..6825ced 100644 --- a/src/host/virt_phy/src/virt_prim_pdch.c +++ b/src/host/virt_phy/src/virt_prim_pdch.c @@ -22,6 +22,7 @@ #include <osmocom/core/utils.h> #include <osmocom/gsm/gsm_utils.h> #include <osmocom/gsm/protocol/gsm_08_58.h> +#include <osmocom/gsm/gsm0502.h> #include <osmocom/bb/virtphy/l1ctl_sap.h> #include <osmocom/bb/virtphy/virt_l1_sched.h> @@ -75,6 +76,7 @@ { struct l1gprs_prim_dl_block_ind ind; struct msgb *nmsg; + uint8_t usf = 0xff; if (ms->gprs == NULL) return; @@ -93,7 +95,14 @@ .data_len = msgb_length(msg), }; - nmsg = l1gprs_handle_dl_block_ind(ms->gprs, &ind); + nmsg = l1gprs_handle_dl_block_ind(ms->gprs, &ind, &usf); if (nmsg != NULL) l1ctl_sap_tx_to_l23_inst(ms, nmsg); + /* Every fn % 13 == 12 we have either a PTCCH or an IDLE slot, thus + * every fn % 13 == 8 we add 5 frames, or 4 frames othrwise. The + * resulting value is first fn of the next block. */ + const uint32_t rts_fn = GSM_TDMA_FN_SUM(fn, (fn % 13 == 8) ? 5 : 4); + nmsg = l1gprs_handle_rts_ind(ms->gprs, rts_fn, tn, usf); + if (msg != NULL) + l1ctl_sap_tx_to_l23_inst(ms, nmsg); } diff --git a/src/shared/l1gprs.c b/src/shared/l1gprs.c index 61b6eea..bfbda59 100644 --- a/src/shared/l1gprs.c +++ b/src/shared/l1gprs.c @@ -674,7 +674,8 @@ (((ind)->hdr.fn % 104) == 12) struct msgb *l1gprs_handle_dl_block_ind(struct l1gprs_state *gprs, - const struct l1gprs_prim_dl_block_ind *ind) + const struct l1gprs_prim_dl_block_ind *ind, + uint8_t *usf) { const struct l1gprs_pdch *pdch = NULL; struct l1ctl_gprs_dl_block_ind *l1bi; @@ -743,6 +744,7 @@ case OSMO_GPRS_CS3: case OSMO_GPRS_CS4: l1bi->usf = ind->data[0] & 0x07; + *usf = l1bi->usf; /* Determine whether to include the payload or not */ if (l1gprs_pdch_filter_dl_block(pdch, ind->data)) memcpy(msgb_put(msg, ind->data_len), ind->data, ind->data_len); @@ -758,3 +760,46 @@ return msg; } + +struct msgb *l1gprs_handle_rts_ind(struct l1gprs_state *gprs, uint32_t fn, uint8_t tn, uint8_t usf) +{ + const struct l1gprs_pdch *pdch = NULL; + struct l1ctl_gprs_rts_ind *l1bi; + struct msgb *msg; + + pdch = &gprs->pdch[tn]; + + LOGP_PDCH(pdch, LOGL_DEBUG, + "Rx RTS.ind (%s, fn=%u, usf=%u)\n", + ((fn % 104) == 12) ? "PTCCH" : "PDTCH", + fn, usf); + + l1gprs_check_pending_tbfs(gprs, fn); + + if (pdch->ul_tbf_count + pdch->dl_tbf_count == 0) { + if (pdch->pending_ul_tbf_count + pdch->pending_dl_tbf_count > 0) + LOGP_PDCH(pdch, LOGL_DEBUG, + "Rx RTS.ind (fn=%u, usf=%u), but this PDCH has no active TBFs yet\n", + fn, usf); + else + LOGP_PDCH(pdch, LOGL_ERROR, + "Rx RTS.ind (fn=%u, usf=%u), but this PDCH has no configured TBFs\n", + fn, usf); + return NULL; + } + + msg = l1gprs_l1ctl_msgb_alloc(L1CTL_GPRS_RTS_IND); + if (OSMO_UNLIKELY(msg == NULL)) { + LOGP_GPRS(gprs, LOGL_ERROR, "l1gprs_l1ctl_msgb_alloc() failed\n"); + return NULL; + } + + l1bi = (void *)msgb_put(msg, sizeof(*l1bi)); + *l1bi = (struct l1ctl_gprs_rts_ind) { + .fn = htonl(fn), + .tn = tn, + .usf = usf, + }; + + return msg; +} -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34310?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: I1494e0aac7555f6e01b4b435b77140afc42c098e Gerrit-Change-Number: 34310 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • ...
  • 195
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.