Attention is currently required from: daniel, laforge, lynxis lazus.
pespin has posted comments on this change. (
https://gerrit.osmocom.org/c/libosmocore/+/35078?usp=email )
Change subject: osmo_io: Factor out and use common send function from backend
......................................................................
Patch Set 2:
(3 comments)
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/35078/comment/65b7ef21_6f5bf225
PS1, Line 348: if (rc > 0 && rc < msgb_length(msg)) {
Regarding your comment about rc == 0, maybe one
missing failure case is rc == 0 && rc < msgb_length […]
That should fall
into the more generic "rc < msgb_length(msg)" condition, I don't think
the specific case you mention should be handled differently.
https://gerrit.osmocom.org/c/libosmocore/+/35078/comment/442aee50_3a53f950
PS1, Line 360:
IMO rc == 0 in send means we have successfully
"written" 0 bytes to the socket (which also means the […]
ack, makes
sense, the special case for rc=0 is in the recv path (socket closed). I doubt we'll
ever see rc=0 here, I'd expect it to return -EAGAIN instead.
send(len=0) would probably return an error, or maybe it returns 0 instead to mention it is
writable.
File src/core/osmo_io_uring.c:
https://gerrit.osmocom.org/c/libosmocore/+/35078/comment/be9f52f1_8e2dfc28
PS2, Line 196: iofd_handle_send_completion(iofd, rc, msghdr);
The goto can easily be dropped:
if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) {
msgb_free(msghdr->msg);
iofd_msghdr_free(msghdr);
} else {
iofd_handle_send_completion(iofd, rc, msghdr);
}
iofd->u.uring.write_msghdr = NULL;
/* submit the next to-be-transmitted message for this file descriptor */
if (iofd->u.uring.write_enabled && !IOFD_FLAG_ISSET(iofd,
IOFD_FLAG_CLOSED))
iofd_uring_submit_tx(iofd);
You can btw probably ass OSMO_UNLIKELY() to the if condition checking IOFD_FLAG_CLOSED.
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/35078?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6da2653d32aedd0e7872be0cf90a841b56462e59
Gerrit-Change-Number: 35078
Gerrit-PatchSet: 2
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Wed, 29 Nov 2023 18:26:15 +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