-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Network stack cleanup #8723
Comments
@jukkar, @rveerama1, @ozhuraki, @pfalcon, whoever else is interested. |
Here's my 2 cents of proposed cleanup: I hate these things:
It obfuscates the fact that it's function (so, e.g. if you search for "tcp_established(", you'll get nothing), and completely hides the function parameter list. And all this for what?:
As we have 3 occurrences of this stuff, we could just expand that macro to literal code, and won't lose much. But it's actually more than that - I don't think all that wrapping is actually necessary. Just think what it does - it extends context lifetime until the end of wrapper function. But the wrapper function doesn't use context in any way after the wrappee returns, so this extending is completely useless! It only adds confusion on the source level and extra callframe on the stack. |
@jukkar , @tbursztyka : Can you assess the proposal in previous comment please? |
#9564 tries to alleviate at least the concerns above, with the code comments. |
1. Where we calculate max size, name variable (preprocessor define) correspondingly. 2. Calling TCP/UDP an "app protocol" is original, use "next protocol" terminology of IPv6. 3. As headers go as IP, then "next", order calculations that way too. 4. Add more comments. Addresses: zephyrproject-rtos#8723 Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This function has absolutely nothing to do with net_context. Addresses: zephyrproject-rtos#8723 Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
1. Where we calculate max size, name variable (preprocessor define) correspondingly. 2. Calling TCP/UDP an "app protocol" is original, use "next protocol" terminology of IPv6. 3. As headers go as IP, then "next", order calculations that way too. 4. Add more comments. Addresses: #8723 Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This function has absolutely nothing to do with net_context. Addresses: #8723 Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
NET_CONN_CB() functional macro hides the parameters a function takes and its return type. In zephyrproject-rtos#8723, it's proposed to remove that macro altogether. Until that proposal is reviewed, at least provide real protype in code comments to help people who read/analyze the code. Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
NET_CONN_CB() functional macro hides the parameters a function takes and its return type. In #8723, it's proposed to remove that macro altogether. Until that proposal is reviewed, at least provide real protype in code comments to help people who read/analyze the code. Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
edited: removed the TCP cleanup tasks. |
done |
Current code base would need serious cleanup/optimization. Current status shows duplicates, un-proper modularization, under optimized data storage/lookup, naming issues etc...
What should be done:
. For instance, icmpv4 redo in its code what ipv4 does already.
. Use IS_ENABLED()
. Move CONFIG_* conditioned code to own function
.When it is a public function net_<domain><...>()
.When it is a private function <domain><...>()
Areas:
The text was updated successfully, but these errors were encountered: