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

December 2022

  • 1 participants
  • 1979 discussions
Change in osmo-pcu[master]: Pass gprs_rlcmac_pdch to create_dl_acked_block()
by pespin 16 Dec '22

16 Dec '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30623 ) Change subject: Pass gprs_rlcmac_pdch to create_dl_acked_block() ...................................................................... Pass gprs_rlcmac_pdch to create_dl_acked_block() This allows having full TS information, not only ts_no, which will be needed later on followup patches. Change-Id: I1efccb32c5afa4fe62233bf114ea95b6fbbe1a06 --- M src/gprs_rlcmac_sched.cpp M src/tbf_dl.cpp M src/tbf_dl.h M tests/tbf/TbfTest.cpp 4 files changed, 17 insertions(+), 15 deletions(-) Approvals: pespin: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 87a3733..0a72e3b 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -278,7 +278,6 @@ struct msgb *msg = NULL; struct gprs_rlcmac_dl_tbf *tbf, *prio_tbf = NULL; enum tbf_dl_prio prio, max_prio = DL_PRIO_NONE; - uint8_t ts = pdch->ts_no; uint8_t i, tfi, prio_tfi; int age; @@ -334,7 +333,7 @@ /* next TBF to handle resource is the next one */ pdch->next_dl_tfi = (prio_tfi + 1) & 31; /* generate DL data block */ - msg = prio_tbf->create_dl_acked_block(fn, ts, req_mcs_kind); + msg = prio_tbf->create_dl_acked_block(fn, pdch, req_mcs_kind); *is_egprs = prio_tbf->is_egprs_enabled(); } diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 16dc47b..9214aae 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -391,7 +391,7 @@ * Create DL data block * The messages are fragmented and forwarded as data blocks. */ -struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(uint32_t fn, uint8_t ts, enum mcs_kind req_mcs_kind) +struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(uint32_t fn, const struct gprs_rlcmac_pdch *pdch, enum mcs_kind req_mcs_kind) { int bsn, bsn2 = -1; bool may_combine; @@ -406,7 +406,7 @@ if (may_combine) bsn2 = take_next_bsn(fn, bsn, req_mcs_kind, &may_combine); - return create_dl_acked_block(fn, ts, bsn, bsn2); + return create_dl_acked_block(fn, pdch, bsn, bsn2); } /* old_tbf (UL TBF or DL TBF) will send a Pkt Dl Ass on PACCH to assign tbf. @@ -621,7 +621,7 @@ } struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block( - const uint32_t fn, const uint8_t ts, + const uint32_t fn, const struct gprs_rlcmac_pdch *pdch, int index, int index2) { uint8_t *msg_data; @@ -803,12 +803,12 @@ POLL_ACK_AFTER_FRAMES); } - rc = check_polling(fn, ts, &new_poll_fn, &rrbp); + rc = check_polling(fn, pdch->ts_no, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, ts, PDCH_ULC_POLL_DL_ACK); + set_polling(new_poll_fn, pdch->ts_no, PDCH_ULC_POLL_DL_ACK); LOGPTBFDL(this, LOGL_DEBUG, "Scheduled DL Acknowledgement polling on PACCH (FN=%d, TS=%d)\n", - new_poll_fn, ts); + new_poll_fn, pdch->ts_no); m_tx_counter = 0; /* start timer whenever we send the final block */ @@ -828,7 +828,7 @@ LOGPTBFDL(this, LOGL_INFO, "Scheduled Ack/Nack polling on FN=%d, TS=%d\n", - new_poll_fn, ts); + new_poll_fn, pdch->ts_no); } } diff --git a/src/tbf_dl.h b/src/tbf_dl.h index 2fc4f5f..4fdfbed 100644 --- a/src/tbf_dl.h +++ b/src/tbf_dl.h @@ -48,7 +48,8 @@ gprs_rlc_window *window(); int rcvd_dl_ack(bool final_ack, unsigned first_bsn, struct bitvec *rbb); - struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts, enum mcs_kind req_mcs_kind = EGPRS); + struct msgb *create_dl_acked_block(uint32_t fn, const gprs_rlcmac_pdch *pdch, + enum mcs_kind req_mcs_kind = EGPRS); void request_dl_ack(); bool need_poll_for_dl_ack_nack() const; @@ -100,8 +101,8 @@ bool *may_combine); bool restart_bsn_cycle(); int create_new_bsn(const uint32_t fn, enum CodingScheme cs); - struct msgb *create_dl_acked_block(const uint32_t fn, const uint8_t ts, - int index, int index2 = -1); + struct msgb *create_dl_acked_block(const uint32_t fn, const struct gprs_rlcmac_pdch *pdch, + int index, int index2 = -1); int update_window(unsigned first_bsn, const struct bitvec *rbb); int rcvd_dl_final_ack(); bool dl_window_stalled() const; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index ba357e3..6d57843 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -535,6 +535,7 @@ { the_pcu = prepare_pcu(); struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu, 0); + struct gprs_rlcmac_pdch *pdch; uint8_t ts_no = 4; uint8_t ms_class = 45; int rc = 0; @@ -554,6 +555,7 @@ fprintf(stderr, "=== start %s ===\n", __func__); setup_bts(bts, ts_no); + pdch = &bts->trx[0].pdch[ts_no]; /* keep the MS object 10 seconds */ OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2030, 10, OSMO_TDEF_S) == 0); @@ -612,7 +614,7 @@ }; while (ms_dl_tbf(ms)->have_data()) { - msg = ms_dl_tbf(ms)->create_dl_acked_block(fn += 4, ts_no); + msg = ms_dl_tbf(ms)->create_dl_acked_block(fn += 4, pdch); fprintf(stderr, "MSG = %s\n", msgb_hexdump(msg)); if (!msgb_eq_data_print(msg, exp[expected_data - 1], GSM_MACBLOCK_LEN)) fprintf(stderr, "%s failed at %u\n", __func__, expected_data); @@ -2865,7 +2867,7 @@ } while(0) #define MAKE_ACKED(m, tbf, fn, cs, check_unacked) do { \ - m = tbf->create_dl_acked_block(fn, tbf->control_ts->ts_no); \ + m = tbf->create_dl_acked_block(fn, tbf->control_ts); \ OSMO_ASSERT(m); \ if (check_unacked) \ CHECK_UNACKED(tbf, cs, 0); \ @@ -2940,7 +2942,7 @@ NACK(dl_tbf, 0); - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts->ts_no); + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); egprs2 = (struct gprs_rlc_dl_header_egprs_2 *) msg->data; /* Table 10.4.8a.3.1 of 44.060 */ 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30623 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I1efccb32c5afa4fe62233bf114ea95b6fbbe1a06 Gerrit-Change-Number: 30623 Gerrit-PatchSet: 2 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
Change in osmo-pcu[master]: Pass gprc_rlcmac_pdch to tbf_check_polling
by pespin 16 Dec '22

