<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10371">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bssgp: introduce flush queue functions<br><br>To reset the state of BSSGP allow to flush the BSSGP queues.<br>Introduce the functions:<br>bssgp_fc_flush_queue()<br>bssgp_flush_all_queues()<br><br>Change-Id: I29b6ad6742ddf9b0b58b4af37d9a1cf18e019325<br>---<br>M include/osmocom/gprs/gprs_bssgp.h<br>M src/gb/gprs_bssgp.c<br>M src/gb/libosmogb.map<br>3 files changed, 25 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/71/10371/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/gprs/gprs_bssgp.h b/include/osmocom/gprs/gprs_bssgp.h</span><br><span>index 2dead69..400c3e0 100644</span><br><span>--- a/include/osmocom/gprs/gprs_bssgp.h</span><br><span>+++ b/include/osmocom/gprs/gprs_bssgp.h</span><br><span>@@ -207,6 +207,9 @@</span><br><span> int bssgp_fc_ms_init(struct bssgp_flow_control *fc_ms, uint16_t bvci,</span><br><span>                      uint16_t nsei, uint32_t max_queue_depth);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+void bssgp_flush_all_queues();</span><br><span style="color: hsl(120, 100%, 40%);">+void bssgp_fc_flush_queue(struct bssgp_flow_control *fc);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* gprs_bssgp_vty.c */</span><br><span> int bssgp_vty_init(void);</span><br><span> void bssgp_set_log_ss(int ss);</span><br><span>diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c</span><br><span>index 5dfce16..fb79cf8 100644</span><br><span>--- a/src/gb/gprs_bssgp.c</span><br><span>+++ b/src/gb/gprs_bssgp.c</span><br><span>@@ -1263,3 +1263,23 @@</span><br><span> {</span><br><span>      DBSSGP = ss;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+void bssgp_fc_flush_queue(struct bssgp_flow_control *fc)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      struct bssgp_fc_queue_element *element, *tmp;</span><br><span style="color: hsl(120, 100%, 40%);">+ llist_for_each_entry_safe(element, tmp, &fc->queue, list) {</span><br><span style="color: hsl(120, 100%, 40%);">+            msgb_free(element->msg);</span><br><span style="color: hsl(120, 100%, 40%);">+           llist_del(element);</span><br><span style="color: hsl(120, 100%, 40%);">+           talloc_free(element);</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 style="color: hsl(120, 100%, 40%);">+void bssgp_flush_all_queues()</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      struct bssgp_bvc_ctx *bctx;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ llist_for_each_entry(bctx, &bssgp_bvc_ctxts, list) {</span><br><span style="color: hsl(120, 100%, 40%);">+              if (bctx->fc)</span><br><span style="color: hsl(120, 100%, 40%);">+                      bssgp_fc_flush_queue(bctx->fc);</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map</span><br><span>index d56e651..ec69670 100644</span><br><span>--- a/src/gb/libosmogb.map</span><br><span>+++ b/src/gb/libosmogb.map</span><br><span>@@ -6,6 +6,8 @@</span><br><span> bssgp_fc_in;</span><br><span> bssgp_fc_init;</span><br><span> bssgp_fc_ms_init;</span><br><span style="color: hsl(120, 100%, 40%);">+bssgp_fc_flush_queue;</span><br><span style="color: hsl(120, 100%, 40%);">+bssgp_flush_all_queues;</span><br><span> bssgp_msgb_alloc;</span><br><span> bssgp_msgb_copy;</span><br><span> bssgp_msgb_tlli_put;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10371">change 10371</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/10371"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I29b6ad6742ddf9b0b58b4af37d9a1cf18e019325 </div>
<div style="display:none"> Gerrit-Change-Number: 10371 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>