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

November 2022

  • 2 participants
  • 2503 discussions
Change in osmocom-bb[master]: trxcon: rx_sch_fn(): do not use sched->fn_counter_proc
by fixeria 20 Nov '22

20 Nov '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30242 ) Change subject: trxcon: rx_sch_fn(): do not use sched->fn_counter_proc ...................................................................... trxcon: rx_sch_fn(): do not use sched->fn_counter_proc Use the given Fn instead, no need to go that deep for it. The sched->fn_counter_proc is an internal field of the scheduler, which is not necessarily holding a valid value when pulling Uplink bursts synchronously via the Ready-to-Send PHYIF API. Change-Id: I56027876b50e53b474c2f54ac216cd141142020e Related: OS#5599 --- M src/host/trxcon/src/sched_lchan_sch.c 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/42/30242/1 diff --git a/src/host/trxcon/src/sched_lchan_sch.c b/src/host/trxcon/src/sched_lchan_sch.c index c61e134..d943ae8 100644 --- a/src/host/trxcon/src/sched_lchan_sch.c +++ b/src/host/trxcon/src/sched_lchan_sch.c @@ -85,13 +85,14 @@ /* Decode BSIC and TDMA frame number */ decode_sb(&time, &bsic, sb_info); - LOGP_LCHAND(lchan, LOGL_DEBUG, "Received SCH: bsic=%u, fn=%u, sched_fn=%u\n", - bsic, time.fn, lchan->ts->sched->fn_counter_proc); + LOGP_LCHAND(lchan, LOGL_DEBUG, + "Received SCH: bsic=%u, fn=%u, sched_fn=%u\n", + bsic, time.fn, fn); /* Check if decoded frame number matches */ if (time.fn != fn) { LOGP_LCHAND(lchan, LOGL_ERROR, - "Decoded fn=%u does not match fn=%u provided by scheduler\n", + "Decoded fn=%u does not match sched_fn=%u\n", time.fn, fn); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30242 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I56027876b50e53b474c2f54ac216cd141142020e Gerrit-Change-Number: 30242 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: adjust coding style in l1sched_trigger()
by fixeria 20 Nov '22

