ns2: Add VTY option to change the max write queue size for UDP
Ensure that existing binds are updated as well.
In some cases the default max length of the osmo_io txqueue could be too
small. Set it to 128 by default and add a VTY option to change it for
an NSI (program-wide).
Change-Id: I993b87fd6b83b3981f5e293f70b931075afec715
Related: SYS#6550
diff --git a/src/gb/gprs_ns2_internal.h b/src/gb/gprs_ns2_internal.h
index 37b142e..7ac77e5 100644
--- a/src/gb/gprs_ns2_internal.h
+++ b/src/gb/gprs_ns2_internal.h
@@ -80,6 +80,8 @@
#define NS_ALLOC_SIZE 3072
#define NS_ALLOC_HEADROOM 20
+#define NS_DEFAULT_TXQUEUE_MAX_LENGTH 128
+
enum ns2_timeout {
NS_TOUT_TNS_BLOCK,
NS_TOUT_TNS_BLOCK_RETRIES,
@@ -164,6 +166,8 @@
/*! workaround for rate counter until rate counter accepts char str as index */
uint32_t nsvc_rate_ctr_idx;
uint32_t bind_rate_ctr_idx;
+
+ uint32_t txqueue_max_length;
};
@@ -450,6 +454,7 @@
struct gprs_ns2_vc_bind *ns2_ip_get_bind_by_index(struct gprs_ns2_inst *nsi,
struct osmo_sockaddr *remote,
int index);
+void ns2_ip_set_txqueue_max_length(struct gprs_ns2_vc_bind *bind, unsigned int max_length);
/* sns */
int ns2_sns_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp);