<p>neels <strong>uploaded patch set #7</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25972">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">refactor lchan counting<br><br>Add chan_counts_for_trx() and chan_counts_for_bts(). Drop<br>bts_count_free_ts() and trx_count_free_ts().<br><br>Rationale:<br><br>The bts_count_free_ts() and trx_count_free_ts() always returned the<br>number of free lchans, not timeslots. Hence, passing the pchan type as<br>argument never really matched the semantics.<br><br>Especially, when looking for free SDCCH, there is no clear match on a<br>gsm_phys_chan_config enum value: SDCCH8_SACCH8C, CCCH_SDCCH4,<br>CCCH_SDCCH4_CBCH, SDCCH8_SACCH8C_CBCH? -- GSM_LCHAN_SDCCH is clear.<br><br>==> Rather count free lchans by enum gsm_chan_t.<br><br>Counting lchans of distinct types required separate iterations for each<br>lchan type.<br><br>==> Rather compose an array of counts for all types, in one go.<br><br>I need to count the amount of free SDCCH lchans in an upcoming patch to<br>implement the performance indicator allAvailableAllocatedSDCCH (cumulate<br>time for which no SDCCH are available).<br><br>To implement allAvailableAllocated{SDCCH,TCH}, I need a count of both<br>the used as well as the total lchans for a type: it does not make sense<br>to flag "all available allocated" if none are ever available.<br><br>To properly count dynamic ts, I need the maximum total that can be<br>possible at any time. And to count currently free lchans, I need the<br>current total. This may seem counter intuitive, but consider, e.g.:<br><br>- Obviously, if a cell has only static TCH/F timeslots, it does not make<br>  sense to flag that all available TCH/H are occupied, because no TCH/H<br>  are available ever. Just stating this as contrast to dyn TS.<br><br>- If a cell has OSMO_DYN timeslots, I *do* want to flag that all TCH/H<br>  are occupied when all dyn timeslots are fully occupied.<br><br>- If those OSMO_DYN however are all used as TCH/F, the current total of<br>  TCH/H becomes zero, and it seems like TCH/H should not be considered.<br><br>- To count the nr of currently free lchans, I need the currently<br>  possible total of lchans and the nr of occupied lchans.<br><br>So return both a maximum total and a current total of lchans. In above<br>example, the maximum total shows that there would be TCH/H possible.<br><br>BTW, it would be nice to keep a chan_counts array on trx, bts and bsc<br>level and update as channels are allocated and released, instead of<br>counting them all over periodically. But it's less error prone this way.<br><br>Related: SYS#4878<br>Change-Id: I2fb48c549186db812b1e9d6b735a92e80f27b8d3<br>---<br>M include/osmocom/bsc/Makefile.am<br>M include/osmocom/bsc/bts.h<br>M include/osmocom/bsc/bts_trx.h<br>A include/osmocom/bsc/chan_counts.h<br>M src/osmo-bsc/Makefile.am<br>M src/osmo-bsc/abis_rsl.c<br>M src/osmo-bsc/bts.c<br>M src/osmo-bsc/bts_trx.c<br>A src/osmo-bsc/chan_counts.c<br>M src/osmo-bsc/handover_decision_2.c<br>10 files changed, 238 insertions(+), 72 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/72/25972/7</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25972">change 25972</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/+/25972"/><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: I2fb48c549186db812b1e9d6b735a92e80f27b8d3 </div>
<div style="display:none"> Gerrit-Change-Number: 25972 </div>
<div style="display:none"> Gerrit-PatchSet: 7 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>