<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/19027">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Send a BVC-RESET to all presistent Gb interfaces at start-up<br><br>3GPP TS 48.018 Section 8.4:<br><br>> After any failure affecting the NSE, the party (BSS or SGSN) where<br>> the failure resided shall reset the signalling BVC. After sending or<br>> receiving a BVC-RESET PDU for the signalling BVC, the BSS shall stop all<br>> traffic and initiate the BVC-RESET procedure for all BVCs corresponding<br>> to PTP functional entities of the underlying network service entity. The<br>> BSS must complete the BVC-RESET procedure for signalling BVC before<br>> starting PTP BVC-RESET procedures.<br><br>TODO: We should not just trigger a single outbound BVC-RESET message,<br>but we should re-transmit them until we get a response.   This would<br>likely entail adding FSMs to libosmogb, which we will leave for a later<br>point - it's anticipated that the NS + BSSGP code is undergoing quite<br>some changes in the coming months anyway, so leave it for then.<br><br>Change-Id: I0b46035b40709c38bb9ab9493c11031a577e3ee0<br>Closes: OS#4629<br>Depends: libosmocore.git I353adc1aa72377f7d4b3336d2ff47791fb73d62c<br>---<br>M src/sgsn/sgsn_main.c<br>1 file changed, 20 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/27/19027/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c</span><br><span>index 3b18b05..5b53815 100644</span><br><span>--- a/src/sgsn/sgsn_main.c</span><br><span>+++ b/src/sgsn/sgsn_main.c</span><br><span>@@ -42,6 +42,7 @@</span><br><span> </span><br><span> #include <osmocom/gprs/gprs_ns.h></span><br><span> #include <osmocom/gprs/gprs_bssgp.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/gprs/gprs_bssgp_bss.h></span><br><span> </span><br><span> #include <osmocom/vty/telnet_interface.h></span><br><span> #include <osmocom/vty/logging.h></span><br><span>@@ -199,6 +200,23 @@</span><br><span> #endif</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static void bvc_reset_persistent_nsvcs(void)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Send BVC-RESET on all persistent NSVCs */</span><br><span style="color: hsl(120, 100%, 40%);">+  struct gprs_nsvc *nsvc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     llist_for_each_entry(nsvc, &sgsn_nsi->gprs_nsvcs, list) {</span><br><span style="color: hsl(120, 100%, 40%);">+              struct bssgp_bvc_ctx bctx = {</span><br><span style="color: hsl(120, 100%, 40%);">+                 .nsei = nsvc->nsei,</span><br><span style="color: hsl(120, 100%, 40%);">+                };</span><br><span style="color: hsl(120, 100%, 40%);">+            if (!nsvc->persistent)</span><br><span style="color: hsl(120, 100%, 40%);">+                     continue;</span><br><span style="color: hsl(120, 100%, 40%);">+             /* if it is not marked ALIVE, we cannot send any data over it. */</span><br><span style="color: hsl(120, 100%, 40%);">+             nsvc->state |= NSE_S_ALIVE;</span><br><span style="color: hsl(120, 100%, 40%);">+                bssgp_tx_bvc_reset2(&bctx, BVCI_SIGNALLING, BSSGP_CAUSE_EQUIP_FAIL, false);</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static struct vty_app_info vty_info = {</span><br><span>    .name           = "OsmoSGSN",</span><br><span>      .version        = PACKAGE_VERSION,</span><br><span>@@ -522,6 +540,8 @@</span><br><span>     ranap_iu_init(tall_sgsn_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event);</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     bvc_reset_persistent_nsvcs();</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>      if (daemonize) {</span><br><span>             rc = osmo_daemonize();</span><br><span>               if (rc < 0) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/19027">change 19027</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-sgsn/+/19027"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sgsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I0b46035b40709c38bb9ab9493c11031a577e3ee0 </div>
<div style="display:none"> Gerrit-Change-Number: 19027 </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-MessageType: newchange </div>