Attention is currently required from: jolly, laforge.
pespin has posted comments on this change by jolly. (
https://gerrit.osmocom.org/c/libosmocore/+/40584?usp=email )
Change subject: Avoid reusing pending buffer; append incoming data instead
......................................................................
Patch Set 4:
(3 comments)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/7d712385_94a8c125?… :
PS3, Line 17: This change ensures that newly received data is appended to the existing
Maybe I should state that I don't want to reuse
the pending buffer for the read operation. […]
This is still confusing to me,
because you are still using the term "pending buffer" twice.
IIUC on the second one you mean "to the buffer where next read will be done by the
kernel"?
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/cf285de9_509310cd?… :
PS3, Line 178: struct msgb *iofd_msgb_alloc2(struct osmo_io_fd *iofd, size_t size)
The application should only care about the length of
data in the buffer not the size.
I disagree. Apps may want to make sure a msgb allocated is of at least a certain size, so
that they can reuse the msgb with zero-copy by appending/prepending to it, etc.
If you say you garantee the msgb recevied by the user is of at least osmo_iofd msgb_size
configured by the user, then I'm fine, otherwise we need to revisit this.
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/1afc42ee_da26b476?… :
PS3, Line 335: * If the pending message is not large enough, create a larger message.
*/
The application should only care about the length of
data in the buffer not the size.
My understanding is that since user expects no segment bigger than the configured
msgb_size, then we should read() only up to the maximum msgb_size configured. Hence it can
never happen that we read more than the size of the msgb.
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/40584?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I08df9736ccc5e9a7df61ca6dcf94629ee010752f
Gerrit-Change-Number: 40584
Gerrit-PatchSet: 4
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 23 Jul 2025 13:59:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly <andreas(a)eversberg.eu>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>