16 Dec '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30624 ) Change subject: Pass gprc_rlcmac_pdch to tbf_check_polling ...................................................................... Pass gprc_rlcmac_pdch to tbf_check_polling Change-Id: I1c7140b35b7c93d3df4156841e908d3b44d7336d --- M src/nacc_fsm.c M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_dl_ass_fsm.c M src/tbf_ul_ack_fsm.c M src/tbf_ul_ass_fsm.c 7 files changed, 28 insertions(+), 32 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/src/nacc_fsm.c b/src/nacc_fsm.c index 21af485..cc75238 100644 --- a/src/nacc_fsm.c +++ b/src/nacc_fsm.c @@ -168,7 +168,7 @@ struct GprsMs *ms = tbf_ms(tbf); unsigned int rrbp; - rc = tbf_check_polling(tbf, data->fn, data->pdch->ts_no, new_poll_fn, &rrbp); + rc = tbf_check_polling(tbf, data->pdch, data->fn, new_poll_fn, &rrbp); if (rc < 0) { LOGP(DTBF, LOGL_ERROR, "Failed registering poll for Pkt Cell Chg Continue (%d)\n", rc); return NULL; diff --git a/src/tbf.cpp b/src/tbf.cpp index 0af738d..70e3e6c 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -458,27 +458,6 @@ osmo_timer_schedule(&Tarr[t], sec, microsec); } -int gprs_rlcmac_tbf::check_polling(uint32_t fn, uint8_t ts, - uint32_t *poll_fn_, unsigned int *rrbp_) const -{ - int rc; - if (!tbf_is_control_ts(this, &this->trx->pdch[ts])) { - LOGPTBF(this, LOGL_DEBUG, "Polling cannot be " - "scheduled in this TS %d (control TS %s)\n", - ts, pdch_name(control_ts)); - return -EINVAL; - } - - if ((rc = pdch_ulc_get_next_free_rrbp_fn(trx->pdch[ts].ulc, fn, poll_fn_, rrbp_)) < 0) { - LOGPTBF(this, LOGL_NOTICE, - "(bts=%u,trx=%u,ts=%u) FN=%u No suitable free RRBP offset found!\n", - trx->bts->nr, trx->trx_no, ts, fn); - return rc; - } - - return 0; -} - void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason reason) { /* schedule polling */ @@ -839,9 +818,29 @@ return tbf->is_egprs_enabled(); } -int tbf_check_polling(const struct gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp) +int tbf_check_polling(const struct gprs_rlcmac_tbf *tbf, const struct gprs_rlcmac_pdch *pdch, + uint32_t fn, uint32_t *poll_fn, unsigned int *rrbp) { - return tbf->check_polling(fn, ts, poll_fn, rrbp); + int rc; + OSMO_ASSERT(pdch); + + if (!tbf_is_control_ts(tbf, pdch)) { + char buf[128]; + LOGPTBF(tbf, LOGL_DEBUG, "Polling cannot be " + "scheduled in this TS %s (control TS %s)\n", + pdch_name(pdch), + tbf->control_ts ? pdch_name_buf(tbf->control_ts, buf, sizeof(buf)) : "none"); + return -EINVAL; + } + + if ((rc = pdch_ulc_get_next_free_rrbp_fn(pdch->ulc, fn, poll_fn, rrbp)) < 0) { + LOGPTBF(tbf, LOGL_NOTICE, + "FN=%u No suitable free RRBP offset found on %s!\n", + fn, pdch_name(pdch)); + return rc; + } + + return 0; } void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason t) diff --git a/src/tbf.h b/src/tbf.h index a02b8e2..1d5d4f1 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -139,7 +139,7 @@ uint8_t tbf_tfi(const struct gprs_rlcmac_tbf *tbf); bool tbf_is_egprs_enabled(const struct gprs_rlcmac_tbf *tbf); void tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); -int tbf_check_polling(const struct gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp); +int tbf_check_polling(const struct gprs_rlcmac_tbf *tbf, const struct gprs_rlcmac_pdch *pdch, uint32_t fn, uint32_t *poll_fn, unsigned int *rrbp); void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason t); void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason); void tbf_update_state_fsm_name(struct gprs_rlcmac_tbf *tbf); @@ -188,9 +188,6 @@ void t_stop(enum tbf_timers t, const char *reason); void t_start(enum tbf_timers t, int T, const char *reason, bool force, const char *file, unsigned line); - - int check_polling(uint32_t fn, uint8_t ts, - uint32_t *poll_fn, unsigned int *rrbp) const; void set_polling(uint32_t poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason reason); void poll_timeout(struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 9214aae..25aea48 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -803,7 +803,7 @@ POLL_ACK_AFTER_FRAMES); } - rc = check_polling(fn, pdch->ts_no, &new_poll_fn, &rrbp); + rc = tbf_check_polling(this, pdch, fn, &new_poll_fn, &rrbp); if (rc >= 0) { set_polling(new_poll_fn, pdch->ts_no, PDCH_ULC_POLL_DL_ACK); LOGPTBFDL(this, LOGL_DEBUG, diff --git a/src/tbf_dl_ass_fsm.c b/src/tbf_dl_ass_fsm.c index 207e4d3..6a1bc92 100644 --- a/src/tbf_dl_ass_fsm.c +++ b/src/tbf_dl_ass_fsm.c @@ -61,7 +61,7 @@ /* We only use this function in control TS (PACCH) so that MS can always answer the poll */ OSMO_ASSERT(tbf_is_control_ts(ctx->tbf, d->pdch)); - rc = tbf_check_polling(ctx->tbf, d->fn, d->pdch->ts_no, &new_poll_fn, &rrbp); + rc = tbf_check_polling(ctx->tbf, d->pdch, d->fn, &new_poll_fn, &rrbp); if (rc < 0) return NULL; diff --git a/src/tbf_ul_ack_fsm.c b/src/tbf_ul_ack_fsm.c index 9501190..a188b08 100644 --- a/src/tbf_ul_ack_fsm.c +++ b/src/tbf_ul_ack_fsm.c @@ -59,7 +59,7 @@ struct GprsMs *ms = tbf_ms(ul_tbf_as_tbf(tbf)); if (final) { - rc = tbf_check_polling(ul_tbf_as_tbf(tbf), d->fn, d->pdch->ts_no, &new_poll_fn, &rrbp); + rc = tbf_check_polling(ul_tbf_as_tbf(tbf), d->pdch, d->fn, &new_poll_fn, &rrbp); if (rc < 0) return NULL; } diff --git a/src/tbf_ul_ass_fsm.c b/src/tbf_ul_ass_fsm.c index d910095..8f2b70c 100644 --- a/src/tbf_ul_ass_fsm.c +++ b/src/tbf_ul_ass_fsm.c @@ -83,7 +83,7 @@ unsigned int rrbp; uint32_t new_poll_fn; - rc = tbf_check_polling(ctx->tbf, d->fn, d->pdch->ts_no, &new_poll_fn, &rrbp); + rc = tbf_check_polling(ctx->tbf, d->pdch, d->fn, &new_poll_fn, &rrbp); if (rc < 0) return NULL; 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30624 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I1c7140b35b7c93d3df4156841e908d3b44d7336d Gerrit-Change-Number: 30624 Gerrit-PatchSet: 2 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
Change in osmo-pcu[master]: Pass gprc_rlcmac_pdch to tbf_set_polling
by pespin 16 Dec '22

