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_udp.c b/src/gb/gprs_ns2_udp.c
index f24eae6..1dcc303 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -336,6 +336,7 @@
 	priv->iofd = osmo_iofd_setup(bind, rc, "NS bind", OSMO_IO_FD_MODE_RECVFROM_SENDTO, &ioops, bind);
 	osmo_iofd_register(priv->iofd, rc);
 	osmo_iofd_set_alloc_info(priv->iofd, 4096, 128);
+	osmo_iofd_set_txqueue_max_length(priv->iofd, nsi->txqueue_max_length);
 
 	/* IPv4: max fragmented payload can be (13 bit) * 8 byte => 65535.
 	 * IPv6: max payload can be 65535 (RFC 2460).
@@ -574,6 +575,14 @@
 	return NULL;
 }
 
+void ns2_ip_set_txqueue_max_length(struct gprs_ns2_vc_bind *bind, unsigned int max_length)
+{
+	struct priv_bind *priv = bind->priv;
+	OSMO_ASSERT(gprs_ns2_is_ip_bind(bind));
+
+	osmo_iofd_set_txqueue_max_length(priv->iofd, max_length);
+}
+
 /*! set the signalling and data weight for this bind
  * \param[in] bind
  * \param[in] signalling the signalling weight