This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
fixeria gerrit-no-reply at lists.osmocom.orgfixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/20700 ) Change subject: scheduler: remove pending Tx prims on lchan deactivation ...................................................................... scheduler: remove pending Tx prims on lchan deactivation Sometimes the following messages appear in the logging output: TCH/F: Prim has wrong chan_nr=0xc5 link_id=00, expecting chan_nr=0x0d link_id=00 TCH/F: Prim has wrong chan_nr=0xc2 link_id=00, expecting chan_nr=0x0a link_id=00 when a dynamic timeslot is switched from PDCH to TCH/F (or to TCH/H). This means that the transmit queue of a timeslot still contains PDCH frames, that were not properly cleaned on PDCH deactivation. Let's finally do this in trx_sched_set_lchan(). Change-Id: Ic6560c660c658f36b84e7efa2f1d93e3a870962b Related: OS#4804 --- M src/common/scheduler.c 1 file changed, 34 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/00/20700/1 diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 328a73f..975d213 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -970,6 +970,37 @@ return 0; } +/* Remove all matching (by chan_nr & link_id) primitives from the given queue */ +static void trx_sched_queue_filter(struct llist_head *q, uint8_t chan_nr, uint8_t link_id) +{ + struct msgb *msg, *_msg; + + llist_for_each_entry_safe(msg, _msg, q, list) { + struct osmo_phsap_prim *l1sap = msgb_l1sap_prim(msg); + switch (l1sap->oph.primitive) { + case PRIM_PH_DATA: + if (l1sap->u.data.chan_nr != chan_nr) + continue; + if (l1sap->u.data.link_id != link_id) + continue; + break; + case PRIM_TCH: + if (l1sap->u.tch.chan_nr != chan_nr) + continue; + if (link_id != 0x00) + continue; + break; + default: + /* Shall not happen */ + continue; + } + + /* Unlink and free() */ + llist_del(&msg->list); + talloc_free(msg); + } +} + /* setting all logical channels given attributes to active/inactive */ int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_id, bool active) { @@ -1013,6 +1044,9 @@ OSMO_ASSERT(chan_state->lchan != NULL); } else { chan_state->ho_rach_detect = 0; + + /* Remove pending Tx prims belonging to this lchan */ + trx_sched_queue_filter(&l1ts->dl_prims, chan_nr, link_id); } chan_state->active = active; -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/20700 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ic6560c660c658f36b84e7efa2f1d93e3a870962b Gerrit-Change-Number: 20700 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201017/7a1f5333/attachment.htm>