[M] Change in libosmocore[master]: osmo_io: Factor out and use common send function from backend
Attention is currently required from: laforge, lynxis lazus, pespin. daniel 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: (5 comments) File src/core/osmo_io.c: https://gerrit.osmocom.org/c/libosmocore/+/35078/comment/c63c3397_1e3aa3a8 PS1, Line 343: void iofd_handle_send(struct osmo_io_fd *iofd, int rc, struct iofd_msghdr *msghdr)
this function (like unfortuntaely many functions in the code base) would benefit from a comment desc […] Done
https://gerrit.osmocom.org/c/libosmocore/+/35078/comment/dde3791b_d6c6a0ea PS1, Line 343: void iofd_handle_send(struct osmo_io_fd *iofd, int rc, struct iofd_msghdr *msghdr)
this function (like unfortuntaely many functions in the code base) would benefit from a comment desc […] Done
https://gerrit.osmocom.org/c/libosmocore/+/35078/comment/8d2930d4_ca0fc16d 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(msg)? Not sure though. https://gerrit.osmocom.org/c/libosmocore/+/35078/comment/57942bf2_352fb2a8 PS1, Line 360:
rc == 0 case seems to be missing here? IMO rc == 0 in send means we have successfully "written" 0 bytes to the socket (which also means the socket is writable).
This is (IMO correctly) handled in the success case below. The failure cases should either be rc < msgb_length() or rc == -EAGAIN. File src/core/osmo_io_uring.c: https://gerrit.osmocom.org/c/libosmocore/+/35078/comment/93398c92_a3e6f35c PS1, Line 188: iofd_msghdr_free(msghdr);
Yes, previous you didn't checked for -EAGAIN, now you're checking it and doing things based on it. You marked this as resolved, but just to be clear: I think this behavior is okay. It's debatable whether we'd ever encounter -EAGAIN for a send in io_uring, but if we do I'd say reenqueueing is the correct behavior.
-- 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@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu> Gerrit-CC: laforge <laforge@osmocom.org> Gerrit-CC: pespin <pespin@sysmocom.de> Gerrit-Attention: laforge <laforge@osmocom.org> Gerrit-Attention: pespin <pespin@sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis@fe80.eu> Gerrit-Comment-Date: Wed, 29 Nov 2023 17:04:12 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge@osmocom.org> Comment-In-Reply-To: pespin <pespin@sysmocom.de> Comment-In-Reply-To: daniel <dwillmann@sysmocom.de> Comment-In-Reply-To: lynxis lazus <lynxis@fe80.eu> Gerrit-MessageType: comment
participants (1)
-
daniel