pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29497 )
Change subject: osmux: Avoid duplicated RTP msg trigger Tx of osmux frame
......................................................................
osmux: Avoid duplicated RTP msg trigger Tx of osmux frame
The RTP msg will be dropped, so it makes no sense to signal the caller
to deliver the batchbeing built, since it may still have space for next
non-duplicated message.
The exception is the case where the new packet has the M marker bit set,
since the sequence numbers can be reset or jump in those scenarios.
Change-Id: Idc457bc3b26bed68796d714bc3f37a2d016ba5c3
---
M src/osmux.c
1 file changed, 10 insertions(+), 10 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/osmux.c b/src/osmux.c
index 4851998..51642ab 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -691,22 +691,12 @@
return -1;
}
- /* First check if there is room for this message in the batch */
- bytes += amr_payload_len;
- if (circuit->nmsgs == 0)
- bytes += sizeof(struct osmux_hdr);
-
- /* No room, sorry. You'll have to retry */
- if (bytes > batch->remaining_bytes)
- return 1;
-
/* Init of talkspurt (RTP M marker bit) needs to be in the first AMR slot
* of the OSMUX packet, enforce sending previous batch if required:
*/
if (rtph->marker && circuit->nmsgs != 0)
return 1;
-
/* Extra validation: check if this message already exists, should not
* happen but make sure we don't propagate duplicated messages.
*/
@@ -723,6 +713,16 @@
return -1;
}
}
+
+ /* First check if there is room for this message in the batch */
+ bytes += amr_payload_len;
+ if (circuit->nmsgs == 0)
+ bytes += sizeof(struct osmux_hdr);
+
+ /* No room, sorry. You'll have to retry */
+ if (bytes > batch->remaining_bytes)
+ return 1;
+
/* Handle RTP packet loss scenario */
osmux_replay_lost_packets(circuit, rtph, batch_factor);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29497
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Idc457bc3b26bed68796d714bc3f37a2d016ba5c3
Gerrit-Change-Number: 29497
Gerrit-PatchSet: 1
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>
Gerrit-MessageType: merged
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29498 )
Change subject: osmux: Change order of lines to follow packet fill order
......................................................................
osmux: Change order of lines to follow packet fill order
The osmux header goes before in the packet, so let's move the line
checking is size before the content.
Change-Id: I33feac834700d22ed06472d8971abd0567ce623b
---
M src/osmux.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/osmux.c b/src/osmux.c
index 51642ab..bd05f76 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -715,9 +715,9 @@
}
/* First check if there is room for this message in the batch */
- bytes += amr_payload_len;
if (circuit->nmsgs == 0)
bytes += sizeof(struct osmux_hdr);
+ bytes += amr_payload_len;
/* No room, sorry. You'll have to retry */
if (bytes > batch->remaining_bytes)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29498
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I33feac834700d22ed06472d8971abd0567ce623b
Gerrit-Change-Number: 29498
Gerrit-PatchSet: 1
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: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29512 )
Change subject: osmux: Proper encoding of osmux frames when when AMR FT changes
......................................................................
Patch Set 1: Code-Review+2
(2 comments)
File src/osmux.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/29512/comment/8a360230_5d7dc04c
PS1, Line 470: !state.rtph
> Why are you changing this? I guess because below in your code you're doing !foo. […]
I just really rewrote the whole code several times before finding the best way, so it ended up this way.
https://gerrit.osmocom.org/c/libosmo-netif/+/29512/comment/e3863d66_a8d8bdc1
PS1, Line 535: struct amr_hdr *amrh
> const?
I'll do a full pass of constifying everything possible in a follow up patch, I bet several things can be marked as const.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29512
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I25eb6ee54c898f575cc71ccfd6d190fe51d56dbe
Gerrit-Change-Number: 29512
Gerrit-PatchSet: 1
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: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 29 Sep 2022 09:32:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels, fixeria, msuraev, dexter.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/28995 )
Change subject: Add osmo_sockaddr_str helpers to print without port
......................................................................
Patch Set 9: Code-Review-2
(1 comment)
File include/osmocom/core/sockaddr_str.h:
https://gerrit.osmocom.org/c/libosmocore/+/28995/comment/d989bad6_9260ed6c
PS9, Line 64: ((R) && (R)->af == AF_INET6) ? "[" : "", \
IIUC the only need for using [] in IPv6 addresses is to differentiate the address from the port part. Since there's no port here the claudators are not needed.
And since those are not needed, I see no real point in having separate format since you can basically do:
log(..., "%s", addr->ip);
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28995
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I36f20701663c3c7eae7fedc6551da44800b325bf
Gerrit-Change-Number: 28995
Gerrit-PatchSet: 9
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 29 Sep 2022 09:29:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29517 )
Change subject: osmux: Mark unused osmux_in_handle field as deprecated
......................................................................
Patch Set 2:
(1 comment)
File include/osmocom/netif/osmux.h:
https://gerrit.osmocom.org/c/libosmo-netif/+/29517/comment/78480803_efd14319
PS2, Line 60: /* Unused, DEPRECATED */
Better use OSMO_DEPRECATED("Unused"). GCC ignores this attribute when applied to fields, but other compilers (like clang) would actually emit a warning if this field is used somewhere.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29517
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ia26fcba5d7364a5744b2d64d0542a2b3880eee34
Gerrit-Change-Number: 29517
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 29 Sep 2022 08:33:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment