Change in osmo-bts[rel-1.3.2]: osmo-bts-trx: fix hopping pointer bug in bts_sched_fn()

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.org
Wed May 19 20:11:29 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/24307 )


Change subject: osmo-bts-trx: fix hopping pointer bug in bts_sched_fn()
......................................................................

osmo-bts-trx: fix hopping pointer bug in bts_sched_fn()

In change [1] together with the actual implementation I introduced
a serious bug to bts_sched_fn(): if a timeslot is configured to use
frequency hopping, both 'pinst' and 'l1h' pointers are *overwriten*
in the inner loop, so the Downlink burst is re-directed to the
approproate PHY instance.  However, if a subsequent timeslot is not
hopping, the Downlink burst would be re-directed to the wrong PHY
instance because both pointers were overwriten during a previous
iteration.

Let's move the 'struct phy_instance' pointer to the inner loop, so
it's properly re-initialized for each timeslot iteration.

Change-Id: I9afbbef8dc5d885763356470c27d4392dce8e815
Fixes: [1] I68f4ae09fd0789ad0d8f1c1e17e17dfc4de8e462
Related: SYS#4868, OS#4546
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 6 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/24307/1

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 43fa273..efca870 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -107,9 +107,9 @@
 
 	/* process every TRX */
 	llist_for_each_entry(trx, &bts->trx_list, list) {
-		struct phy_instance *pinst = trx->role_bts.l1h;
-		struct phy_link *plink = pinst->phy_link;
-		struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+		const struct phy_instance *_pinst = trx->role_bts.l1h;
+		const struct phy_link *plink = _pinst->phy_link;
+		struct trx_l1h *l1h = _pinst->u.osmotrx.hdl;
 		struct l1sched_trx *l1t = &l1h->l1s;
 
 		/* we don't schedule, if power is off */
@@ -122,6 +122,8 @@
 
 		/* process every TS of TRX */
 		for (tn = 0; tn < ARRAY_SIZE(l1t->ts); tn++) {
+			const struct phy_instance *pinst = _pinst;
+
 			/* ready-to-send */
 			_sched_rts(l1t, tn, GSM_TDMA_FN_SUM(sched_fn, plink->u.osmotrx.rts_advance));
 
@@ -143,7 +145,6 @@
 				pinst = dlfh_route_br(&br, &trx->ts[tn]);
 				if (pinst == NULL)
 					continue;
-				l1h = pinst->u.osmotrx.hdl;
 			}
 
 			if (pinst->trx == bts->c0) {
@@ -153,7 +154,7 @@
 				br.att = 0;
 			}
 
-			trx_if_send_burst(l1h, &br);
+			trx_if_send_burst(pinst->u.osmotrx.hdl, &br);
 		}
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24307
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: rel-1.3.2
Gerrit-Change-Id: I9afbbef8dc5d885763356470c27d4392dce8e815
Gerrit-Change-Number: 24307
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/20210519/6ceffa28/attachment.htm>


More information about the gerrit-log mailing list