-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix greentea test mbed-os-tests-netsocket-connectivity #5649
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
Conversation
…vity pass for target Realtek AMEBA
ret = mbed_lwip_emac_init(emac); | ||
if (ret == NSAPI_ERROR_OK) { | ||
netif_inited = true; | ||
if(netif_inited == false){ |
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.
Formatting - missing spaces around ()
.
I'd kind of like a sanity check on the other case where we are already inited, rather than always just returning OK. Something like
if (netif_is_ppp || emac != lwip_netif.state) {
ret = NSAPI_ERROR_PARAMETER;
}
to catch someone trying to register a different EMAC, which we couldn't cope with.
Mind you, thinking about it, if you're making this change because you're calling this on every connect
to your driver, you shouldn't be doing that - this should be a one-off operation - if (!inited)
in your driver's connect, or do it on construction. That will match better the coming multiple-interface world (#5558).
So I'm wondering if we should actually be faulting any second init call with NSAPI_ERROR_PARAMETER - effectively saying "we don't (yet) support a second interface".
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 tried modifying my driver to call the mbed_lwip_init function only once but it still fails connectivity test for bring the network up and down twice. I tried putting the call in constructor, I also made the check as you mentioned but the test still fails.
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'm not familiar with this test - is there a possibility that the mbed_lwip_xxx stuff is fundamentally bugged in some way that prevents this passing? Do any other EMAC drivers pass this test?
@SeppoTakalo - do we have an equivalent test?
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.
Can't see any obvious reason for failure - the bringup/bringdown logic in lwip_stack.c for a 2nd go around is much the same between native lwIP drivers and EMAC drivers, and I know native lwIP drivers are passing.
Calling mbed_lwip_bringdown (in your disconnect) followed by mbed_lwip_bringup (in your connect) should work.
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.
Ok I called the bringdown in my disconnect, it worked, shall I update the changes in this PR or create a new one? The new changes are only in my device driver and not in lwip_stack.
…connectivity pass for target Realtek AMEBA" This reverts commit 1fcfced.
Have pushed the latest changes as decided to this PR. Latest changes in commit |
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.
Logic looks correct to me now, but formatting is a bit messed up - tabs instead of spaces.
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.
Fix the formatting.
For indent, configure your editor to insert spaces instead of tabs. Tab width varies, depending on your editor configuration, we cannot rely on it to be standard 8 spaces.
/morph build |
Build : SUCCESSBuild number : 700 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 342 |
Test : SUCCESSBuild number : 530 |
Is this PR merged yet, Shall I delete the branch? |
It has not been merged, it's now ready for integration, will be merged soon. |
Exporter Build : FAILUREBuild number : 381 |
Fix in lwip_stack to pass greentea test for Realtek RTL8195A platform
Notes:
Description
This is a fix in the lwip stack to ensure that the netif is not being initialized twice. In the earlier version the netif was being inialized twice and hence the test "bring the network up and down twice" was faling.
Status
READY
Migrations
No other changes other than in lwip_stack.c
Related PRs
None
Todos
Deploy notes
No change in build/test environment needed.
Steps to test or reproduce
download and run the greentea test corresponding to the test using the command
mbed test -n mbed-os-tests-netsocket-connectivity --test-config Realtek_wifi
Before running the command make sure to input the wi-fi credentials in mbed-os\tools\test_configs\RealtekInterface.json