daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32759 )
Change subject: [WIP] osmo_io: Support detecting connect
......................................................................
[WIP] osmo_io: Support detecting connect
libosmo-netif does a non blocking connect() which is signalled by
marking the fd writable.
Therefore osmo_io should signal this somehow. This patch modifies
osmo_iofd_write_enable() so that if called and the write queue is empty
then the write callback will then be called once with msg == NULL and rc == 0.
Change-Id: I893cbc3becd5e125f2f06b3654578aed0aacadf3
---
M src/core/osmo_io.c
M src/core/osmo_io_poll.c
2 files changed, 23 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/59/32759/1
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index b52b838..e783de8 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -392,8 +392,7 @@
void osmo_iofd_write_enable(struct osmo_io_fd *iofd)
{
iofd->write_enabled = true;
- if (iofd->tx_queue.current_length > 0)
- osmo_iofd_ops.write_enable(iofd);
+ osmo_iofd_ops.write_enable(iofd);
}
/*! Disable writing to this iofd
diff --git a/src/core/osmo_io_poll.c b/src/core/osmo_io_poll.c
index bc203c0..b368c7a 100644
--- a/src/core/osmo_io_poll.c
+++ b/src/core/osmo_io_poll.c
@@ -110,7 +110,13 @@
talloc_free(msghdr);
msgb_free(msg);
+ } else {
+ if (iofd->mode == OSMO_IO_FD_MODE_READ_WRITE)
+ iofd->io_ops.write_cb(iofd, 0, NULL);
+ if (osmo_iofd_txqueue_len(iofd) == 0)
+ iofd_poll_ops.write_disable(iofd);
}
+
}
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32759
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I893cbc3becd5e125f2f06b3654578aed0aacadf3
Gerrit-Change-Number: 32759
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: newchange
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32758 )
Change subject: osmo_io: Improve handling of segmentation_cb
......................................................................
osmo_io: Improve handling of segmentation_cb
The read length is not needed int the segmentation callback, msgb
already has all the necessary information, the parameter previously was
just msgb_length(msg).
Also handle negative return values (except -EAGAIN) of the callback as
errors which cause the msg to be dropped. -EAGAIN will defer the msg.
Change-Id: I6a0eebb8d4490f09a3cc6eb97d4ff47b4a8fd377
---
M include/osmocom/core/osmo_io.h
M src/core/osmo_io.c
2 files changed, 29 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/32758/1
diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h
index ffc8cfa..db9805b 100644
--- a/include/osmocom/core/osmo_io.h
+++ b/include/osmocom/core/osmo_io.h
@@ -43,7 +43,7 @@
void (*write_cb)(struct osmo_io_fd *iofd, int res,
const struct msgb *msg);
/*! call-back function to segment the data returned by read_cb */
- int (*segmentation_cb)(struct msgb *msg, int data_len);
+ int (*segmentation_cb)(struct msgb *msg);
};
/* mode OSMO_IO_FD_MODE_RECVFROM_SENDTO: */
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index cfb6d68..b52b838 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -229,7 +229,18 @@
return IOFD_SEG_ACT_HANDLE_ONE;
}
- int len = iofd->io_ops.segmentation_cb(msg, msg_len);
+ int len = iofd->io_ops.segmentation_cb(msg);
+ if (len == -EAGAIN) {
+ LOGPIO(iofd, LOGL_DEBUG, "segmentation_cb returned EAGAIN\n");
+ *pending_out = msg;
+ return IOFD_SEG_ACT_DEFER;
+ } else if (len < 0) {
+ /* Something is wrong, skip this msgb */
+ LOGPIO(iofd, LOGL_ERROR, "segmentation_cb returned error (%i), skipping msg of size %i\n", len, msg_len);
+ *pending_out = NULL;
+ msgb_free(msg);
+ return IOFD_SEG_ACT_DEFER;
+ }
pending_len = msg_len - len;
/* No segmentation needed, return */
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32758
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6a0eebb8d4490f09a3cc6eb97d4ff47b4a8fd377
Gerrit-Change-Number: 32758
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: neels, fixeria, pespin.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32218 )
Change subject: mgcp_codec: fix codec decision
......................................................................
Patch Set 12:
(7 comments)
Patchset:
PS11:
> Somehow `tests/mgcp/mgcp_test.ok` is seen by Gerrit as a binary file? […]
This might be due to the MCGP/SDP we dump in the ok.file Maybe the line breaks at the end confuse gerrit? My editor at least does not complain. Especially in #define CRCX_ZYN we use sometimes \r and \n or both.
File src/libosmo-mgcp/mgcp_codec.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/41faa488_963689ad
PS11, Line 362: found_same_codec = &rtp_end->codecs[i];
> just do: […]
Done
https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/c244192c_8dcacc7d
PS11, Line 367: return found_same_codec;
> ``` […]
Done
https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/6d2cf65b_ea0b9f47
PS11, Line 408: struct mgcp_rtp_codec *codec_conn_dst = NULL;
> cosmetic: can be moved inside the loop bodies
Done
https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/164f53c0_c6f0dd89
PS11, Line 423: if (conn_dst->end.codecs_assigned == 0) {
> In order to avoid code duplication, I would merge this block into the previous one: […]
Done
File tests/mgcp/mgcp_test.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/0814b158_3b0a68f3
PS11, Line 1808:
> ws
Done
https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/6a30d4cd_484278a4
PS11, Line 1976:
> ws
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5
Gerrit-Change-Number: 32218
Gerrit-PatchSet: 12
Gerrit-Owner: dexter <pmaier(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-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 May 2023 15:26:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels, fixeria, pespin.
Hello Jenkins Builder, neels, laforge, fixeria, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-mgw/+/32218
to look at the new patch set (#12).
Change subject: mgcp_codec: fix codec decision
......................................................................
mgcp_codec: fix codec decision
Unfortunately OsmoMGW was never really tested with multiple different
codecs on either side of the connection. While OsmoMSC and OsmoBSC only
assign exactly one codec on each side this has never been a problem,
however it might become a problem when a call agent assigns multiple
codecs on one side. This has been observed in a setup where OsmoMGW had
one leg towards an external call agent. Also due to recent upgrades to
the TTCN3 tests we are now able to simulate different codecs on both
sides to pinpoint issues.
Testing has shown that OsmoMGW has difficulties with multiple codecs.
The reason for this is that the function that makes the codec decision
was not fully finished. So let's finish the codec decision function and
let's also use that decision when patching the payload type of outgoing
RTP packets.
Related: OS#5461
Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5
---
M include/osmocom/mgcp/mgcp_codec.h
M include/osmocom/mgcp/mgcp_trunk.h
M src/libosmo-mgcp/mgcp_codec.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_vty.c
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
8 files changed, 256 insertions(+), 232 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/18/32218/12
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5
Gerrit-Change-Number: 32218
Gerrit-PatchSet: 12
Gerrit-Owner: dexter <pmaier(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-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: dexter.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/32630 )
Change subject: l1sap: Accept RFC5993 and TS 101.318 HR GSM payload
......................................................................
Patch Set 4:
(1 comment)
File src/common/l1sap.c:
https://gerrit.osmocom.org/c/osmo-bts/+/32630/comment/18e89d11_debaf3f0
PS4, Line 1955: /* Since we already verified the payload in rtppayload_validate_hr(), we may trust that the payload length is
I meant something like this (assuming no weird lengths like len=0 are to be received here):
```
switch (rtp_pl_len) {
case GSM_HR_BYTES_RTP_TS101318:
/* Convert from TS 101 318 to RFC 5993 */
if (OSMO_UNLIKELY(!ts101318 && rfc5993)) {
msg = l1sap_msgb_alloc(rtp_pl_len + 1);
if (!msg)
return NULL;
msgb_put_u8(msg, 0x00);
memcpy(msgb_put(msg, rtp_pl_len), rtp_pl, rtp_pl_len);
return msg;
}
break;
case GSM_HR_BYTES_RTP_RFC5993:
/* Convert from RFC 5993 TS 101 318 */
if (OSMO_UNLIKELY(!rfc5993 && ts101318)) {
msg = l1sap_msgb_alloc(rtp_pl_len - 1);
if (!msg)
return NULL;
memcpy(msgb_put(msg, rtp_pl_len - 1), rtp_pl + 1, rtp_pl_len - 1);
return msg;
}
break;
default:
OSMO_ASSERT(0);
}
/* No conversion needed since the RTP payload is already in a supported format */
msg = l1sap_msgb_alloc(rtp_pl_len);
if (!msg)
return NULL;
memcpy(msgb_put(msg, rtp_pl_len), rtp_pl, rtp_pl_len);
```
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32630
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I9419b40c1171876879d41aba4f51c93e8ef5673c
Gerrit-Change-Number: 32630
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 May 2023 14:52:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment