-
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/mcumgr: Reduce unnecessary ROM usage #64288
subsys/mgmt/mcumgr: Reduce unnecessary ROM usage #64288
Conversation
configs.ipv4.proto = PROTOCOL_IPV6; | ||
configs.ipv4.sock = -1; | ||
|
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 possibly falsely reducing usage because there are not the right fields
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.
@nordicjm Sorry, I'm not sure what you mean?
The ROM usage is reduced because by initialising the fields here rather than statically, the configs
struct can be statically zero-initialised and doesn't need to go in ROM at all.
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.
These are .ipv4
but this is in the IPv6 section
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.
Ah! Typo, good spot. Fixed now - ROM usage decrease is the same.
f710cf9
to
fa47eeb
Compare
@besmarsh would you be able to fix compliance issue? |
|
Sure, I can have a look. I haven't changed any names though, so should this have been caught before my changes? It looks like a case that slips through the checker. |
I see, yeah not too sure what the deal is but it's probably worth renaming the structure otherwise this will fire every time you touch this file. It's only used once anyway. |
mcumgr's SMP UDP transport was unnecessarily using a potentially large amount of ROM space due to static initialising fields in a config struct that also contains buffers/stacks. This has been changed to instead initialise fields in the start function, reducing ROM usage by ~5K in the default configuration with IPv4 and IPv6 enabled. Signed-off-by: Ben Marsh <[email protected]>
fa47eeb
to
68a0a18
Compare
The mcumgr SMP UDP configs struct was causing a unique tag name violation (rule 5.7). The struct name has been changed from configs to smp_udp_configs. Signed-off-by: Ben Marsh <[email protected]>
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.
Missing signed off in second commit
68a0a18
to
6982f30
Compare
All CI issues resolved. |
mcumgr's SMP UDP transport was unnecessarily using a potentially large amount of ROM space due to static initialising fields in a config struct that also contains buffers/stacks.
This has been changed to instead initialise fields in the start function, reducing ROM usage by ~5K in the default configuration with IPv4 and IPv6 enabled.