-
Notifications
You must be signed in to change notification settings - Fork 7.7k
modem: cmux: Decouple modem cmux and modem cellular driver #93441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
fabiobaltieri
merged 1 commit into
zephyrproject-rtos:main
from
bjarki-andreasen:modem-cmux-default-mtu-sym
Jul 23, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's not just a hint? It's enforced by the CMUX module?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its enforced by
MODEM_CMUX_MTU
:) The default is just a default, so this hint is telling CMUX that something in the system would prefer MTU be 127, but it is definitely still directly settable by the applicationUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking a bit closer, what does
MODEM_CMUX_MTU
do? It seems like an artificial limit, given the actual limit of CMUX frame sizes isMODEM_CMUX_WORK_BUFFER_SIZE
, where is it used favorably toMODEM_CMUX_WORK_BUFFER_SIZE
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, we have no way to configure the MTU used by CMUX, major oversight on my end when creating the API...
The
struct modem_cmux_config
should be updated to include the MTU, this way, it becomes instance specific and needs no global config. On top of that, part of the receive buffer should be reserved for the work buffer. These two changes remove all hardcoded configs from the CMUX implementation :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good. FYI @SeppoTakalo @MarkusLassila
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMUX frame sizes were last worked on PR #87115
And it is configurable by Kconfig.
Surely it can be a runtime configurable, but does it really make much difference? You have selected the modem already in the build time.
Some modems use hard-coded MTU for the CMUX. Some allow it to be configured in the AT command that enables the CMUX framing.
Even some clients hard-code the value. For example Linux
ldattach
uses 127.3GPP default is 32.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not an artificial limit, frames bigger than the MTU what the receiver can process, are dropped.
It is not directly related to how much we have buffer space. It depends on the remote end as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point is not to make the MTU runtime configurable, but to make it instance specific instead a global property.