pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/41436?usp=email ) Change subject: iuh: Allow setting tx-queue-max-length for all HNBs ...................................................................... iuh: Allow setting tx-queue-max-length for all HNBs Related: SYS#7693 Change-Id: I8bc9e8bae7a4815dc2f2bc9e15401e01948d1748 --- M include/osmocom/hnbgw/hnbgw.h M src/osmo-hnbgw/hnbgw.c M src/osmo-hnbgw/hnbgw_vty.c M src/osmo-hnbgw/osmo_hnbgw_main.c M tests/osmo-hnbgw.vty 5 files changed, 42 insertions(+), 0 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified daniel: Looks good to me, approved diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h index e26ae2d..86fded3 100644 --- a/include/osmocom/hnbgw/hnbgw.h +++ b/include/osmocom/hnbgw/hnbgw.h @@ -71,6 +71,8 @@ #define IUH_MSGB_SIZE 2048 +#define IUH_TX_QUEUE_MAX_LENGTH 1024 + struct hnbgw_context_map; static inline bool cnlink_is_cs(const struct hnbgw_cnlink *cnlink) @@ -96,6 +98,9 @@ bool accept_all_hnb; struct mgcp_client_conf *mgcp_client; struct { + unsigned int tx_queue_max_length; + } iuh; + struct { char *local_addr; uint16_t local_port; char *remote_addr; diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c index d237928..a8f827c 100644 --- a/src/osmo-hnbgw/hnbgw.c +++ b/src/osmo-hnbgw/hnbgw.c @@ -216,6 +216,7 @@ g_hnbgw->config.hnbap_allow_tmsi = true; g_hnbgw->config.log_prefix_hnb_id = true; g_hnbgw->config.accept_all_hnb = true; + g_hnbgw->config.iuh.tx_queue_max_length = IUH_TX_QUEUE_MAX_LENGTH; /* Set zero PLMN to detect a missing PLMN when transmitting RESET */ g_hnbgw->config.plmn = (struct osmo_plmn_id){ 0, 0, false }; diff --git a/src/osmo-hnbgw/hnbgw_vty.c b/src/osmo-hnbgw/hnbgw_vty.c index f1b128c..c74c5db 100644 --- a/src/osmo-hnbgw/hnbgw_vty.c +++ b/src/osmo-hnbgw/hnbgw_vty.c @@ -318,6 +318,18 @@ return CMD_SUCCESS; } +DEFUN(cfg_hnbgw_iuh_tx_queue_max_length, cfg_hnbgw_iuh_tx_queue_max_length_cmd, + "tx-queue-max-length <0-65535>", + "Maximum transmit queue length, in msgbs\n" + "Amount of msgbs which can be queued at maximum in the transmit queue\n") +{ + g_hnbgw->config.iuh.tx_queue_max_length = atoi(argv[0]); + if (g_hnbgw->iuh) + osmo_stream_srv_link_set_tx_queue_max_length(g_hnbgw->iuh, + g_hnbgw->config.iuh.tx_queue_max_length); + return CMD_SUCCESS; +} + DEFUN(cfg_hnbgw_iuh_hnbap_allow_tmsi, cfg_hnbgw_iuh_hnbap_allow_tmsi_cmd, "hnbap-allow-tmsi (0|1)", "Allow HNBAP UE Register messages with TMSI or PTMSI identity\n" @@ -1039,6 +1051,9 @@ if (port && port != IUH_DEFAULT_SCTP_PORT) vty_out(vty, " local-port %u%s", port, VTY_NEWLINE); + if (g_hnbgw->config.iuh.tx_queue_max_length != IUH_TX_QUEUE_MAX_LENGTH) + vty_out(vty, " tx-queue-max-length %u%s", g_hnbgw->config.iuh.tx_queue_max_length, VTY_NEWLINE); + if (!g_hnbgw->config.hnbap_allow_tmsi) vty_out(vty, " hnbap-allow-tmsi 0%s", VTY_NEWLINE); @@ -1125,6 +1140,7 @@ install_element(IUH_NODE, &cfg_hnbgw_iuh_local_ip_cmd); install_element(IUH_NODE, &cfg_hnbgw_iuh_local_port_cmd); + install_element(IUH_NODE, &cfg_hnbgw_iuh_tx_queue_max_length_cmd); install_element(IUH_NODE, &cfg_hnbgw_iuh_hnbap_allow_tmsi_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_iucs_cmd); diff --git a/src/osmo-hnbgw/osmo_hnbgw_main.c b/src/osmo-hnbgw/osmo_hnbgw_main.c index b8b1b0b..1664f02 100644 --- a/src/osmo-hnbgw/osmo_hnbgw_main.c +++ b/src/osmo-hnbgw/osmo_hnbgw_main.c @@ -316,6 +316,7 @@ osmo_stream_srv_link_set_port(srv, g_hnbgw->config.iuh_local_port); osmo_stream_srv_link_set_accept_cb(srv, hnbgw_rua_accept_cb); osmo_stream_srv_link_set_msgb_alloc_info(srv, IUH_MSGB_SIZE, 0); + osmo_stream_srv_link_set_tx_queue_max_length(srv, g_hnbgw->config.iuh.tx_queue_max_length); if (osmo_stream_srv_link_open(srv) < 0) { perror("Cannot open server"); diff --git a/tests/osmo-hnbgw.vty b/tests/osmo-hnbgw.vty index 391605b..c3e1f11 100644 --- a/tests/osmo-hnbgw.vty +++ b/tests/osmo-hnbgw.vty @@ -84,6 +84,25 @@ rnc-id 42 ... +OsmoHNBGW(config-hnbgw)# iuh +OsmoHNBGW(config-hnbgw-iuh)# list +... + local-ip A.B.C.D + local-port <1-65535> + tx-queue-max-length <0-65535> + hnbap-allow-tmsi (0|1) +... + +OsmoHNBGW(config-hnbgw-iuh)# tx-queue-max-length 2000 +OsmoHNBGW(config-hnbgw-iuh)# show running-config +... +hnbgw +... + iuh + tx-queue-max-length 2000 +... +OsmoHNBGW(config-hnbgw-iuh)# exit + OsmoHNBGW(config-hnbgw)# nft-kpi? nft-kpi Retrieve traffic counters from nftables OsmoHNBGW(config-hnbgw)# nft-kpi ? -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/41436?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I8bc9e8bae7a4815dc2f2bc9e15401e01948d1748 Gerrit-Change-Number: 41436 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-CC: laforge <laforge@osmocom.org>