16 Dec '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30625 ) Change subject: Pass gprc_rlcmac_pdch to tbf_set_polling ...................................................................... Pass gprc_rlcmac_pdch to tbf_set_polling Change-Id: I5ecc57c72e7f60e31e64e76e724d7a5a95968c40 --- M src/nacc_fsm.c M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_dl_ass_fsm.c M src/tbf_ul_ack_fsm.c M src/tbf_ul_ass_fsm.c 7 files changed, 11 insertions(+), 17 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/src/nacc_fsm.c b/src/nacc_fsm.c index cc75238..0719d2c 100644 --- a/src/nacc_fsm.c +++ b/src/nacc_fsm.c @@ -202,7 +202,7 @@ LOGP(DNACC, LOGL_DEBUG, "------------------------- TX : Packet Cell Change Continue -------------------------\n"); rate_ctr_inc(rate_ctr_group_get_ctr(bts_rate_counters(ms->bts), CTR_PKT_CELL_CHG_CONTINUE)); talloc_free(mac_control_block); - tbf_set_polling(tbf, *new_poll_fn, data->pdch->ts_no, PDCH_ULC_POLL_CELL_CHG_CONTINUE); + tbf_set_polling(tbf, data->pdch, *new_poll_fn, PDCH_ULC_POLL_CELL_CHG_CONTINUE); LOGPTBF(tbf, LOGL_DEBUG, "Scheduled 'Packet Cell Change Continue' polling on PACCH (FN=%d, TS=%d)\n", *new_poll_fn, data->pdch->ts_no); diff --git a/src/tbf.cpp b/src/tbf.cpp index 70e3e6c..9e03089 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -458,14 +458,6 @@ osmo_timer_schedule(&Tarr[t], sec, microsec); } -void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason reason) -{ - /* schedule polling */ - if (pdch_ulc_reserve_tbf_poll(trx->pdch[ts].ulc, new_poll_fn, this, reason) < 0) - LOGPTBF(this, LOGL_ERROR, "Failed scheduling poll on PACCH (FN=%d, TS=%d)\n", - new_poll_fn, ts); -} - void gprs_rlcmac_tbf::poll_timeout(struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason) { gprs_rlcmac_ul_tbf *ul_tbf; @@ -843,9 +835,12 @@ return 0; } -void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason t) +void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, const struct gprs_rlcmac_pdch *pdch, uint32_t new_poll_fn, enum pdch_ulc_tbf_poll_reason t) { - return tbf->set_polling(new_poll_fn, ts, t); + /* schedule polling */ + if (pdch_ulc_reserve_tbf_poll(pdch->ulc, new_poll_fn, tbf, t) < 0) + LOGPTBF(tbf, LOGL_ERROR, "FN=%u Failed scheduling poll on PACCH %s\n", + new_poll_fn, pdch_name(pdch)); } void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason) diff --git a/src/tbf.h b/src/tbf.h index 1d5d4f1..b033590 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -140,7 +140,7 @@ bool tbf_is_egprs_enabled(const struct gprs_rlcmac_tbf *tbf); void tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); int tbf_check_polling(const struct gprs_rlcmac_tbf *tbf, const struct gprs_rlcmac_pdch *pdch, uint32_t fn, uint32_t *poll_fn, unsigned int *rrbp); -void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason t); +void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, const struct gprs_rlcmac_pdch *pdch, uint32_t new_poll_fn, enum pdch_ulc_tbf_poll_reason t); void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason); void tbf_update_state_fsm_name(struct gprs_rlcmac_tbf *tbf); const char* tbf_rlcmac_diag(const struct gprs_rlcmac_tbf *tbf); @@ -188,7 +188,6 @@ void t_stop(enum tbf_timers t, const char *reason); void t_start(enum tbf_timers t, int T, const char *reason, bool force, const char *file, unsigned line); - void set_polling(uint32_t poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason reason); void poll_timeout(struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason); /** tlli handling */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 25aea48..f799cb0 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -805,7 +805,7 @@ rc = tbf_check_polling(this, pdch, fn, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, pdch->ts_no, PDCH_ULC_POLL_DL_ACK); + tbf_set_polling(this, pdch, new_poll_fn, PDCH_ULC_POLL_DL_ACK); LOGPTBFDL(this, LOGL_DEBUG, "Scheduled DL Acknowledgement polling on PACCH (FN=%d, TS=%d)\n", new_poll_fn, pdch->ts_no); diff --git a/src/tbf_dl_ass_fsm.c b/src/tbf_dl_ass_fsm.c index 6a1bc92..dec7042 100644 --- a/src/tbf_dl_ass_fsm.c +++ b/src/tbf_dl_ass_fsm.c @@ -113,7 +113,7 @@ LOGP(DTBF, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); bts_do_rate_ctr_inc(ms->bts, CTR_PKT_DL_ASSIGNMENT); - tbf_set_polling(ctx->tbf, new_poll_fn, d->pdch->ts_no, PDCH_ULC_POLL_DL_ASS); + tbf_set_polling(ctx->tbf, d->pdch, new_poll_fn, PDCH_ULC_POLL_DL_ASS); LOGPTBF(ctx->tbf, LOGL_INFO, "Scheduled DL Assignment polling on PACCH (FN=%d, TS=%d)\n", new_poll_fn, d->pdch->ts_no); diff --git a/src/tbf_ul_ack_fsm.c b/src/tbf_ul_ack_fsm.c index a188b08..e2299d4 100644 --- a/src/tbf_ul_ack_fsm.c +++ b/src/tbf_ul_ack_fsm.c @@ -93,7 +93,7 @@ osmo_fsm_inst_dispatch(tbf_state_fi(ul_tbf_as_tbf(ctx->tbf)), TBF_EV_CONTENTION_RESOLUTION_MS_SUCCESS, NULL); if (final) { - tbf_set_polling(ul_tbf_as_tbf(tbf), new_poll_fn, d->pdch->ts_no, PDCH_ULC_POLL_UL_ACK); + tbf_set_polling(ul_tbf_as_tbf(tbf), d->pdch, new_poll_fn, PDCH_ULC_POLL_UL_ACK); LOGPTBFUL(tbf, LOGL_DEBUG, "Scheduled UL Acknowledgement polling on PACCH (FN=%d, TS=%d)\n", new_poll_fn, d->pdch->ts_no); diff --git a/src/tbf_ul_ass_fsm.c b/src/tbf_ul_ass_fsm.c index 8f2b70c..e15f21c 100644 --- a/src/tbf_ul_ass_fsm.c +++ b/src/tbf_ul_ass_fsm.c @@ -128,7 +128,7 @@ LOGP(DTBF, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); bts_do_rate_ctr_inc(ms->bts, CTR_PKT_UL_ASSIGNMENT); - tbf_set_polling(ctx->tbf, new_poll_fn, d->pdch->ts_no, PDCH_ULC_POLL_UL_ASS); + tbf_set_polling(ctx->tbf, d->pdch, new_poll_fn, PDCH_ULC_POLL_UL_ASS); LOGPTBF(ctx->tbf, LOGL_INFO, "Scheduled UL Assignment polling on PACCH (FN=%d, TS=%d)\n", new_poll_fn, d->pdch->ts_no); 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30625 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I5ecc57c72e7f60e31e64e76e724d7a5a95968c40 Gerrit-Change-Number: 30625 Gerrit-PatchSet: 2 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
Change in osmo-pcu[master]: pdch: Introduce APIs to print PDCH name
by pespin 16 Dec '22

