-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: regression on native IP stack when an offload driver is present #61173
Comments
How do you switch between native/offloaded interfaces? I'm asking, because NET_OFFLOAD offloading is known of not being well prepared to work with multiple interfaces in the system (https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/ip/net_context.c#L258, https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/ip/net_context.c#L330) - it will always assume the default interface should be used. Are you switching the default interface before allocating socket/net_context? Anyway, I can see one possible issue with native interfaces when NET_OFFLOAD is enabled - after the change which installs the recv handler before connect, this line might be an issue: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/ip/net_context.c#L2114. In case of native interface, the Given that we now assign the interface to the context during context creation for offloaded cases (see #59851) I think we could update static inline bool net_if_is_ip_offloaded(struct net_if *iface)
{
#if defined(CONFIG_NET_OFFLOAD)
- NET_ASSERT(iface);
- NET_ASSERT(iface->if_dev);
-
- return (iface->if_dev->offload != NULL);
+ return (iface != NULL && iface->if_dev != NULL &&
+ iface->if_dev->offload != NULL);
#else
ARG_UNUSED(iface); |
Hi @rlubos, Thank you for your answer. Impressive : I rebased from current 3.4 and apply your patch : it works like a charm. I can do PR or can leave you do so as you want. |
@RomainPelletant I've opened #61215 with the fix. |
Describe the bug
In case we include ethernet driver (enc424j600) and wifi offload driver (esp-at), the ethernet interface is no more usable and go into hard fault.
We are only using one interface at a time (exchangeable).
But, surprisingly, Wi-Fi interface is working well when selected.
Please also mention any information which could help others to understand
the problem you're facing:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Connect succesfull
** Workaround **
Revert PR #58232
Impact
showstopper
Additional context
Duplicate of issue #58435
The text was updated successfully, but these errors were encountered: