pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email )
Change subject: stream_srv: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
......................................................................
stream_srv: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
---
M TODO-RELEASE
M include/osmocom/netif/stream.h
M src/stream_srv.c
3 files changed, 50 insertions(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 15f995e..4f59788 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,4 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
-libosmo-netif add API osmo_stream_cli_set_{ip_dscp,priority}()
+libosmo-netif add API osmo_stream_cli_set_{ip_dscp,priority}(), osmo_stream_srv_link_set_{ip_dscp,priority}()
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h
index 96d8bbf..6edf915 100644
--- a/include/osmocom/netif/stream.h
+++ b/include/osmocom/netif/stream.h
@@ -70,6 +70,8 @@
void osmo_stream_srv_link_set_name(struct osmo_stream_srv_link *link, const char *name);
const char *osmo_stream_srv_link_get_name(const struct osmo_stream_srv_link *link);
void osmo_stream_srv_link_set_nodelay(struct osmo_stream_srv_link *link, bool nodelay);
+int osmo_stream_srv_link_set_priority(struct osmo_stream_srv_link *link, int sk_prio);
+int osmo_stream_srv_link_set_ip_dscp(struct osmo_stream_srv_link *link, uint8_t ip_dscp);
void osmo_stream_srv_link_set_addr(struct osmo_stream_srv_link *link, const char *addr);
int osmo_stream_srv_link_set_addrs(struct osmo_stream_srv_link *link, const char **addr, size_t addrcnt);
void osmo_stream_srv_link_set_port(struct osmo_stream_srv_link *link, uint16_t port);
diff --git a/src/stream_srv.c b/src/stream_srv.c
index a600ad9..aa7edbf 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -81,7 +81,9 @@
uint16_t port;
int sk_domain;
int sk_type;
+ int sk_prio; /* socket priority, SO_PRIORITY, default=0=unset */
uint16_t proto;
+ uint8_t ip_dscp; /* IP Differentiated services, 0..63, default=0=unset */
osmo_stream_srv_link_accept_cb_t accept_cb;
void *data;
int flags;
@@ -148,6 +150,24 @@
goto error_close_socket;
}
+ if (link->ip_dscp > 0) {
+ ret = osmo_sock_set_dscp(sock_fd, link->ip_dscp);
+ if (ret < 0) {
+ LOGSLNK(link, LOGL_ERROR, "set_ip_dscp(%u): failed setsockopt err=%d\n",
+ link->ip_dscp, errno);
+ goto error_close_socket;
+ }
+ }
+
+ if (link->sk_prio > 0) {
+ ret = osmo_sock_set_priority(sock_fd, link->sk_prio);
+ if (ret < 0) {
+ LOGSLNK(link, LOGL_ERROR, "set_priority(%d): failed setsockopt err=%d\n",
+ link->sk_prio, errno);
+ goto error_close_socket;
+ }
+ }
+
if (!link->accept_cb) {
ret = -ENOTSUP;
goto error_close_socket;
@@ -224,6 +244,33 @@
link->flags &= ~OSMO_STREAM_SRV_F_NODELAY;
}
+/*! Set the priority value of the stream socket.
+ * Setting this will automatically set the socket priority
+ * option on any socket established via this server link, before
+ * calling the accept_cb().
+ * \param[in] link server link whose sockets are to be configured
+ * \param[in] sk_prio priority value. Values outside 0..6 require CAP_NET_ADMIN.
+ * \return negative on error, 0 on success
+ */
+int osmo_stream_srv_link_set_priority(struct osmo_stream_srv_link *link, int sk_prio)
+{
+ link->sk_prio = sk_prio;
+ return 0;
+}
+
+/*! Set the DSCP (differentiated services code point) of the stream socket.
+ * Setting this will automatically set the IP DSCP option on any socket on any
+ * socket established via this server link, before calling the accept_cb().
+ * \param[in] link server link whose sockets are to be configured
+ * \param[in] ip_dscp DSCP value. Value range 0..63.
+ * \return negative on error, 0 on success
+ */
+int osmo_stream_srv_link_set_ip_dscp(struct osmo_stream_srv_link *link, uint8_t ip_dscp)
+{
+ link->ip_dscp = ip_dscp;
+ return 0;
+}
+
/*! Set the local address to which we bind.
* Any changes to this setting will only become active upon next (re)connect.
* \param[in] link Stream Server Link to modify
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
Gerrit-Change-Number: 38894
Gerrit-PatchSet: 5
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, laforge.
lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38397?usp=email )
Change subject: SGSN: BSSGP_ConnHdlr: GMM Service Request: handle PMM IDLE UE correct
......................................................................
Patch Set 4:
(1 comment)
File sgsn/BSSGP_ConnHdlr.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38397/comment/266d95e9_46bf… :
PS4, Line 640: } else {
> So in the case of `exp_service_acc := false`, this altstep repeats and will keep waiting for what ki […]
The SGSN (and this testcase) implemented Service Accept in the wrong way.
If a UE wants to transfer data in PMM_IDLE (meaning it is attached, but doesn't has an active channel),
the phone will do an Service Request.
But the correct flow would be:
(UE/RNC - SGSN)
Service Req ->
SecurityModeCommand <-
SecurityModeCommandComplete ->
There isn't a Service Accept, because it is implicit by the SecurityCommand.
But if the phone is in PMM_CONNECTED, meaning it already has a active signalling channel it would be:
Service Req ->
Service Accept <-
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38397?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I29237997e414aea80f254247da54f909410a4b36
Gerrit-Change-Number: 38397
Gerrit-PatchSet: 4
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Nov 2024 10:18:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, laforge, osmith.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38827?usp=email )
Change subject: stream_cli: Add osmo_stream_cli_set_{ip_dscp,priority}() APIs
......................................................................
Patch Set 6:
(1 comment)
File src/stream_cli.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/38827/comment/a864e072_60d5425… :
PS5, Line 983: %u
> AS of now in theory the priorities are positive (stored as a u32 in the kernel) but since the setsoc […]
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38827?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ie5954fcf7eb1276210a99baf1e445c7ad54e0bb4
Gerrit-Change-Number: 38827
Gerrit-PatchSet: 6
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Nov 2024 10:17:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, laforge, osmith.
Hello Jenkins Builder, fixeria, laforge, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-netif/+/38827?usp=email
to look at the new patch set (#6).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Code-Review+1 by osmith, Code-Review+2 by fixeria, Verified+1 by Jenkins Builder
The change is no longer submittable: Code-Review and Verified are unsatisfied now.
Change subject: stream_cli: Add osmo_stream_cli_set_{ip_dscp,priority}() APIs
......................................................................
stream_cli: Add osmo_stream_cli_set_{ip_dscp,priority}() APIs
Change-Id: Ie5954fcf7eb1276210a99baf1e445c7ad54e0bb4
---
M TODO-RELEASE
M include/osmocom/netif/stream.h
M src/stream_cli.c
3 files changed, 76 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/27/38827/6
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38827?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ie5954fcf7eb1276210a99baf1e445c7ad54e0bb4
Gerrit-Change-Number: 38827
Gerrit-PatchSet: 6
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, laforge, osmith.
Hello Jenkins Builder, fixeria, laforge, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Code-Review+1 by fixeria, Code-Review+1 by laforge, Code-Review+1 by osmith, Verified+1 by Jenkins Builder
Change subject: stream_srv: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
......................................................................
stream_srv: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
---
M TODO-RELEASE
M include/osmocom/netif/stream.h
M src/stream_srv.c
3 files changed, 50 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/94/38894/5
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
Gerrit-Change-Number: 38894
Gerrit-PatchSet: 5
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email )
Change subject: stream_srv: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
......................................................................
Patch Set 4:
(2 comments)
File src/stream_srv.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/38894/comment/ce14fd34_96d8f5e… :
PS4, Line 165: %u)
> `%d`?
Done
https://gerrit.osmocom.org/c/libosmo-netif/+/38894/comment/5c9976b1_9a25853… :
PS4, Line 258: return 0;
> No, I prefer keeping with a return in case we want to add some sort of param check or set it through […]
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
Gerrit-Change-Number: 38894
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Nov 2024 10:16:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email )
Change subject: stream_srv: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
......................................................................
Patch Set 4:
(1 comment)
File src/stream_srv.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/38894/comment/484302d3_62a3cc8… :
PS4, Line 258: return 0;
> Maybe just change to `void`?
No, I prefer keeping with a return in case we want to add some sort of param check or set it through setsockopt at the future, etc.
We are already hit by some APIs which were not returning an error code initially and now are left with no information of error despite being able to fail, like osmo_stream_cli_send() (eg. iofd queue going full).
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
Gerrit-Change-Number: 38894
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Nov 2024 10:12:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>