16 Dec '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30619 ) Change subject: pdch: Introduce APIs to print PDCH name ...................................................................... pdch: Introduce APIs to print PDCH name This will allow printing PDCH with same formatting outside of LOGPDCH. Change-Id: If18cb4a48237751e0dddede6793191b36dfe386d --- M src/pdch.cpp M src/pdch.h 2 files changed, 17 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/pdch.cpp b/src/pdch.cpp index 5a683ff..c7d92c1 100644 --- a/src/pdch.cpp +++ b/src/pdch.cpp @@ -1336,3 +1336,17 @@ pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == NO_FREE_TFI || find_free_usf(pdch->assigned_usf()) < 0; } + +const char *pdch_name(const struct gprs_rlcmac_pdch *pdch) +{ + static char _pdch_name_buf[128]; + return pdch_name_buf(pdch, _pdch_name_buf, sizeof(_pdch_name_buf)); +} + +char *pdch_name_buf(const struct gprs_rlcmac_pdch *pdch, char *buf, size_t buf_size) +{ + struct osmo_strbuf sb = { .buf = buf, .len = buf_size }; + OSMO_STRBUF_PRINTF(sb, "PDCH(bts=%" PRIu8 ",trx=%" PRIu8 ",ts=%" PRIu8 ")", + pdch->trx->bts->nr, pdch->trx->trx_no, pdch->ts_no); + return buf; +} diff --git a/src/pdch.h b/src/pdch.h index cf4ac4e..2ca3721 100644 --- a/src/pdch.h +++ b/src/pdch.h @@ -191,11 +191,11 @@ void pdch_disable(struct gprs_rlcmac_pdch *pdch); bool pdch_is_enabled(const struct gprs_rlcmac_pdch *pdch); bool pdch_is_full(const struct gprs_rlcmac_pdch *pdch); +const char *pdch_name(const struct gprs_rlcmac_pdch *pdch); +char *pdch_name_buf(const struct gprs_rlcmac_pdch *pdch, char *buf, size_t buf_size); #ifdef __cplusplus } #endif #define LOGPDCH(pdch, category, level, fmt, args...) \ - LOGP(category, level, "PDCH(bts=%" PRIu8 ",trx=%" PRIu8 ",ts=%" PRIu8 ") " fmt, \ - (pdch)->trx->bts->nr, (pdch)->trx->trx_no, (pdch)->ts_no, \ - ## args) + LOGP(category, level, "%s " fmt, pdch_name(pdch), ## args) -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30619 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: If18cb4a48237751e0dddede6793191b36dfe386d Gerrit-Change-Number: 30619 Gerrit-PatchSet: 2 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: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-pcu[master]: Rename gprs_rlcmac_ts_alloc.cpp -> alloc_algo.cpp & create own .h file
by pespin 16 Dec '22

