Change in osmo-bsc[master]: Avoid switching dyn ts to sdcch8 if it starves later TCH

neels gerrit-no-reply at
Wed Jul 14 21:15:29 UTC 2021

neels has posted comments on this change. ( )

Change subject: Avoid switching dyn ts to sdcch8 if it starves later TCH

Patch Set 4:


I know this patch is already merged, sorry for being late here.
Maybe some of my comments could warrant a follow-up patch? 
File src/osmo-bsc/abis_rsl.c: 
PS4, Line 1921: 
(2 blank lines) 
PS4, Line 1927: 					lchan->ts->pchan_is != GSM_PCHAN_SDCCH8_SACCH8C;
i'd favor a bunch of braces 
PS4, Line 1930: 	free_tcch = bts_count_free_ts(bts, GSM_PCHAN_TCH_H);
PS4, Line 1938: 	/* There's a TCH available and we'll not switch any of them, so we are fine */
"switch any dyn ts" 
PS4, Line 1942: 	/* We need to switch, but there's at least 2 TCH TS available so we are fine: */
"so we can switch one of them to SDCCH8 and still have one left" 
PS4, Line 1951: 	 * If condition [C] is met, it means there's 1 dynamic TS and it's the
"because a dyn TS is counted both as 1 free TCH/F and 2 free TCH/H at the same time" 
PS4, Line 1955: 	 * different TS than the one we want to switch, so we are fine selecting
"A: the free TCH/F must be a static timeslot; B1: half occupied TCH/H TS; B2: half occupied TCH/H TS plus one static TCH/F; C: exactly one dyn TS available"

But for C, what if there are two half occupied TCH/H plus one static TCH/F?
Wouldn't you make the wrong assumption that it is a dyn TS based on the counts?

In the end I think your logic is correct, but the explanation becomes a lot simpler if you do

  if (needs_dyn_switch) {
      free_tchh -= 2;

and see if any tch are left after that. 
PS4, Line 1967: 	lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH);
doing 'type = SDCCH' would be all that's needed indeed, and add a logging 'LOG_LCHAN(lchan, LOGL_INFO, "Selected\n");'

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3b32968949a7bdcbebf5a823359295bac51d8e08
Gerrit-Change-Number: 24876
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at>
Gerrit-Reviewer: laforge <laforge at>
Gerrit-Reviewer: neels <nhofmeyr at>
Gerrit-Reviewer: pespin <pespin at>
Gerrit-Comment-Date: Wed, 14 Jul 2021 21:15:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list