-
Notifications
You must be signed in to change notification settings - Fork 8.2k
net: Fix assert on net_if_api send for NET_OFFLOAD drivers #10441
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
net: Fix assert on net_if_api send for NET_OFFLOAD drivers #10441
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10441 +/- ##
==========================================
- Coverage 53.18% 53.18% -0.01%
==========================================
Files 210 210
Lines 25821 25825 +4
Branches 5684 5686 +2
==========================================
+ Hits 13733 13735 +2
Misses 9781 9781
- Partials 2307 2309 +2
Continue to review full report at Codecov.
|
subsys/net/ip/net_if.c
Outdated
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.
Well, I guess this is a perfect case to use IS_ENABLED() to avoid repetition. Or maybe we just should define net_if_is_ip_offloaded() to return the right thing for !CONFIG_NET_OFFLOAD case and have even clearer flow.
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.
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.
Yes, @jukkar, actually that would help implement @pfalcon's second suggestion, simplifying to:
if (!net_if_is_ip_offloaded(iface)) { NET_ASSERT(api->send); }
Reason I didn't do that initially was because it seemed net_core favored code size reduction via Kconfig vs readability. But, I much prefer the readability of the run-time check.
How close is #9825 from being merged? Would you prefer I grab commit 1ca71cf as part of this PR, or wait and rebase?
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 just sent this as a separate PR, see #10521
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.
Perfect, thanks!
Recently, the wifi net offload driver has been asserting as init_iface() was checking for api->send != NULL, even in the case of NET_OFFLOAD This patch suggests a fix to handle the NET_OFFLOAD case. Signed-off-by: Gil Pitney <[email protected]>
045007c to
60d03df
Compare
Recently, the wifi net offload driver has been asserting
as init_iface() was checking for api->send != NULL, even in
the case of NET_OFFLOAD
This patch suggests a fix to handle the NET_OFFLOAD case.
Signed-off-by: Gil Pitney [email protected]