Attention is currently required from: osmith, Hoernchen, neels, laforge, fixeria, daniel.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/30934 )
Change subject: Add osmo_io with initial poll backend
......................................................................
Patch Set 5:
(6 comments)
File include/osmocom/core/osmo_io.h:
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/d9628e2d_f17a91bf
PS5, Line 57: int osmo_iofd_sendto_msgb(struct osmo_io_fd *iofd, struct msgb *msg, int flags,
maybe name it sendto_flags to clarify what are the flags for, but not that important.
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/ca524f17_c67c82bf
PS5, Line 210: * If there are bytes left over *pending_out will point to a msgb with the remaining data.
" If there are bytes left over, *pending_out will" (see extra comma)
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/7c6dffd2_0e001c04
PS5, Line 426: if (!osmo_iofd_ops.close || (osmo_iofd_ops.close && osmo_iofd_ops.close(iofd)))
There seems to be a lot of expected stuff happening here with regards to struct configuration and return codes from function pointers.
I think this deserves a comment here explaining the expected lifecycle.
File src/osmo_io_poll.c:
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/1fa54ade_1463fb7d
PS3, Line 71: rc = write(ofd->fd, msgb_data(msg), msgb_length(msg));
> the normal "read/write" case might be worth a dedicated function as we don't need a serialized msghe […]
read/write is basically recv/send with flags=0, so there's no need to have read/write imho.
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/f4a749b6_e40208a1
PS3, Line 84: /
> maybe still look into this before merging it?
Ack
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/c7a750bf_aea0ba83
PS3, Line 143: /
> same as above
Ack
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30934
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Gerrit-Change-Number: 30934
Gerrit-PatchSet: 5
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 03 Feb 2023 15:29:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
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: daniel.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31172 )
Change subject: Add osmo_sockaddr_size() to return the size of the variant used
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Patchset:
PS1:
I like this one, but I'd probably add a big fat warning in the documentation for the reader to realize this provide eg the "sockaddr_in" and not the "in_addr", since sometimes that's what's wanted.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31172
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I952b6bb752441fe019fc18f89bce4bbfbe58994a
Gerrit-Change-Number: 31172
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 03 Feb 2023 15:20:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: daniel.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31173 )
Change subject: Add libosmocore.map
......................................................................
Patch Set 1: Code-Review-1
(1 comment)
Patchset:
PS1:
You are definetly missing an explanation on how did you generate that file ;)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31173
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I13169c00a59fb59513dfc598de5a71d094492422
Gerrit-Change-Number: 31173
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 03 Feb 2023 15:18:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: dexter.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/31171 )
Change subject: pcu_l1_if: cosmetic: use sizeof instead of constants
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/31171
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ib99e0a5470758bc4235b140103f2abd448ac07d3
Gerrit-Change-Number: 31171
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 03 Feb 2023 15:17:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/31172 )
Change subject: Add osmo_sockaddr_size() to return the size of the variant used
......................................................................
Add osmo_sockaddr_size() to return the size of the variant used
Change-Id: I952b6bb752441fe019fc18f89bce4bbfbe58994a
---
M include/osmocom/core/socket.h
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/31172/1
diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index 3ed9cc6..427fa92 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -33,6 +33,23 @@
int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen);
int osmo_sockaddr_is_any(const struct osmo_sockaddr *addr);
+/*! Return the size of the variant used in the address
+ * \param[in] addr the osmo_sockaddr to get the size of
+ * \return the size of the struct variant being used. If the value in sa_family is unsupported it will return
+ * the size of struct osmo_sockaddr
+ */
+static inline socklen_t osmo_sockaddr_size(const struct osmo_sockaddr *addr)
+{
+ switch (addr->u.sa.sa_family) {
+ case AF_INET:
+ return sizeof(struct sockaddr_in);
+ case AF_INET6:
+ return sizeof(struct sockaddr_in6);
+ default:
+ return sizeof(struct osmo_sockaddr);
+ }
+}
+
unsigned int osmo_sockaddr_to_str_and_uint(char *addr, unsigned int addr_len, uint16_t *port,
const struct sockaddr *sa);
size_t osmo_sockaddr_in_to_str_and_uint(char *addr, unsigned int addr_len, uint16_t *port,
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31172
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I952b6bb752441fe019fc18f89bce4bbfbe58994a
Gerrit-Change-Number: 31172
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: osmith, Hoernchen, neels, laforge, pespin, fixeria.
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/30934 )
Change subject: Add osmo_io with initial poll backend
......................................................................
Patch Set 5:
(4 comments)
File src/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/0581e24a_90af351f
PS3, Line 50: struct iofd_backend_ops g_iofd_ops;
> if a map file is introduced, this symbol will still be exported in order to be used by tests AFAIU. […]
Done
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/9356aa10_89e91727
PS3, Line 111: talloc_free(msghdr);
> Better describe it in the code then.
Done
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/b331d7b9_90749472
PS3, Line 225: msg_pending = iofd_msgb_alloc(iofd);
> Ack. Better describe this in the code.
I tried
https://gerrit.osmocom.org/c/libosmocore/+/30934/comment/b986ca7f_22960d5c
PS3, Line 228: iofd->pending = msg_pending;
> you may want to add OSMO_ASSERT(iofd->pending == NULL) perhaps.
ACK
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30934
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Gerrit-Change-Number: 30934
Gerrit-PatchSet: 5
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 03 Feb 2023 15:17:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
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: osmith, Hoernchen, neels, laforge, pespin, fixeria.
Hello osmith, Jenkins Builder, Hoernchen, neels, pespin, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/30934
to look at the new patch set (#5).
Change subject: Add osmo_io with initial poll backend
......................................................................
Add osmo_io with initial poll backend
* make backend configurable for later
* segmentation callback for chunked streams
* logging target for osmo_io
* support partial writes
Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Related: SYS#5094, OS#5751
---
M TODO-RELEASE
M include/osmocom/core/Makefile.am
M include/osmocom/core/logging.h
A include/osmocom/core/osmo_io.h
M src/core/Makefile.am
M src/core/libosmocore.map
M src/core/logging.c
A src/core/osmo_io.c
A src/core/osmo_io_internal.h
A src/core/osmo_io_poll.c
M tests/logging/logging_vty_test.vty
11 files changed, 947 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/30934/5
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30934
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Gerrit-Change-Number: 30934
Gerrit-PatchSet: 5
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset