<p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/21825">View Change</a></p><p>2 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/+/21825/1/src/osmo-bsc/bts.c">File src/osmo-bsc/bts.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/+/21825/1/src/osmo-bsc/bts.c@513">Patch Set #1, Line 513:</a> <code style="font-family:monospace,monospace"> if (model->trx_init) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I would rather hook all this into vty_go_parent cb so that it is called at the end of config (you ca […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">All of this sucks (and has sucked ever since we supported more than one BTS type/model). You already run into massive problems today when you change the type back and forth at runtime, as we have various initialization and no cleanup.</p><p style="white-space: pre-wrap; word-wrap: break-word;">So if you wanted to do this properly, you'd also have to add cleanup functions and whenever setting the type/model, first run cleanup of the old model, then init of the new one.</p><p style="white-space: pre-wrap; word-wrap: break-word;">If you want to do it at every go_parent from the BTS, you would have to memorize of what the old type was at entering the node, and what the new type is. So you can figure out if any change was made, and then only call the init if there was any change.</p><p style="white-space: pre-wrap; word-wrap: break-word;">As there is no funding for this work, I just wanted to improve the usability (i.e. persistent MO FSMs that you can show) with minimal effort.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/21825/1/src/osmo-bsc/bts_trx.c">File src/osmo-bsc/bts_trx.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/+/21825/1/src/osmo-bsc/bts_trx.c@123">Patch Set #1, Line 123:</a> <code style="font-family:monospace,monospace"> if (bts->model && bts->model->trx_init) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I find a bit strange that you call trx_init() here and in the previous file too. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I put a comment at the other invocation:</p><p style="white-space: pre-wrap; word-wrap: break-word;">"/* handle those TRX which are already allocated at the time we set the type */"</p><p style="white-space: pre-wrap; word-wrap: break-word;">The point is when we allocate a BTS, we always allocate TRX0 as it's mandatory. And at the time of allocation we don't know the type yet, and hence we cannot do type/model specific initialization. So there is one path invoked when you add trx >=1 in the vty (here) and one path for the trx0 which pre-exists when you set the type.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/21825">change 21825</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/+/21825"/><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: Icbad9cdc12221c9ad997267d77e5414edcbac538 </div>
<div style="display:none"> Gerrit-Change-Number: 21825 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 22 Dec 2020 11:08:00 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>