-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
subsys/mgmt: Add UDP transport for SMP #20983
Conversation
@aunsbjerg thanks for the PR! |
All checks are passing now. checkpatch (informational only, not a failure)
Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
92d6bed
to
681c738
Compare
@carlescufi I don't think it's necessary to add anything to upstream mcumgr, as we're basically just adding a transport that's already supported by the mcumgr-cli. I might be wrong though. |
The PR only adds transport, similarly to smp_uart, smp_bt sources. The management part is still performed by mcumgr lib. I think that this is the the right place for the code. |
I have been looking at other transport solution as well. This PR is in right place. |
@aunsbjerg Can you become one of code-owner of files you added or modified? |
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.
+1 for doc change :)
Thanks for the feedback. I will try and get the changes made during the weekend. I will also update the documentation for the sample and for the subsys in general where applicable. |
Thanks @aunsbjerg for the PR and the feedback. I think you are right and nothing is required upstream, but I'd like @nvlsianpu and @de-nordic to approve. |
Alright, finally got around to actually reworking this according to feedback. Sample application is refactored. Common configuration stuff is put into prj.conf and transport specific is put into overlays. Code is separated into main, bt and udp specific stuff. I do not have any nordic boards so I have not been able to test that the bluetooth samples still work. Can someone verify this for me? I have added myself as codeowner for the smp_udp.c in subsys and for the sample application. It would be nice to have a co-owner for the sample for the bluetooth stuff. |
Adds a UDP driver dedicated to transporting mcumgr SMP requests and responses. Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
To prepare this sample supporting future SMP transports, the sample code is now split into a main and bluetooth file. A common config has been identified and application specific config is put into overlay config files. Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
This sample now supports SMP UDP transport. Two config overlays have been added for ipv4 and ipv6, respectively. The sample documentation has been completely revamped to be less bluetooth focused and more general. Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
Updated commits according to feedback from @jukkar |
Enable SMP UDP using IPv4 addressing. | ||
Can be enabled alongside IPv6 addressing. | ||
|
||
config MCUMGR_SMP_UDP_IPV6 |
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.
Do you need this extra level of configuration? What I mean is that now it is possible to have the device to have IPv6 enabled, but SMP UDP to not support it. Perhaps this is ok, it really depends on the use cases.
For example in networking libs and apps, it is usually enough to just enable IPv6 which then enables IPv6 usage in corresponding lib/app. So usually it is not needed to turn off IPv6 in app if the system globally supports IPv6.
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's not necessary, but I figured one might want to disable ipv4/ipv6 for SMP independently of the network stack configuration. I can remove these config items and use the network config values instead if that's preferable.
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.
This is more or less up to you and the use cases. If you have a good use case for it, that is fine. It was just not obvious by looking the patch so wanted to clarify it.
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.
LGTM
CONFIG_FILE_SYSTEM_LITTLEFS=y | ||
|
||
# Enable file system commands | ||
CONFIG_MCUMGR_CMD_FS_MGMT=n |
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.
CONFIG_MCUMGR_CMD_FS_MGMT=y
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.
See #24444
This makes it possible to perform
mcumgr
operation like DFU over ethernet instead of bluetooth or serial. Themcumgr
tool already has support for UDP transport.