20 Nov '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30240 ) Change subject: trxcon: adjust coding style in l1sched_trigger() ...................................................................... trxcon: adjust coding style in l1sched_trigger() Change-Id: I96a40fdbea5085999b9aeb98b418ae27132f6fda Related: OS#5599 --- M src/host/trxcon/src/sched_trx.c 1 file changed, 14 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/40/30240/1 diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c index abab0db..fb9cdc4 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -93,19 +93,15 @@ struct l1sched_lchan_state *lchan; l1sched_lchan_tx_func *handler; enum l1sched_lchan_type chan; - uint8_t offset; + unsigned int offset; - /* Timeslot is not allocated */ - if (ts == NULL) - return; - - /* Timeslot is not configured */ - if (ts->mf_layout == NULL) + /* Check if the given timeslot is configured */ + if (ts == NULL || ts->mf_layout == NULL) return; /* Get frame from multiframe */ offset = br->fn % ts->mf_layout->period; - frame = ts->mf_layout->frames + offset; + frame = &ts->mf_layout->frames[offset]; /* Get required info from frame */ br->bid = frame->ul_bid; @@ -113,41 +109,26 @@ handler = l1sched_lchan_desc[chan].tx_fn; /* Omit lchans without handler */ - if (!handler) + if (handler == NULL) return; - /* Make sure that lchan was allocated and activated */ + /* Make sure that lchan is allocated and active */ lchan = l1sched_find_lchan(ts, chan); - if (lchan == NULL) + if (lchan == NULL || !lchan->active) return; - /* Omit inactive lchans */ - if (!lchan->active) - return; - - /** - * If we aren't processing any primitive yet, - * attempt to obtain a new one from queue - */ + /* If no primitive is being processed, try obtaining one from Tx queue */ if (lchan->prim == NULL) lchan->prim = l1sched_prim_dequeue(&ts->tx_prims, br->fn, lchan); - - /* TODO: report TX buffers health to the higher layers */ - - /* If CBTX (Continuous Burst Transmission) is assumed */ - if (l1sched_lchan_desc[chan].flags & L1SCHED_CH_FLAG_CBTX) { - /** - * Probably, a TX buffer is empty. Nevertheless, - * we shall continuously transmit anything on - * CBTX channels. - */ - if (lchan->prim == NULL) + if (lchan->prim == NULL) { + /* If CBTX (Continuous Burst Transmission) is required */ + if (l1sched_lchan_desc[chan].flags & L1SCHED_CH_FLAG_CBTX) l1sched_prim_dummy(lchan); + if (lchan->prim == NULL) + return; } - /* If there is no primitive, do nothing */ - if (lchan->prim == NULL) - return; + /* TODO: report TX buffers health to the higher layers */ /* Handover RACH needs to be handled regardless of the * current channel type and the associated handler. */ -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30240 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I96a40fdbea5085999b9aeb98b418ae27132f6fda Gerrit-Change-Number: 30240 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: rework l1sched_trigger(), split l1sched_trigger_all()
by fixeria 20 Nov '22

20 Nov '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30239 ) Change subject: trxcon: rework l1sched_trigger(), split l1sched_trigger_all() ...................................................................... trxcon: rework l1sched_trigger(), split l1sched_trigger_all() The key idea is to allow triggering the scheduler only for a specific timeslot of a frame, while keeping the API for triggering all together. Change-Id: Ibb7f9d7de26733f21b0753a2c655a250286bf1f0 Related: OS#5599 --- M src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h M src/host/trxcon/src/sched_clck.c M src/host/trxcon/src/sched_trx.c 3 files changed, 86 insertions(+), 84 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/39/30239/1 diff --git a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h index eb95c85..e73bab4 100644 --- a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h @@ -490,7 +490,9 @@ /* Clock and Downlink scheduling trigger */ int l1sched_clck_handle(struct l1sched_state *sched, uint32_t fn); void l1sched_clck_reset(struct l1sched_state *sched); -void l1sched_trigger(struct l1sched_state *sched, uint32_t fn); + +void l1sched_trigger(struct l1sched_state *sched, struct l1sched_burst_req *br); +void l1sched_trigger_all(struct l1sched_state *sched, uint32_t fn); /* External L1 API, must be implemented by the API user */ int l1sched_handle_config_req(struct l1sched_state *sched, diff --git a/src/host/trxcon/src/sched_clck.c b/src/host/trxcon/src/sched_clck.c index 5862d0a..6cc0898 100644 --- a/src/host/trxcon/src/sched_clck.c +++ b/src/host/trxcon/src/sched_clck.c @@ -44,9 +44,9 @@ /* Advance TDMA frame number in order to give the transceiver * more time to handle the burst before the actual transmission. */ -#define l1sched_trigger_advance(sched) \ - l1sched_trigger((sched), GSM_TDMA_FN_SUM((sched)->fn_counter_proc, \ - (sched)->fn_counter_advance)) +#define l1sched_trigger_all_advance(sched) \ + l1sched_trigger_all((sched), GSM_TDMA_FN_SUM((sched)->fn_counter_proc, \ + (sched)->fn_counter_advance)) static void l1sched_clck_tick(void *data) { @@ -88,7 +88,7 @@ GSM_TDMA_FN_INC(sched->fn_counter_proc); /* Trigger the scheduler */ - l1sched_trigger_advance(sched); + l1sched_trigger_all_advance(sched); } osmo_timer_schedule(&sched->clock_timer, 0, @@ -101,7 +101,7 @@ sched->fn_counter_proc = fn; /* Trigger the scheduler */ - l1sched_trigger_advance(sched); + l1sched_trigger_all_advance(sched); /* Schedule first FN clock */ sched->clock = *tv_now; @@ -182,7 +182,7 @@ GSM_TDMA_FN_INC(sched->fn_counter_proc); /* Trigger the scheduler */ - l1sched_trigger_advance(sched); + l1sched_trigger_all_advance(sched); } /* Schedule next FN to be transmitted */ diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c index bef8cc2..abab0db 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -85,97 +85,97 @@ static void l1sched_a5_burst_enc(struct l1sched_lchan_state *lchan, struct l1sched_burst_req *br); -void l1sched_trigger(struct l1sched_state *sched, uint32_t fn) +/* Trigger the scheduler for a single TDMA timeslot indicated in the given br */ +void l1sched_trigger(struct l1sched_state *sched, struct l1sched_burst_req *br) { - struct l1sched_burst_req br[TRX_TS_COUNT]; + struct l1sched_ts *ts = sched->ts[br->tn]; const struct l1sched_tdma_frame *frame; struct l1sched_lchan_state *lchan; l1sched_lchan_tx_func *handler; enum l1sched_lchan_type chan; uint8_t offset; - struct l1sched_ts *ts; - unsigned int tn; + /* Timeslot is not allocated */ + if (ts == NULL) + return; + + /* Timeslot is not configured */ + if (ts->mf_layout == NULL) + return; + + /* Get frame from multiframe */ + offset = br->fn % ts->mf_layout->period; + frame = ts->mf_layout->frames + offset; + + /* Get required info from frame */ + br->bid = frame->ul_bid; + chan = frame->ul_chan; + handler = l1sched_lchan_desc[chan].tx_fn; + + /* Omit lchans without handler */ + if (!handler) + return; + + /* Make sure that lchan was allocated and activated */ + lchan = l1sched_find_lchan(ts, chan); + if (lchan == NULL) + return; + + /* Omit inactive lchans */ + if (!lchan->active) + return; + + /** + * If we aren't processing any primitive yet, + * attempt to obtain a new one from queue + */ + if (lchan->prim == NULL) + lchan->prim = l1sched_prim_dequeue(&ts->tx_prims, br->fn, lchan); + + /* TODO: report TX buffers health to the higher layers */ + + /* If CBTX (Continuous Burst Transmission) is assumed */ + if (l1sched_lchan_desc[chan].flags & L1SCHED_CH_FLAG_CBTX) { + /** + * Probably, a TX buffer is empty. Nevertheless, + * we shall continuously transmit anything on + * CBTX channels. + */ + if (lchan->prim == NULL) + l1sched_prim_dummy(lchan); + } + + /* If there is no primitive, do nothing */ + if (lchan->prim == NULL) + return; + + /* Handover RACH needs to be handled regardless of the + * current channel type and the associated handler. */ + if (L1SCHED_PRIM_IS_RACH(lchan->prim) && lchan->prim->chan != L1SCHED_RACH) + handler = l1sched_lchan_desc[L1SCHED_RACH].tx_fn; + + /* Poke lchan handler */ + handler(lchan, br); + + /* Perform A5/X burst encryption if required */ + if (lchan->a5.algo) + l1sched_a5_burst_enc(lchan, br); +} + +/* Trigger the scheduler for all timeslots of the given TDMA Fn */ +void l1sched_trigger_all(struct l1sched_state *sched, uint32_t fn) +{ /* Iterate over timeslot list */ - for (tn = 0; tn < ARRAY_SIZE(br); tn++) { - /* Initialize the buffer for this timeslot */ - br[tn] = (struct l1sched_burst_req) { + for (unsigned int tn = 0; tn < ARRAY_SIZE(sched->ts); tn++) { + struct l1sched_burst_req br = { .fn = fn, .tn = tn, .burst_len = 0, /* NOPE.ind */ }; - /* Timeslot is not allocated */ - ts = sched->ts[tn]; - if (ts == NULL) - continue; - - /* Timeslot is not configured */ - if (ts->mf_layout == NULL) - continue; - - /* Get frame from multiframe */ - offset = fn % ts->mf_layout->period; - frame = ts->mf_layout->frames + offset; - - /* Get required info from frame */ - br[tn].bid = frame->ul_bid; - chan = frame->ul_chan; - handler = l1sched_lchan_desc[chan].tx_fn; - - /* Omit lchans without handler */ - if (!handler) - continue; - - /* Make sure that lchan was allocated and activated */ - lchan = l1sched_find_lchan(ts, chan); - if (lchan == NULL) - continue; - - /* Omit inactive lchans */ - if (!lchan->active) - continue; - - /** - * If we aren't processing any primitive yet, - * attempt to obtain a new one from queue - */ - if (lchan->prim == NULL) - lchan->prim = l1sched_prim_dequeue(&ts->tx_prims, fn, lchan); - - /* TODO: report TX buffers health to the higher layers */ - - /* If CBTX (Continuous Burst Transmission) is assumed */ - if (l1sched_lchan_desc[chan].flags & L1SCHED_CH_FLAG_CBTX) { - /** - * Probably, a TX buffer is empty. Nevertheless, - * we shall continuously transmit anything on - * CBTX channels. - */ - if (lchan->prim == NULL) - l1sched_prim_dummy(lchan); - } - - /* If there is no primitive, do nothing */ - if (lchan->prim == NULL) - continue; - - /* Handover RACH needs to be handled regardless of the - * current channel type and the associated handler. */ - if (L1SCHED_PRIM_IS_RACH(lchan->prim) && lchan->prim->chan != L1SCHED_RACH) - handler = l1sched_lchan_desc[L1SCHED_RACH].tx_fn; - - /* Poke lchan handler */ - handler(lchan, &br[tn]); - - /* Perform A5/X burst encryption if required */ - if (lchan->a5.algo) - l1sched_a5_burst_enc(lchan, &br[tn]); + l1sched_trigger(sched, &br); + l1sched_handle_burst_req(sched, &br); } - - /* Send all bursts for this TDMA frame */ - for (tn = 0; tn < ARRAY_SIZE(br); tn++) - l1sched_handle_burst_req(sched, &br[tn]); } void l1sched_logging_init(int log_cat_common, int log_cat_data) -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30239 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ibb7f9d7de26733f21b0753a2c655a250286bf1f0 Gerrit-Change-Number: 30239 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: implement Ready-to-Send PHYIF API
by fixeria 20 Nov '22

20 Nov '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30241 ) Change subject: trxcon: implement Ready-to-Send PHYIF API ...................................................................... trxcon: implement Ready-to-Send PHYIF API This API is going to be used by osmo-trx-ms for pulling Uplink bursts from the scheduler in a synchronous way, without relaying on the timer driven libtrxcon's internal scheduler. Change-Id: Ic8f74413f5fad277340e007dd4296f890155a2c1 Related: OS#5599 --- M src/host/trxcon/include/osmocom/bb/trxcon/phyif.h M src/host/trxcon/src/trxcon_shim.c 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/41/30241/1 diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/phyif.h b/src/host/trxcon/include/osmocom/bb/trxcon/phyif.h index 43363cb..3cf5f5d 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/phyif.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/phyif.h @@ -69,6 +69,12 @@ } param; }; +/* RTS.ind - Ready-to-Send indication */ +struct trxcon_phyif_rts_ind { + uint32_t fn; + uint8_t tn; +}; + /* BURST.req - a burst to be transmitted */ struct trxcon_phyif_burst_req { uint32_t fn; @@ -89,6 +95,7 @@ }; +int trxcon_phyif_handle_rts_ind(void *priv, const struct trxcon_phyif_rts_ind *rts); int trxcon_phyif_handle_burst_ind(void *priv, const struct trxcon_phyif_burst_ind *bi); int trxcon_phyif_handle_burst_req(void *phyif, const struct trxcon_phyif_burst_req *br); int trxcon_phyif_handle_cmd(void *phyif, const struct trxcon_phyif_cmd *cmd); diff --git a/src/host/trxcon/src/trxcon_shim.c b/src/host/trxcon/src/trxcon_shim.c index 6434461..2b5fc29 100644 --- a/src/host/trxcon/src/trxcon_shim.c +++ b/src/host/trxcon/src/trxcon_shim.c @@ -220,6 +220,19 @@ } /* External L1 API for the PHYIF */ +int trxcon_phyif_handle_rts_ind(void *priv, const struct trxcon_phyif_rts_ind *rts) +{ + struct trxcon_inst *trxcon = priv; + struct l1sched_burst_req br = { + .fn = rts->fn, + .tn = rts->tn, + .burst_len = 0, /* NOPE.ind */ + }; + + l1sched_trigger(trxcon->sched, &br); + return l1sched_handle_burst_req(trxcon->sched, &br); +} + int trxcon_phyif_handle_burst_ind(void *priv, const struct trxcon_phyif_burst_ind *bi) { struct trxcon_inst *trxcon = priv; -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30241 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ic8f74413f5fad277340e007dd4296f890155a2c1 Gerrit-Change-Number: 30241 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: make l1sched_trigger() accept the [advanced] TDMA Fn
by fixeria 20 Nov '22

20 Nov '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30238 ) Change subject: trxcon: make l1sched_trigger() accept the [advanced] TDMA Fn ...................................................................... trxcon: make l1sched_trigger() accept the [advanced] TDMA Fn Change-Id: Icc9127bfacfbb78ab9d74103b2db03be850f3d4f Related: OS#5599 --- M src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h M src/host/trxcon/src/sched_clck.c M src/host/trxcon/src/sched_trx.c 3 files changed, 11 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/38/30238/1 diff --git a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h index 3dfafb3..eb95c85 100644 --- a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h @@ -490,7 +490,7 @@ /* Clock and Downlink scheduling trigger */ int l1sched_clck_handle(struct l1sched_state *sched, uint32_t fn); void l1sched_clck_reset(struct l1sched_state *sched); -void l1sched_trigger(struct l1sched_state *sched); +void l1sched_trigger(struct l1sched_state *sched, uint32_t fn); /* External L1 API, must be implemented by the API user */ int l1sched_handle_config_req(struct l1sched_state *sched, diff --git a/src/host/trxcon/src/sched_clck.c b/src/host/trxcon/src/sched_clck.c index ccafd7b..5862d0a 100644 --- a/src/host/trxcon/src/sched_clck.c +++ b/src/host/trxcon/src/sched_clck.c @@ -42,6 +42,12 @@ #define MAX_FN_SKEW 50 #define TRX_LOSS_FRAMES 400 +/* Advance TDMA frame number in order to give the transceiver + * more time to handle the burst before the actual transmission. */ +#define l1sched_trigger_advance(sched) \ + l1sched_trigger((sched), GSM_TDMA_FN_SUM((sched)->fn_counter_proc, \ + (sched)->fn_counter_advance)) + static void l1sched_clck_tick(void *data) { struct l1sched_state *sched = (struct l1sched_state *) data; @@ -82,7 +88,7 @@ GSM_TDMA_FN_INC(sched->fn_counter_proc); /* Trigger the scheduler */ - l1sched_trigger(sched); + l1sched_trigger_advance(sched); } osmo_timer_schedule(&sched->clock_timer, 0, @@ -95,7 +101,7 @@ sched->fn_counter_proc = fn; /* Trigger the scheduler */ - l1sched_trigger(sched); + l1sched_trigger_advance(sched); /* Schedule first FN clock */ sched->clock = *tv_now; @@ -176,7 +182,7 @@ GSM_TDMA_FN_INC(sched->fn_counter_proc); /* Trigger the scheduler */ - l1sched_trigger(sched); + l1sched_trigger_advance(sched); } /* Schedule next FN to be transmitted */ diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c index c36b7de..bef8cc2 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -85,7 +85,7 @@ static void l1sched_a5_burst_enc(struct l1sched_lchan_state *lchan, struct l1sched_burst_req *br); -void l1sched_trigger(struct l1sched_state *sched) +void l1sched_trigger(struct l1sched_state *sched, uint32_t fn) { struct l1sched_burst_req br[TRX_TS_COUNT]; const struct l1sched_tdma_frame *frame; @@ -96,11 +96,6 @@ struct l1sched_ts *ts; unsigned int tn; - /* Advance TDMA frame number in order to give the transceiver - * more time to handle the burst before the actual transmission. */ - const uint32_t fn = GSM_TDMA_FN_SUM(sched->fn_counter_proc, - sched->fn_counter_advance); - /* Iterate over timeslot list */ for (tn = 0; tn < ARRAY_SIZE(br); tn++) { /* Initialize the buffer for this timeslot */ -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30238 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Icc9127bfacfbb78ab9d74103b2db03be850f3d4f Gerrit-Change-Number: 30238 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: reorganize the core logic into libtrxcon.la
by fixeria 19 Nov '22

19 Nov '22
Attention is currently required from: laforge, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30101 ) Change subject: trxcon: reorganize the core logic into libtrxcon.la ...................................................................... Patch Set 2: (1 comment) File src/host/trxcon/src/trxcon_inst.c: https://gerrit.osmocom.org/c/osmocom-bb/+/30101/comment/f0640788_9a0990d7 PS2, Line 51: schc = logc[i]; > Ah they are passed below, nevermind. Marking as resolved. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30101 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Idf207947f620a7394e0a0e5bf2c37bcd8df64bbe Gerrit-Change-Number: 30101 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 19 Nov 2022 20:38:58 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: osmux: Use new osmux_xfrm_input API to set name on each link
by laforge 19 Nov '22

19 Nov '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/30212 ) Change subject: osmux: Use new osmux_xfrm_input API to set name on each link ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/30212 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Id5b7d497be4b3405403d30e40e1a52f13101cf5f Gerrit-Change-Number: 30212 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 19 Nov 2022 09:22:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bts[master]: osmux: Use new osmux_xfrm_input API to set name on each link
by laforge 19 Nov '22

19 Nov '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/30213 ) Change subject: osmux: Use new osmux_xfrm_input API to set name on each link ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/30213 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Iaea980a2e11282add12f9af585500d90f0462279 Gerrit-Change-Number: 30213 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 19 Nov 2022 09:22:06 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-remsim[master]: rspro_client: implement re-establish delay
by laforge 19 Nov '22

19 Nov '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/30138 ) Change subject: rspro_client: implement re-establish delay ...................................................................... rspro_client: implement re-establish delay - add new SRVC_ST_REESTABLISH_DELAY state with delay stipulated by table k_reestablish_delay_s[], that implements a simple exponential-like back-off with an upper bound. - new function srvc_do_reestablish() is used to initiate a reestablish, and apply the appropriate delay, if any. - takes external delays (such as TCP connect() delay) into account, and does not double-penalize. - delay is reset to shortest possible if there has been no reestablish initiated in a long time (2x greater than our longest delay). Allows for fast reconnects even if a delay was used to connect. - addresses issues https://osmocom.org/issues/5348 and https://osmocom.org/issues/5610 Change-Id: I86cdc3ba37482e6577b429194d273a2399f32208 --- M src/rspro_client_fsm.c M src/rspro_client_fsm.h 2 files changed, 118 insertions(+), 12 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/rspro_client_fsm.c b/src/rspro_client_fsm.c index bd267ca..321dcf2 100644 --- a/src/rspro_client_fsm.c +++ b/src/rspro_client_fsm.c @@ -20,6 +20,7 @@ #include <stdint.h> #include <string.h> #include <errno.h> +#include <unistd.h> #include <talloc.h> @@ -40,6 +41,25 @@ #define T1_WAIT_CLIENT_CONN_RES 10 #define T2_RECONNECT 10 +static const int k_reestablish_delay_s[] = { + 0, 0, 0, // 3 immediate retries + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 Hz for 30 seconds + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 1/2 hz for 1 minute + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 1/4 Hz for 2 minutes + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 1/8 Hz for 4 minutes + 16, // 1/16 Hz thereafter +}; + +#define REESTABLISH_DELAY_COUNT ARRAY_SIZE(k_reestablish_delay_s) + /*********************************************************************** * client-side FSM for a RSPRO connection to remsim-server * @@ -101,7 +121,9 @@ SRVC_ST_ESTABLISHED, /* server connection established, ClientConnect succeeded */ SRVC_ST_CONNECTED, - /* connection lost, we're waiting for a re-establish */ + /* connection lost, 1st step: delaying until we re-establish */ + SRVC_ST_REESTABLISH_DELAY, + /* connection lost, 2nd step: wait for a re-establish */ SRVC_ST_REESTABLISH, }; @@ -191,6 +213,46 @@ .wait_for_resp = 10, }; +static int64_t get_monotonic_ms(void) +{ + struct timespec t; + clock_gettime(CLOCK_BOOTTIME, &t); + return ((1000LL * t.tv_sec) + (t.tv_nsec / 1000000)); +} + +static void srvc_do_reestablish(struct osmo_fsm_inst *fi) +{ + struct rspro_server_conn *srvc = (struct rspro_server_conn *) fi->priv; + + const int64_t since_last_ms = get_monotonic_ms() - srvc->reestablish_last_ms; + + /* reset delay loop if it has been > 2x the longest timeout since our last attempt; + * this lets us revert to rapid reconnect behavior for a good connection */ + const int64_t reset_ms = 2*1000*(OSMO_MAX(OSMO_MAX(T1_WAIT_CLIENT_CONN_RES, T2_RECONNECT), + k_reestablish_delay_s[REESTABLISH_DELAY_COUNT-1])); + + if (since_last_ms > reset_ms) { + srvc->reestablish_delay_idx = 0; + LOGPFSML(fi, LOGL_DEBUG, "->REESTABLISH_DELAY reset; %" PRId64 "ms since last attempt\n", + since_last_ms); + } + + /* determine if we need to delay reestablishment */ + const int64_t need_ms = k_reestablish_delay_s[srvc->reestablish_delay_idx] * 1000; + int64_t delay_ms = need_ms - since_last_ms; + + if (delay_ms > 0) { + LOGPFSML(fi, LOGL_DEBUG, "->REESTABLISH_DELAY delay %" PRId64 "ms; %" PRId64 "ms since last attempt [step %zu/%zu@%ds]\n", + delay_ms, since_last_ms, srvc->reestablish_delay_idx, (REESTABLISH_DELAY_COUNT-1), + k_reestablish_delay_s[srvc->reestablish_delay_idx]); + } else { + /* cheat and always use a minimum delay of 1ms to ensure a fsm timeout is triggered */ + delay_ms = 1; + } + + osmo_fsm_inst_state_chg_ms(fi, SRVC_ST_REESTABLISH_DELAY, delay_ms, 3); +} + static void srvc_st_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { @@ -224,7 +286,7 @@ switch (event) { case SRVC_E_TCP_DOWN: case SRVC_E_KA_TIMEOUT: - osmo_fsm_inst_state_chg(fi, SRVC_ST_REESTABLISH, T2_RECONNECT, 2); + srvc_do_reestablish(fi); break; case SRVC_E_CLIENT_CONN_RES: pdu = data; @@ -260,7 +322,7 @@ switch (event) { case SRVC_E_TCP_DOWN: case SRVC_E_KA_TIMEOUT: - osmo_fsm_inst_state_chg(fi, SRVC_ST_REESTABLISH, T2_RECONNECT, 2); + srvc_do_reestablish(fi); break; case SRVC_E_RSPRO_TX: pdu = data; @@ -286,10 +348,9 @@ return 0; /* we will explicitly terminate it */ } -static void srvc_st_reestablish_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +static void srvc_st_reestablish_delay_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct rspro_server_conn *srvc = (struct rspro_server_conn *) fi->priv; - int rc; if (srvc->keepalive_fi) { ipa_keepalive_fsm_stop(srvc->keepalive_fi); @@ -303,6 +364,27 @@ ipa_client_conn_destroy(srvc->conn); srvc->conn = NULL; } + + /* saturate timeout at last (longest) entry */ + if (srvc->reestablish_delay_idx < REESTABLISH_DELAY_COUNT-1) { + srvc->reestablish_delay_idx++; + } +} + +static void srvc_st_reestablish_delay(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + default: + OSMO_ASSERT(0); + } +} +static void srvc_st_reestablish_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct rspro_server_conn *srvc = (struct rspro_server_conn *) fi->priv; + int rc; + + srvc->reestablish_last_ms = get_monotonic_ms(); + LOGPFSML(fi, LOGL_INFO, "Creating TCP connection to server at %s:%u\n", srvc->server_host, srvc->server_port); srvc->conn = ipa_client_conn_create2(fi, NULL, 0, NULL, 0, srvc->server_host, srvc->server_port, @@ -351,7 +433,10 @@ switch (event) { case SRVC_E_ESTABLISH: - osmo_fsm_inst_state_chg(fi, SRVC_ST_REESTABLISH, T2_RECONNECT, 2); + /* reset delay connect immediately on our first connection */ + srvc->reestablish_delay_idx = 0; + srvc->reestablish_last_ms = 0; + srvc_do_reestablish(fi); break; case SRVC_E_DISCONNECT: if (srvc->keepalive_fi) { @@ -377,10 +462,14 @@ struct rspro_server_conn *srvc = (struct rspro_server_conn *) fi->priv; switch (fi->T) { - case 2: - /* TCP reconnect failed: retry */ + case 3: + /* delay has expired; let's re-establish */ osmo_fsm_inst_state_chg(fi, SRVC_ST_REESTABLISH, T2_RECONNECT, 2); break; + case 2: + /* TCP reconnect failed: retry after wait */ + srvc_do_reestablish(fi); + break; case 1: /* no ClientConnectRes received: disconnect + reconnect */ ipa_client_conn_close(srvc->conn); @@ -397,28 +486,35 @@ [SRVC_ST_INIT] = { .name = "INIT", .in_event_mask = 0, /* S(SRVC_E_ESTABLISH) via allstate */ - .out_state_mask = S(SRVC_ST_INIT) | S(SRVC_ST_REESTABLISH), + .out_state_mask = S(SRVC_ST_INIT) | S(SRVC_ST_REESTABLISH_DELAY), .action = srvc_st_init, }, [SRVC_ST_ESTABLISHED] = { .name = "ESTABLISHED", .in_event_mask = S(SRVC_E_TCP_DOWN) | S(SRVC_E_KA_TIMEOUT) | S(SRVC_E_CLIENT_CONN_RES), - .out_state_mask = S(SRVC_ST_CONNECTED) | S(SRVC_ST_REESTABLISH) | S(SRVC_ST_INIT), + .out_state_mask = S(SRVC_ST_CONNECTED) | S(SRVC_ST_REESTABLISH_DELAY) | S(SRVC_ST_INIT), .action = srvc_st_established, .onenter = srvc_st_established_onenter, }, [SRVC_ST_CONNECTED] = { .name = "CONNECTED", .in_event_mask = S(SRVC_E_TCP_DOWN) | S(SRVC_E_KA_TIMEOUT) | S(SRVC_E_RSPRO_TX), - .out_state_mask = S(SRVC_ST_REESTABLISH) | S(SRVC_ST_INIT), + .out_state_mask = S(SRVC_ST_REESTABLISH_DELAY) | S(SRVC_ST_INIT), .action = srvc_st_connected, .onenter = srvc_st_connected_onenter, .onleave = srvc_st_connected_onleave, }, + [SRVC_ST_REESTABLISH_DELAY] = { + .name = "REESTABLISH_DELAY", + .in_event_mask = 0, + .out_state_mask = S(SRVC_ST_REESTABLISH) | S(SRVC_ST_INIT), + .action = srvc_st_reestablish_delay, + .onenter = srvc_st_reestablish_delay_onenter, + }, [SRVC_ST_REESTABLISH] = { .name = "REESTABLISH", .in_event_mask = S(SRVC_E_TCP_UP) | S(SRVC_E_TCP_DOWN), - .out_state_mask = S(SRVC_ST_ESTABLISHED) | S(SRVC_ST_REESTABLISH) | S(SRVC_ST_INIT), + .out_state_mask = S(SRVC_ST_ESTABLISHED) | S(SRVC_ST_REESTABLISH_DELAY) | S(SRVC_ST_INIT), .action = srvc_st_reestablish, .onenter = srvc_st_reestablish_onenter, }, @@ -444,6 +540,9 @@ return -1; srvc->fi = fi; + srvc->reestablish_delay_idx = 0; + srvc->reestablish_last_ms = 0; + return 0; } diff --git a/src/rspro_client_fsm.h b/src/rspro_client_fsm.h index 029fcd9..55fe4a4 100644 --- a/src/rspro_client_fsm.h +++ b/src/rspro_client_fsm.h @@ -26,6 +26,13 @@ struct osmo_fsm_inst *fi; struct osmo_fsm_inst *keepalive_fi; int (*handle_rx)(struct rspro_server_conn *conn, const RsproPDU_t *pdu); + + /* index into k_reestablish_delay[] for this connection */ + size_t reestablish_delay_idx; + + /* timestamp of last re-establish attempt, in milliseconds */ + int64_t reestablish_last_ms; + /* IPA protocol identity */ struct ipaccess_unit ipa_dev; -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/30138 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: I86cdc3ba37482e6577b429194d273a2399f32208 Gerrit-Change-Number: 30138 Gerrit-PatchSet: 3 Gerrit-Owner: jtavares <jtavares(a)kvh.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-remsim[master]: rspro_client: implement re-establish delay
by laforge 19 Nov '22

19 Nov '22
Attention is currently required from: jtavares. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/30138 ) Change subject: rspro_client: implement re-establish delay ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/30138 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: I86cdc3ba37482e6577b429194d273a2399f32208 Gerrit-Change-Number: 30138 Gerrit-PatchSet: 2 Gerrit-Owner: jtavares <jtavares(a)kvh.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: jtavares <jtavares(a)kvh.com> Gerrit-Comment-Date: Sat, 19 Nov 2022 09:18:46 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • ...
  • 251
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.