16 Dec '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30608 ) Change subject: Rename gprs_rlcmac_ts_alloc.cpp -> alloc_algo.cpp & create own .h file ...................................................................... Rename gprs_rlcmac_ts_alloc.cpp -> alloc_algo.cpp & create own .h file First commit towards trying to have alloc algorithm as isolated as possible from others parts of the code trying to avoid state changes on data structures. Change name also because the alloc_algo not only allocated TS, but TFIs and USFs. Change-Id: I33a6c178c64a769f05d3880a69c38acb154afa62 --- M debian/copyright M src/Makefile.am R src/alloc_algo.cpp A src/alloc_algo.h M src/gprs_bssgp_pcu.c M src/gprs_rlcmac.h M src/pcu_main.cpp M src/pcu_vty.c M tests/alloc/AllocTest.cpp M tests/app_info/AppInfoTest.cpp M tests/edge/EdgeTest.cpp M tests/emu/pcu_emu.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 14 files changed, 58 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/debian/copyright b/debian/copyright index c714f1f..31b06fa 100644 --- a/debian/copyright +++ b/debian/copyright @@ -46,7 +46,7 @@ src/encoding.cpp src/encoding.h src/gprs_rlcmac.cpp - src/gprs_rlcmac_ts_alloc.cpp + src/ts_alloc.cpp Copyright: 2012 Ivan Klyuchnikov 2012 Andreas Eversberg <jolly(a)eversberg.eu> 2013 by Holger Hans Peter Freyther @@ -56,9 +56,11 @@ Files: src/gprs_rlcmac.h src/gprs_bssgp_pcu.cpp src/gprs_bssgp_pcu.h + src/ts_alloc.h src/bts.h Copyright: 2012 Ivan Klyuchnikov 2013 by Holger Hans Peter Freyther + 2022 by by Sysmocom s.f.m.c. GmbH License: GPL-2.0+ Files: src/rlc.h diff --git a/src/Makefile.am b/src/Makefile.am index e7e94e0..e020ffa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,6 +39,7 @@ noinst_LTLIBRARIES = libgprs.la libgprs_la_SOURCES = \ + alloc_algo.cpp \ gprs_debug.c \ csn1.c \ csn1_dec.c \ @@ -49,7 +50,6 @@ gprs_rlcmac.cpp \ gprs_rlcmac_sched.cpp \ gprs_rlcmac_meas.cpp \ - gprs_rlcmac_ts_alloc.cpp \ gprs_ms.c \ gprs_ms_storage.cpp \ gprs_pcu.c \ @@ -89,6 +89,7 @@ noinst_PROGRAMS = noinst_HEADERS = \ + alloc_algo.h \ gprs_debug.h \ csn1.h \ gsm_rlcmac.h \ diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/alloc_algo.cpp similarity index 99% rename from src/gprs_rlcmac_ts_alloc.cpp rename to src/alloc_algo.cpp index 704b696..047bae2 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/alloc_algo.cpp @@ -1,8 +1,9 @@ -/* gprs_rlcmac.cpp +/* alloc_algo.cpp * * Copyright (C) 2012 Ivan Klyuchnikov * Copyright (C) 2012 Andreas Eversberg <jolly(a)eversberg.eu> * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2022 by sysmocom - s.m.f.c. GmbH <info(a)sysmocom.de> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -29,6 +30,7 @@ extern "C" { #include "mslot_class.h" +#include "alloc_algo.h" #include <osmocom/core/linuxlist.h> #include <osmocom/core/logging.h> #include <osmocom/core/utils.h> diff --git a/src/alloc_algo.h b/src/alloc_algo.h new file mode 100644 index 0000000..a7c370e --- /dev/null +++ b/src/alloc_algo.h @@ -0,0 +1,40 @@ +/* alloc_algo.h + * + * Copyright (C) 2022 by sysmocom - s.m.f.c. GmbH <info(a)sysmocom.de> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#pragma once + +#include <stdbool.h> +#include <stdint.h> + +struct gprs_rlcmac_bts; +struct gprs_rlcmac_tbf; + +#ifdef __cplusplus +extern "C" { +#endif + +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); + +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); + +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); +int gprs_alloc_max_dl_slots_per_ms(const struct gprs_rlcmac_bts *bts, uint8_t ms_class); + +#ifdef __cplusplus +} +#endif diff --git a/src/gprs_bssgp_pcu.c b/src/gprs_bssgp_pcu.c index 8fd6d85..f441437 100644 --- a/src/gprs_bssgp_pcu.c +++ b/src/gprs_bssgp_pcu.c @@ -36,6 +36,7 @@ #include "llc.h" #include "gprs_rlcmac.h" #include "bts_pch_timer.h" +#include "alloc_algo.h" /* Tuning parameters for BSSGP flow control */ #define FC_DEFAULT_LIFE_TIME_SECS 10 /* experimental value, 10s */ diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index 468712e..22a33b4 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -100,17 +100,7 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_tbf *tbf, bool single, - int8_t use_trx); - -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_tbf *tbf, bool single, - int8_t use_trx); - -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_tbf *tbf, bool single, - int8_t use_trx); - int gprs_rlcmac_paging_request(struct gprs_rlcmac_bts *bts, const struct osmo_mobile_identity *mi, uint16_t pgroup); -int gprs_alloc_max_dl_slots_per_ms(const struct gprs_rlcmac_bts *bts, uint8_t ms_class); #ifdef __cplusplus } #endif diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 86b5398..60c8c79 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -28,6 +28,7 @@ #include <bts.h> #include <osmocom/pcu/pcuif_proto.h> #include "gprs_bssgp_pcu.h" +#include "alloc_algo.h" extern "C" { #include "pcu_vty.h" diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 244a58a..54e0df6 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -23,6 +23,7 @@ #include "bts.h" #include "tbf.h" #include "pcu_vty_functions.h" +#include "alloc_algo.h" #define X(x) (1 << x) diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 4b4fbd5..75bf145 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -27,6 +27,7 @@ extern "C" { #include "mslot_class.h" +#include "alloc_algo.h" #include <osmocom/core/application.h> #include <osmocom/core/msgb.h> #include <osmocom/core/talloc.h> diff --git a/tests/app_info/AppInfoTest.cpp b/tests/app_info/AppInfoTest.cpp index 6806f20..668b081 100644 --- a/tests/app_info/AppInfoTest.cpp +++ b/tests/app_info/AppInfoTest.cpp @@ -24,6 +24,8 @@ #include <osmocom/core/utils.h> #include <osmocom/core/msgb.h> #include <osmocom/core/application.h> + +#include "alloc_algo.h" } using namespace std; diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 02a3568..dd318c0 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -31,6 +31,7 @@ extern "C" { #include "pcu_vty.h" #include "coding_scheme.h" +#include "alloc_algo.h" #include <osmocom/core/application.h> #include <osmocom/core/msgb.h> diff --git a/tests/emu/pcu_emu.cpp b/tests/emu/pcu_emu.cpp index 7c9baa9..b08c31d 100644 --- a/tests/emu/pcu_emu.cpp +++ b/tests/emu/pcu_emu.cpp @@ -22,6 +22,7 @@ extern "C" { #include <osmocom/core/talloc.h> #include <pcu_vty.h> +#include <alloc_algo.h> } #include "gprs_tests.h" diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 80dfc2f..47566f8 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -36,6 +36,7 @@ extern "C" { #include "pcu_vty.h" #include "coding_scheme.h" +#include "alloc_algo.h" #include <osmocom/core/application.h> #include <osmocom/core/msgb.h> diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 1e714e1..c728af1 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -30,6 +30,7 @@ #include "decoding.h" #include "gprs_rlcmac.h" #include "egprs_rlc_compression.h" +#include "alloc_algo.h" extern "C" { #include <osmocom/core/application.h> 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I33a6c178c64a769f05d3880a69c38acb154afa62 Gerrit-Change-Number: 30608 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-pcu[master]: Convert ms_first_common_ts to struct gprs_rlcmac_pdch
by pespin 16 Dec '22

