<p style="white-space: pre-wrap; word-wrap: break-word;">I know this patch is already merged, sorry for being late here.<br>Maybe some of my comments could warrant a follow-up patch?</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876">View Change</a></p><p>8 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876/4/src/osmo-bsc/abis_rsl.c">File src/osmo-bsc/abis_rsl.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876/4/src/osmo-bsc/abis_rsl.c@1921">Patch Set #4, Line 1921:</a> <code style="font-family:monospace,monospace"></code></p><p style="white-space: pre-wrap; word-wrap: break-word;">(2 blank lines)</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876/4/src/osmo-bsc/abis_rsl.c@1927">Patch Set #4, Line 1927:</a> <code style="font-family:monospace,monospace">                                       lchan->ts->pchan_is != GSM_PCHAN_SDCCH8_SACCH8C;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">i'd favor a bunch of braces</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876/4/src/osmo-bsc/abis_rsl.c@1930">Patch Set #4, Line 1930:</a> <code style="font-family:monospace,monospace">   free_tcch = bts_count_free_ts(bts, GSM_PCHAN_TCH_H);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">"tchh"</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876/4/src/osmo-bsc/abis_rsl.c@1938">Patch Set #4, Line 1938:</a> <code style="font-family:monospace,monospace">    /* There's a TCH available and we'll not switch any of them, so we are fine */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">"switch any dyn ts"</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876/4/src/osmo-bsc/abis_rsl.c@1942">Patch Set #4, Line 1942:</a> <code style="font-family:monospace,monospace">     /* We need to switch, but there's at least 2 TCH TS available so we are fine: */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">"so we can switch one of them to SDCCH8 and still have one left"</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876/4/src/osmo-bsc/abis_rsl.c@1951">Patch Set #4, Line 1951:</a> <code style="font-family:monospace,monospace">   * If condition [C] is met, it means there's 1 dynamic TS and it's the</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">"because a dyn TS is counted both as 1 free TCH/F and 2 free TCH/H at the same time"</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876/4/src/osmo-bsc/abis_rsl.c@1955">Patch Set #4, Line 1955:</a> <code style="font-family:monospace,monospace">     * different TS than the one we want to switch, so we are fine selecting</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">"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"</p><p style="white-space: pre-wrap; word-wrap: break-word;">But for C, what if there are two half occupied TCH/H plus one static TCH/F?<br>Wouldn't you make the wrong assumption that it is a dyn TS based on the counts?</p><p style="white-space: pre-wrap; word-wrap: break-word;">In the end I think your logic is correct, but the explanation becomes a lot simpler if you do</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  if (needs_dyn_switch) {<br>      free_tchf--;<br>      free_tchh -= 2;<br>  }</pre><p style="white-space: pre-wrap; word-wrap: break-word;">and see if any tch are left after that.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876/4/src/osmo-bsc/abis_rsl.c@1967">Patch Set #4, Line 1967:</a> <code style="font-family:monospace,monospace">  lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">doing 'type = SDCCH' would be all that's needed indeed, and add a logging 'LOG_LCHAN(lchan, LOGL_INFO, "Selected\n");'</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876">change 24876</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bsc/+/24876"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I3b32968949a7bdcbebf5a823359295bac51d8e08 </div>
<div style="display:none"> Gerrit-Change-Number: 24876 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 14 Jul 2021 21:15:29 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>