pespin submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
osmo_io: uring: Let iofd_msghdr_alloc() allocate msgb internally in read path

Do it the same way as in osmo_io_poll, to have similar code paths and
avoid extra code.

Change-Id: I947a97ee9db8b6bb2635ae122426210f068b1a8a
---
M src/core/osmo_io_uring.c
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/core/osmo_io_uring.c b/src/core/osmo_io_uring.c
index 6ae21cf..400b65b 100644
--- a/src/core/osmo_io_uring.c
+++ b/src/core/osmo_io_uring.c
@@ -246,7 +246,6 @@

static inline int iofd_uring_submit_recv_sqe(struct osmo_io_fd *iofd, enum iofd_msg_action action)
{
- struct msgb *msg;
struct iofd_msghdr *msghdr;
struct io_uring_sqe *sqe;
uint8_t idx;
@@ -260,13 +259,7 @@
OSMO_ASSERT(0);
}

- msg = iofd_msgb_alloc(iofd);
- if (!msg) {
- LOGPIO(iofd, LOGL_ERROR, "Could not allocate msgb for reading\n");
- OSMO_ASSERT(0);
- }
-
- msghdr = iofd_msghdr_alloc(iofd, action, msg, iofd->cmsg_size);
+ msghdr = iofd_msghdr_alloc(iofd, action, NULL, iofd->cmsg_size);
if (!msghdr) {
LOGPIO(iofd, LOGL_ERROR, "Could not allocate msghdr for reading\n");
OSMO_ASSERT(0);

To view, visit change 44140. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I947a97ee9db8b6bb2635ae122426210f068b1a8a
Gerrit-Change-Number: 44140
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>