16 Dec '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30575 ) Change subject: Convert ms_first_common_ts to struct gprs_rlcmac_pdch ...................................................................... Convert ms_first_common_ts to struct gprs_rlcmac_pdch This way it contains full information about the TS, not only the TN. Change-Id: I19373939ec104d371e3e91422f018a8175cb0f89 --- M src/gprs_ms.c M src/gprs_ms.h M src/gprs_rlcmac_ts_alloc.cpp M src/pcu_vty_functions.cpp M src/tbf.cpp M src/tbf_ul.cpp M tests/alloc/AllocTest.cpp M tests/ulc/PdchUlcTest.cpp 8 files changed, 40 insertions(+), 34 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve diff --git a/src/gprs_ms.c b/src/gprs_ms.c index 073dd4a..29d226f 100644 --- a/src/gprs_ms.c +++ b/src/gprs_ms.c @@ -120,7 +120,6 @@ ms->current_cs_ul = UNKNOWN; ms->current_cs_dl = UNKNOWN; ms->is_idle = true; - ms->first_common_ts = TBF_TS_UNSET; INIT_LLIST_HEAD(&ms->list); INIT_LLIST_HEAD(&ms->old_tbfs); @@ -384,7 +383,7 @@ if (!ms->dl_tbf && !ms->ul_tbf) { ms_set_reserved_slots(ms, NULL, 0, 0); - ms->first_common_ts = TBF_TS_UNSET; + ms->first_common_ts = NULL; if (ms_tlli(ms) != 0) ms_release_timer_start(ms); @@ -920,15 +919,15 @@ return cs; } -int8_t ms_first_common_ts(const struct GprsMs *ms) +struct gprs_rlcmac_pdch *ms_first_common_ts(const struct GprsMs *ms) { return ms->first_common_ts; } -void ms_set_first_common_ts(struct GprsMs *ms, uint8_t first_common_ts) +void ms_set_first_common_ts(struct GprsMs *ms, struct gprs_rlcmac_pdch *pdch) { - OSMO_ASSERT(first_common_ts < 8); - ms->first_common_ts = first_common_ts; + OSMO_ASSERT(pdch); + ms->first_common_ts = pdch; } uint8_t ms_dl_slots(const struct GprsMs *ms) diff --git a/src/gprs_ms.h b/src/gprs_ms.h index 92292e3..835ff18 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -64,8 +64,8 @@ struct gprs_rlcmac_ul_tbf *ul_tbf; struct gprs_rlcmac_dl_tbf *dl_tbf; struct llist_head old_tbfs; /* list of gprs_rlcmac_tbf */ - /* First common timeslot number used both in UL and DL, 0..7 or TBF_TS_UNSET (-1): */ - int8_t first_common_ts; + /* First common timeslot used both in UL and DL, or NULL if not set: */ + struct gprs_rlcmac_pdch *first_common_ts; uint32_t tlli; uint32_t new_ul_tlli; @@ -103,8 +103,8 @@ struct GprsMs *ms_alloc(struct gprs_rlcmac_bts *bts, uint32_t tlli); -int8_t ms_first_common_ts(const struct GprsMs *ms); -void ms_set_first_common_ts(struct GprsMs *ms, uint8_t first_common_ts); +struct gprs_rlcmac_pdch *ms_first_common_ts(const struct GprsMs *ms); +void ms_set_first_common_ts(struct GprsMs *ms, struct gprs_rlcmac_pdch *pdch); void ms_set_reserved_slots(struct GprsMs *ms, struct gprs_rlcmac_trx *trx, uint8_t ul_slots, uint8_t dl_slots); struct GprsMs *ms_ref(struct GprsMs *ms); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 96098a9..704b696 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -350,6 +350,7 @@ const char *mask_reason = NULL; struct GprsMs *ms = tbf->ms(); gprs_rlcmac_trx *trx = ms_current_trx(ms); + struct gprs_rlcmac_pdch *first_common_ts = ms_first_common_ts(ms); LOGPAL(tbf, "A", single, use_trx, LOGL_DEBUG, "Alloc start\n"); @@ -365,11 +366,9 @@ dl_slots = ms_reserved_dl_slots(ms); ul_slots = ms_reserved_ul_slots(ms); - ts = ms_first_common_ts(ms); - - if (ts >= 0) { + if (first_common_ts) { mask_reason = "need to reuse TS"; - mask = 1 << ts; + mask = 1 << first_common_ts->ts_no; } else if (dl_slots || ul_slots) { mask_reason = "need to use a reserved common TS"; mask = dl_slots & ul_slots; @@ -412,7 +411,7 @@ tbf->trx = trx; /* the only one TS is the common TS */ ms_set_reserved_slots(ms, trx, 1 << ts, 1 << ts); - ms_set_first_common_ts(ms, ts); + ms_set_first_common_ts(ms, pdch); tbf->upgrade_to_multislot = false; bts_do_rate_ctr_inc(bts, CTR_TBF_ALLOC_ALGO_A); @@ -861,7 +860,7 @@ uint8_t ul_slots; uint8_t reserved_dl_slots; uint8_t reserved_ul_slots; - int8_t first_common_ts; + int8_t first_common_tn; uint8_t slotcount = 0; uint8_t reserve_count = 0, trx_no; int first_ts; @@ -870,6 +869,7 @@ int tfi; struct GprsMs *ms = tbf->ms(); gprs_rlcmac_trx *trx; + struct gprs_rlcmac_pdch *first_common_ts = ms_first_common_ts(ms); LOGPAL(tbf, "B", single, use_trx, LOGL_DEBUG, "Alloc start\n"); @@ -877,7 +877,7 @@ reserved_dl_slots = ms_reserved_dl_slots(ms); reserved_ul_slots = ms_reserved_ul_slots(ms); - first_common_ts = ms_first_common_ts(ms); + first_common_tn = first_common_ts ? first_common_ts->ts_no : -1; /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts, ms, tbf->direction, use_trx, &trx_no); @@ -899,7 +899,7 @@ /* Step 3a: Derive the slot set for the current TBF */ rc = tbf_select_slot_set(tbf, trx, single, ul_slots, dl_slots, reserved_ul_slots, reserved_dl_slots, - first_common_ts); + first_common_tn); if (rc < 0) return -EINVAL; @@ -924,11 +924,12 @@ return -EINVAL; } - first_common_ts = ffs(dl_slots & ul_slots) - 1; - if (first_common_ts < 0) { + first_common_tn = ffs(dl_slots & ul_slots) - 1; + if (first_common_tn < 0) { LOGPAL(tbf, "B", single, use_trx, LOGL_NOTICE, "first common slot unavailable\n"); return -EINVAL; } + first_common_ts = &trx->pdch[first_common_tn]; if (single && slotcount) { tbf->upgrade_to_multislot = (reserve_count > slotcount); diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 17aa203..facc34c 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -55,6 +55,7 @@ gprs_rlcmac_dl_tbf *dl_tbf = tbf_as_dl_tbf(tbf); uint32_t state_flags = tbf_state_flags(tbf); struct GprsMs *ms = tbf_ms(tbf); + const struct gprs_rlcmac_pdch *first_common_ts = ms_first_common_ts(ms); vty_out(vty, "TBF: TFI=%d TLLI=0x%08x (%s) TA=%u DIR=%s IMSI=%s%s", tbf->tfi(), tbf->tlli(), tbf->is_tlli_valid() ? "valid" : "invalid", @@ -66,7 +67,8 @@ state_flags, state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH), state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH), - ms_first_common_ts(ms), tbf->control_ts, + first_common_ts ? first_common_ts->ts_no : -1, + tbf->control_ts, tbf->ms_class(), ms_egprs_ms_class(ms), VTY_NEWLINE); diff --git a/src/tbf.cpp b/src/tbf.cpp index 2cc6053..c934f07 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -279,14 +279,15 @@ void tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf) { - int8_t first_common_ts = ms_first_common_ts(tbf_ms(tbf)); + struct gprs_rlcmac_pdch *first_common = ms_first_common_ts(tbf_ms(tbf)); + OSMO_ASSERT(first_common); if (tbf->control_ts == TBF_TS_UNSET) LOGPTBF(tbf, LOGL_INFO, "Setting Control TS %d\n", - first_common_ts); - else if (tbf->control_ts != first_common_ts) + first_common->ts_no); + else if (tbf->control_ts != first_common->ts_no) LOGPTBF(tbf, LOGL_INFO, "Changing Control TS %d -> %d\n", - tbf->control_ts, first_common_ts); - tbf->control_ts = first_common_ts; + tbf->control_ts, first_common->ts_no); + tbf->control_ts = first_common->ts_no; } void gprs_rlcmac_tbf::n_reset(enum tbf_counters n) @@ -706,13 +707,14 @@ { uint8_t slots = 0; size_t i; + struct gprs_rlcmac_pdch *first_common; if (direction == GPRS_RLCMAC_DL_TBF) { if (control_ts < 8) slots |= 1 << control_ts; - int8_t first_common_ts = ms_first_common_ts(tbf_ms(this)); - if (first_common_ts != TBF_TS_UNSET) - slots |= 1 << first_common_ts; + first_common = ms_first_common_ts(tbf_ms(this)); + if (first_common) + slots |= 1 << first_common->ts_no; return slots; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index b04c511..a0e0398 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -166,7 +166,7 @@ ul_tbf->trx = trx; /* The only one TS is the common, control TS */ - ms_set_first_common_ts(ms, pdch->ts_no); + ms_set_first_common_ts(ms, pdch); tbf_assign_control_ts(ul_tbf); ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, next_tbf_ctr_group_id++); ul_tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(ul_tbf, diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 215a7ae..4b4fbd5 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -177,12 +177,13 @@ if (!verbose) return; const struct GprsMs *ms = tbf_ms(tbf); + const struct gprs_rlcmac_pdch *first_common = ms_first_common_ts(ms); for (size_t i = 0; i < ARRAY_SIZE(tbf->pdch); ++i) if (tbf->pdch[i]) printf("PDCH[%zu] is used for %s\n", i, dir); printf("PDCH[%d] is control_ts for %s\n", tbf->control_ts, dir); - printf("PDCH[%d] is first common for %s\n", ms_first_common_ts(ms), dir); + printf("PDCH[%d] is first common for %s\n", first_common ? first_common->ts_no : -1, dir); } #define ENABLE_PDCH(ts_no, enable_flag, trx) \ @@ -569,13 +570,13 @@ trx = ms_current_trx(ms); OSMO_ASSERT(ul_tbf || dl_tbf); - OSMO_ASSERT(ms_first_common_ts(ms) != TBF_TS_UNSET); + OSMO_ASSERT(ms_first_common_ts(ms) != NULL); if (ul_tbf) { - ul_slots = 1 << (uint8_t)ms_first_common_ts(ms); + ul_slots = 1 << (uint8_t)ms_first_common_ts(ms)->ts_no; tfi = ul_tbf->tfi(); dir = GPRS_RLCMAC_UL_TBF; } else { - ul_slots = 1 << (uint8_t)ms_first_common_ts(ms); + ul_slots = 1 << (uint8_t)ms_first_common_ts(ms)->ts_no; tfi = dl_tbf->tfi(); dir = GPRS_RLCMAC_DL_TBF; } diff --git a/tests/ulc/PdchUlcTest.cpp b/tests/ulc/PdchUlcTest.cpp index 2501f60..a199311 100644 --- a/tests/ulc/PdchUlcTest.cpp +++ b/tests/ulc/PdchUlcTest.cpp @@ -169,6 +169,7 @@ bool single, int8_t use_tbf) { tbf->trx = &bts->trx[0]; + ms_set_first_common_ts(tbf_ms(tbf), &tbf->trx->pdch[0]); return 0; } -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I19373939ec104d371e3e91422f018a8175cb0f89 Gerrit-Change-Number: 30575 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-pcu[master]: tbf: Fix typo in define used
by pespin 16 Dec '22

