Attention is currently required from: falconia, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32793 )
Change subject: BTS_Tests: f_rtpem_activate(): pad TCH/FS frames with 'FF'O
......................................................................
Patch Set 2:
This change is ready for review.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32793
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib42b783574caf5cbaf64b2eb5dd1d2b2a6637c2f
Gerrit-Change-Number: 32793
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 19 May 2023 12:58:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
daniel has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32759 )
Change subject: osmo_io: Support detecting non-blocking connect()
......................................................................
osmo_io: Support detecting non-blocking connect()
libosmo-netif does a non blocking connect(), which as per definition of
the socket API is signalled from the OS to the user by marking the file
descriptor writable.
osmo_io needs to signal this somehow. Previously osmo_io would only call
the write_cb if actual data has been sent. This patch changes the behaviour
so that calling osmo_iofd_write_enable() will call write_cb() on a writable
socket even if the write queue is empty.
Change-Id: I893cbc3becd5e125f2f06b3654578aed0aacadf3
---
M src/core/osmo_io.c
M src/core/osmo_io_poll.c
M tests/osmo_io/osmo_io_test.ok
3 files changed, 28 insertions(+), 2 deletions(-)
Approvals:
daniel: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 857644d..9960fb4 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -395,8 +395,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..dd86f29 100644
--- a/src/core/osmo_io_poll.c
+++ b/src/core/osmo_io_poll.c
@@ -110,7 +110,15 @@
talloc_free(msghdr);
msgb_free(msg);
+ } else {
+ if (iofd->mode == OSMO_IO_FD_MODE_READ_WRITE)
+ /* Socket is writable, but we have no data to send. A non-blocking/async
+ connect() is signalled this way. */
+ iofd->io_ops.write_cb(iofd, 0, NULL);
+ if (osmo_iofd_txqueue_len(iofd) == 0)
+ iofd_poll_ops.write_disable(iofd);
}
+
}
}
diff --git a/tests/osmo_io/osmo_io_test.ok b/tests/osmo_io/osmo_io_test.ok
index 745e36a..43e5464 100644
--- a/tests/osmo_io/osmo_io_test.ok
+++ b/tests/osmo_io/osmo_io_test.ok
@@ -1,5 +1,6 @@
Running test_connected
ep1: write() returned rc=16
+ep2: write() returned rc=0
ep2: read() msg with len=16
01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10
Running test_unconnected
--
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: 7
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
daniel has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32758 )
Change subject: osmo_io: Improve handling and documentation of segmentation_cb
......................................................................
osmo_io: Improve handling and documentation of segmentation_cb
The read length is not needed in 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, 48 insertions(+), 14 deletions(-)
Approvals:
daniel: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h
index c19ca67..d7402d6 100644
--- a/include/osmocom/core/osmo_io.h
+++ b/include/osmocom/core/osmo_io.h
@@ -42,8 +42,12 @@
/*! call-back function when write has completed on fd */
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);
+ /*! call-back function to segment the data at message boundaries.
+ * Needs to return the size of the next message. If it returns
+ * -EAGAIN or a value larger than msgb_length() (message is incomplete)
+ * osmo_io will wait for more data to be read. Other negative values
+ * cause the msg to be discarded. */
+ 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 b06e63c..857644d 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -219,7 +219,7 @@
*/
static enum iofd_seg_act iofd_handle_segmentation(struct osmo_io_fd *iofd, struct msgb *msg, struct msgb **pending_out)
{
- int pending_len, msg_len;
+ int extra_len, msg_len;
struct msgb *msg_pending;
msg_len = msgb_length(msg);
@@ -229,27 +229,41 @@
return IOFD_SEG_ACT_HANDLE_ONE;
}
- int len = iofd->io_ops.segmentation_cb(msg, msg_len);
-
- pending_len = msg_len - len;
- /* No segmentation needed, return */
- if (pending_len == 0) {
+ int len = iofd->io_ops.segmentation_cb(msg);
+ if (len == -EAGAIN) {
+ goto defer;
+ } else if (len < 0) {
+ /* Something is wrong, skip this msgb */
+ LOGPIO(iofd, LOGL_ERROR, "segmentation_cb returned error (%d), skipping msg of size %d\n", len, msg_len);
*pending_out = NULL;
- return IOFD_SEG_ACT_HANDLE_ONE;
- } else if (pending_len < 0) {
- *pending_out = msg;
+ msgb_free(msg);
return IOFD_SEG_ACT_DEFER;
}
- /* Copy the pending data over */
+ extra_len = msg_len - len;
+ /* No segmentation needed, return the whole msgb */
+ if (extra_len == 0) {
+ *pending_out = NULL;
+ return IOFD_SEG_ACT_HANDLE_ONE;
+ /* segment is incomplete */
+ } else if (extra_len < 0) {
+ goto defer;
+ }
+
+ /* msgb contains more than one segment */
+ /* Copy the trailing data over */
msg_pending = iofd_msgb_alloc(iofd);
- memcpy(msgb_data(msg_pending), msgb_data(msg) + len, pending_len);
- msgb_put(msg_pending, pending_len);
+ memcpy(msgb_data(msg_pending), msgb_data(msg) + len, extra_len);
+ msgb_put(msg_pending, extra_len);
*pending_out = msg_pending;
/* Trim the original msgb to size */
msgb_trim(msg, len);
return IOFD_SEG_ACT_HANDLE_MORE;
+
+defer:
+ *pending_out = msg;
+ return IOFD_SEG_ACT_DEFER;
}
/*! Restore message boundaries on read() and pass individual messages to the read callback
--
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: 6
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(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: laforge, pespin.
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32758 )
Change subject: osmo_io: Improve handling and documentation of segmentation_cb
......................................................................
Patch Set 5: Code-Review+2
(2 comments)
Patchset:
PS5:
Re-adding +1 from Harald
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/32758/comment/efb81c82_4ed8c5c3
PS3, Line 249: } else if (pending_len < 0) {
> Ah I see the rationale now :) It should have been "msg_pending_len" then or similar, otherwise it's […]
Done
--
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: 5
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 19 May 2023 12:50:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: Hoernchen.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-trx/+/32763
to look at the new patch set (#6).
Change subject: devices: unify band handling
......................................................................
devices: unify band handling
This is basically common, but optional code.
Change-Id: I64f5a462451e967d4750d8e4f1d5832cbab41cff
---
M Transceiver52M/device/bladerf/bladerf.cpp
M Transceiver52M/device/bladerf/bladerf.h
M Transceiver52M/device/common/Makefile.am
A Transceiver52M/device/common/bandmanager.h
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
M Transceiver52M/device/uhd/UHDDevice.cpp
M Transceiver52M/device/uhd/UHDDevice.h
8 files changed, 242 insertions(+), 326 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/32763/6
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/32763
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I64f5a462451e967d4750d8e4f1d5832cbab41cff
Gerrit-Change-Number: 32763
Gerrit-PatchSet: 6
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: Hoernchen.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-trx/+/32764
to look at the new patch set (#6).
Change subject: devices: add freq/gain override for uhd
......................................................................
devices: add freq/gain override for uhd
This allows using arbitrary gain and frequencies.
Change-Id: I3c1b9a067cafc6d696b9aa2da8ee0480ec1e094f
---
M CommonLibs/config_defs.h
M CommonLibs/trx_vty.c
M Transceiver52M/device/uhd/UHDDevice.cpp
3 files changed, 122 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/64/32764/6
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/32764
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I3c1b9a067cafc6d696b9aa2da8ee0480ec1e094f
Gerrit-Change-Number: 32764
Gerrit-PatchSet: 6
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-MessageType: newpatchset
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32793 )
Change subject: BTS_Tests: f_rtpem_activate(): pad speech frames with '01010101'B
......................................................................
BTS_Tests: f_rtpem_activate(): pad speech frames with '01010101'B
Since recently [1], osmo-bts started to preen incoming FR and EFR RTP
frames for SID errors. In other words, if an incoming frame is a SID
frame, osmo-bts may modify some bits causing a mismatch on our side.
Use '01010101'B as the padding pattern to prevent pseudo-random TCH
frames being treated as SID and modified by osmo-bts.
Change-Id: Ib42b783574caf5cbaf64b2eb5dd1d2b2a6637c2f
Related: [1] osmo-bts.git I89df2f12c49dd5378667cf149d19bde654f80134
Related: OS#6039
---
M bts/BTS_Tests.ttcn
1 file changed, 22 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/93/32793/1
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 909a331..cddb6e7 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -2635,8 +2635,10 @@
}
}
- /* Pad the payload to conform the expected length */
- payload := f_pad_oct(hdr & payload, payload_len, '00'O);
+ /* Pad the payload to conform the expected length. Use '01010101'B as
+ * padding pattern to ensure the resulting payload is *not* a SID frame,
+ * which may be corrected by the BTS causing mismatch on our side. */
+ payload := f_pad_oct(hdr & payload, payload_len, '55'O);
cfg.tx_payloads[0].fixed_payload := payload;
f_rtpem_configure(RTPEM_CTRL, cfg);
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32793
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib42b783574caf5cbaf64b2eb5dd1d2b2a6637c2f
Gerrit-Change-Number: 32793
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange