Change in osmo-bts[master]: Introduce ability to set socket priority of RTP sockets

laforge gerrit-no-reply at lists.osmocom.org
Fri Apr 30 09:44:52 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/23987 )

Change subject: Introduce ability to set socket priority of RTP sockets
......................................................................

Introduce ability to set socket priority of RTP sockets

This significantly simplifies setups in which not only the IP DSCP
but also the IEEE 802.1Q PCP is to be set for RTP packets.

Depends: libosmo-abis.git I52c08f4b2a46981d002ef0c21e6549445d845a6e
Change-Id: Ia3a91e6788285be3e2e73defee63e6bd79c6258e
Related: SYS#5427
---
M TODO-RELEASE
M include/osmo-bts/bts.h
M src/common/bts.c
M src/common/rsl.c
M src/common/vty.c
5 files changed, 26 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/TODO-RELEASE b/TODO-RELEASE
index e69de29..9b000e3 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -0,0 +1 @@
+update libosmo-abis dependency to > 1.1.1 for osmo_rtp_socket_set_priority()
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index be0222d..7a1085e 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -297,6 +297,7 @@
 	uint16_t rtp_port_range_end;
 	uint16_t rtp_port_range_next;
 	int rtp_ip_dscp;
+	int rtp_priority;
 
 	struct {
 		uint8_t ciphers;	/* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
diff --git a/src/common/bts.c b/src/common/bts.c
index 06a5ccb..3860a87 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -329,6 +329,7 @@
 	bts->rtp_port_range_end = 17407;
 	bts->rtp_port_range_next = bts->rtp_port_range_start;
 	bts->rtp_ip_dscp = -1;
+	bts->rtp_priority = -1;
 
 	/* Default (fall-back) MS/BS Power control parameters */
 	bts->bs_dpc_params = power_ctrl_params_def;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 963e6ba..cd3fda5 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2433,6 +2433,11 @@
 				LOGP(DRSL, LOGL_ERROR, "failed to set DSCP=%i: %s\n",
 					bts->rtp_ip_dscp, strerror(errno));
 		}
+		if (bts->rtp_priority != -1) {
+			if (osmo_rtp_socket_set_priority(rs, bts->rtp_priority))
+				LOGP(DRSL, LOGL_ERROR, "failed to set socket priority %d: %s\n",
+					bts->rtp_priority, strerror(errno));
+		}
 		return 0;
 	}
 
diff --git a/src/common/vty.c b/src/common/vty.c
index 45ee32c..626cd60 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -300,6 +300,8 @@
 		bts->rtp_port_range_end, VTY_NEWLINE);
 	if (bts->rtp_ip_dscp != -1)
 		vty_out(vty, " rtp ip-dscp %i%s", bts->rtp_ip_dscp, VTY_NEWLINE);
+	if (bts->rtp_priority != -1)
+		vty_out(vty, " rtp socket-priority %i%s", bts->rtp_priority, VTY_NEWLINE);
 	vty_out(vty, " paging queue-size %u%s", paging_get_queue_max(bts->paging_state),
 		VTY_NEWLINE);
 	vty_out(vty, " paging lifetime %u%s", paging_get_lifetime(bts->paging_state),
@@ -595,6 +597,21 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN_USRATTR(cfg_bts_rtp_priority,
+	      cfg_bts_rtp_priority_cmd,
+	      X(BTS_VTY_ATTR_NEW_LCHAN),
+	      "rtp socket-priority <0-255>",
+	      RTP_STR "Specify socket priority for RTP/IP packets\n"
+	      "The socket priority value (> 6 requires CAP_NET_ADMIN)\n")
+{
+	struct gsm_bts *bts = vty->index;
+	int prio = atoi(argv[0]);
+
+	bts->rtp_priority = prio;
+
+	return CMD_SUCCESS;
+}
+
 #define PAG_STR "Paging related parameters\n"
 
 DEFUN_ATTR(cfg_bts_paging_queue_size,
@@ -2312,6 +2329,7 @@
 	install_element(BTS_NODE, &cfg_bts_rtp_jitbuf_cmd);
 	install_element(BTS_NODE, &cfg_bts_rtp_port_range_cmd);
 	install_element(BTS_NODE, &cfg_bts_rtp_ip_dscp_cmd);
+	install_element(BTS_NODE, &cfg_bts_rtp_priority_cmd);
 	install_element(BTS_NODE, &cfg_bts_band_cmd);
 	install_element(BTS_NODE, &cfg_description_cmd);
 	install_element(BTS_NODE, &cfg_no_description_cmd);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/23987
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ia3a91e6788285be3e2e73defee63e6bd79c6258e
Gerrit-Change-Number: 23987
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210430/ced096aa/attachment.htm>


More information about the gerrit-log mailing list