16 Dec '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30621 ) Change subject: tbf: Fix typo in define used ...................................................................... tbf: Fix typo in define used Change-Id: I1d85cba17fc1ee70a063ed03c7707876e1349515 --- M src/tbf.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve diff --git a/src/tbf.cpp b/src/tbf.cpp index c934f07..90e2be6 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -646,7 +646,7 @@ OSMO_STRBUF_PRINTF(sb, "TBF("); OSMO_STRBUF_PRINTF(sb, "%s", direction == GPRS_RLCMAC_UL_TBF ? "UL" : "DL"); if (this->trx) { /* This may not be available during TBF alloc func time */ - int8_t tfi = (m_tfi == TBF_TS_UNSET) ? -1 : m_tfi; + int8_t tfi = (m_tfi == TBF_TFI_UNSET) ? -1 : m_tfi; OSMO_STRBUF_PRINTF(sb, ":TFI-%u-%u-%d", this->trx->bts->nr, this->trx->trx_no, tfi); } 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30621 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I1d85cba17fc1ee70a063ed03c7707876e1349515 Gerrit-Change-Number: 30621 Gerrit-PatchSet: 2 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
Change in osmo-pcu[master]: tests/tbf: test_tbf_dl_llc_loss(): Fix wrong param passed and wrong e...
by pespin 16 Dec '22

