-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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: modem_cellular: Configurable MTU for CMUX #87115
modem: modem_cellular: Configurable MTU for CMUX #87115
Conversation
dfe4872
to
500a08a
Compare
500a08a
to
a1774bd
Compare
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 like it :)
2fb412a
a1774bd
to
2fb412a
Compare
eb59a1e
f2dddce
to
eb59a1e
Compare
Rebased on top of main and fixed the conflict on |
Please merge this soon, as I would otherwise have to constantly rebase it on top of main, because changelog keeps changing and I get conflicts. |
Uhm, weird numbers considering your changes (regarding ROM), are you sure your branch is based off the same main as what you are using for comparison? Also, of course you'll get big RAM savings for |
Not weird numbers. I took a look of why this happens. So even though we only initialize some of the fields, the whole structure is stored. So all buffers are going to be zero initialized. |
I'm unsure if I follow this correctly. The CMUX MTU does not affect PPP MTU. For performance wise, all buffer sizes should be optimized only once you define your final baud rate. So it is pointless to try to tweak them here. |
Allow configuring MTU for CMUX. Some AT manual and specification define this as a frame size. Linux ldattach default to 127 bytes, 3GPP TS 27.010 defaults to 31. We should limit our CMUX frames to a size that remote end is capable of handling. Linux silently drops oversized frames. Also, remove MODEM_CELLULAR_CMUX_MAX_FRAME_SIZE as this was only limiting a buffer sizes, and resulted CMUX frames to be capped to same value. Use MODEM_CMUX_WORK_BUFFER_SIZE and MODEM_CMUX_MTU instead. Also rename CONFIG_MODEM_CELLULAR_CHAT_BUFFER_SIZES to CONFIG_MODEM_CELLULAR_CHAT_BUFFER_SIZE as it is now only used as a Chat module. DLCI pipes use CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE. Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Add migration guide for configuring MTU for CMUX. Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
If we end up writing zero bytes to cmux output, we can return zero instead of -ENOMEM as it would break various modules when using small buffers. For example modem_chat.c does not tolerate -ENOMEM but handles zero OK. Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
eb59a1e
to
40a2c87
Compare
Sorry for changing this PR: Otherwise I would end up conflicting the migration guide again when cherry-picking. |
Oh wow. That's bad. Wondering what could be done to avoid that. 🤔
Yeah sorry I was too simplistic in what I said. The PPP frames being sent across many small CMUX frames will reduce the MCU <=> modem bandwidth (and increase at least a little bit the processing overhead). But I don't disagree that this needs to be tuned according to every use case and configuration. |
The diff didn't change so the reviews weren't dismissed. 🙂 |
Allow configuring MTU for CMUX.
Some AT manual and specification define this as a
frame size. Linux ldattach default to 127 bytes,
3GPP TS 27.010 defaults to 31.
We should limit our CMUX frames to a size that
remote end is capable of handling.
Linux silently drops oversized frames.
Also, deprecate MODEM_CELLULAR_CMUX_MAX_FRAME_SIZE as this was only limiting a buffer sizes, and resulted CMUX frames to be capped to same value.
Use MODEM_CMUX_WORK_BUFFER_SIZE and MODEM_CMUX_MTU instead.
For reference:
Linux kernel
n_gsm.c
driver on receiving side: https://elixir.bootlin.com/linux/v6.13.6/source/drivers/tty/n_gsm.c#L2885You can see that all frames larger than MTU/MRU are silently dropped.
ldattach(8)
utility from Util-linux package: https://github.com/util-linux/util-linux/blob/master/sys-utils/ldattach.c#L260-L276 you can see that it sets default to 127 and there is no command line parameters to configure this.