-
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
modem: cmux: Decouple modem cmux and modem cellular driver #93441
Conversation
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.
Commit message typo? This commit moves the makes the device drivers
help | ||
Use the default MTU size of 127 bytes for the CMUX module on certain modems. | ||
This must match the AT+CMUX commands in the modem_cellular driver. | ||
Hint that the default MODEM_CMUX_MTU size should be 127 bytes. |
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?
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 application
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 is MODEM_CMUX_WORK_BUFFER_SIZE
, where is it used favorably to MODEM_CMUX_WORK_BUFFER_SIZE
?
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.
Looking a bit closer, what does
MODEM_CMUX_MTU
do? It seems like an artificial limit
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.
The modem modules cmux module is currently directly coupled to the presence of specific modems, rather than being selected by drivers for whatever hardware wants to request the default MTU of 127 bytes. This commit the makes the device drivers (for now, modem_cellular) select the symbol, thus decoupling the modem modules from the presence of any specific device. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
f22cd6c
to
9106b15
Compare
|
Still typo? 😄 |
The modem modules cmux module is currently directly coupled to the presence of specific modems, rather than being selected by drivers for whatever hardware wants to request the default MTU of 127 bytes.
This commit moves the makes the device drivers (for now, modem_cellular) select the symbol, thus decoupling the modem modules from the presence of any specific device.