16 Dec '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30622 ) Change subject: tests/tbf: test_tbf_dl_llc_loss(): Fix wrong param passed and wrong expectancies ...................................................................... tests/tbf: test_tbf_dl_llc_loss(): Fix wrong param passed and wrong expectancies The DL-TBF in the test gets its TS allocated on TS4 (only that one is enabled through setup_bts(bts, ts_no=4)), and hence it makes no sense to ask it to send data on TS7. Change-Id: Ibe6fc073b7438b8024c4d3ddb0e60c6112752351 --- M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 2 files changed, 10 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 7067201..ba357e3 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -587,7 +587,7 @@ OSMO_ASSERT(ms_dl_tbf(ms) != NULL); - /* Here PCU would answer with data_cnf and trigger + /* Here BTS would answer with data_cnf and trigger * bts_rcv_imm_ass_cnf(), which would trigger TBF_EV_ASSIGN_PCUIF_CNF. * That in turn would set up timer X2002. Finally, X2002 timeout * moves it to FLOW state. We set X2002 timeout to 0 here to get @@ -606,12 +606,13 @@ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x07, 0x00, 0x02, 0x4d, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, - { 0x07, 0x01, 0x04, 0x4d, 0x03, 0x03, 0x03, + /* On last DL block, PCU requests polling (DL ACK/NACK): S/P 1 and RRBP 01, hence 0x07 becomes 0xf1 */ + { 0x1f, 0x01, 0x04, 0x4d, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, }; while (ms_dl_tbf(ms)->have_data()) { - msg = ms_dl_tbf(ms)->create_dl_acked_block(fn += 4, 7); + msg = ms_dl_tbf(ms)->create_dl_acked_block(fn += 4, ts_no); fprintf(stderr, "MSG = %s\n", msgb_hexdump(msg)); if (!msgb_eq_data_print(msg, exp[expected_data - 1], GSM_MACBLOCK_LEN)) fprintf(stderr, "%s failed at %u\n", __func__, expected_data); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 389567e..e38e694 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1786,9 +1786,12 @@ TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) Copying 1 RLC blocks, 1 BSNs TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) Copying data unit 0 (BSN 2) TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) Scheduling Ack/Nack polling, because it was requested explicitly (e.g. first final block sent). -TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) Polling cannot be scheduled in this TS 7 (control TS PDCH(bts=0,trx=0,ts=4)) -TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) msg block (BSN 2, CS-1): 07 01 04 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 -MSG = 07 01 04 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 +PDCH(bts=0,trx=0,ts=4) POLL scheduled at FN 12 + 18 = 30 +TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) Scheduled DL Acknowledgement polling on PACCH (FN=30, TS=4) +TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) starting timer T3191 [final block (DL-TBF)] with 5 sec. 0 microsec, cur_fn=2654167 +TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) Scheduled Ack/Nack polling on FN=30, TS=4 +TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) msg block (BSN 2, CS-1): 1f 01 04 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 +MSG = 1f 01 04 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 === end test_tbf_dl_llc_loss === MS(IMSI-001001000123456:TLLI-0xc0123456:TA-0:MSCLS-45-0:DL) Destroying MS object MS(IMSI-001001000123456:TLLI-0xc0123456:TA-0:MSCLS-45-0) Detaching TBF: TBF(DL:TFI-0-0-0:STATE-FINISHED:GPRS:IMSI-001001000123456:TLLI-0xc0123456) 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30622 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Ibe6fc073b7438b8024c4d3ddb0e60c6112752351 Gerrit-Change-Number: 30622 Gerrit-PatchSet: 2 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
Change in osmo-pcu[master]: Convert tbf->control_ts to be a gprs_rlcmac_pdch*
by pespin 16 Dec '22

16 Dec '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30620 ) Change subject: Convert tbf->control_ts to be a gprs_rlcmac_pdch* ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30620 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I6a97b6528b2f9d78dfbca8fb97ab7c621f777fc7 Gerrit-Change-Number: 30620 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 16 Dec 2022 14:47:31 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-pcu[master]: pdch: Introduce APIs to print PDCH name
by pespin 16 Dec '22

16 Dec '22
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30619 ) Change subject: pdch: Introduce APIs to print PDCH name ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30619 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: If18cb4a48237751e0dddede6793191b36dfe386d Gerrit-Change-Number: 30619 Gerrit-PatchSet: 2 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: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 16 Dec 2022 14:47:21 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • ...
  • 198
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.