-
Notifications
You must be signed in to change notification settings - Fork 2k
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
drivers/w5100: Fixed netdev_driver_t::recv() API #10412
Conversation
Please note that I do not have the hardware to test. This PR is thus completely untested. |
I just updated the second commit to comply with #10413 |
This driver was initially written by @haukepetersen, so maybe he can help testing this PR or maybe @miri64 also has access to this hardware ? |
In 079ea83 commit message:
|
I don't have hardware to test neither :/ |
@jia200x: Squashed and fixed the commit message as requested. |
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 tested with w5100
on arduino-due
. On current master I was able to ping the link-local address of my laptop from the Arduino and to ping the link-local address of the Arduino from the laptop. However it doesn't work with this PR. When I ping the Arduino from my laptop, I see NS that try to do address resolution on the interface, but no NA in reply. When I ping the laptop from the Arduino I see NS and NAs, but no ICMPv6 echo requests (ping packets). So my guess is the device now drops all packets. I added a comment below with my suspicion why this is, but I am not 100% sure.
@miri64: Mind to check again? Can you confirm that one minute of |
I think something is broken still. While I sometimes am able to ping the laptop from the node I very quickly get:
And that doesn't stop. Mind you, that my setup seems to be a little flaky. Sometimes when I reset the board isn't able to establish the SPI connection and just crashes. :-/ With |
OK, I was able to get an Arduino Ethernet Shield. I should be able to debug this PR |
With the Arduino-Mega2560 this works for me as expected. (I was only able to use My test was:
Output (without the
Output with current master (again eliding
|
Doesn't help :(. I retested this PR on master. There it is pretty stable. BTW when I run into the "possibly lost interrupt" problem and then hit the reset button on the board, initialization fails as reported above (and only then). I only am able to get the device back into a usable state by disconnecting it from USB and replugging. |
OK, previous code did update |
Still having the |
@miri64: I bought an Arduino Due and I'm able to send 100 pings from Linux to the Arudino while simultaneously sending 100 pings from the Arduino to the Linux machine and got 98 response in each direction with this PR. I did so both using my "self-cooked" toolchain and So I guess it works for me as expected, or did you test for longer periods of time? If I'm indeed unable to reproduce your issue, I think chances are high that your board or shield is flanky. Or maybe there is some timing issue in the driver that by luck is not triggered by the code generated by the toolchains I used. Would you mind testing again with binaries generated via the docker build to rule out that the issue is triggered by your toolchain? Btw: The W5100 draws on average 100mA according to this site and the Arudino Due is drawing up to 130mA. Some Notebooks do not comply with the USB standard when it comes to the current they provide. Have you tried to connect the Arudino on a Desktop PC or using a powered USB hub? |
Might be. I'll try later to test with Docker again.
Up until now all tests were done via a USB hub ;-). |
Very likely now. I don't get the device to initialize anymore. :( I guess then I just have to trust your testing. At least it was not worse than before (since we now at least have output during the endless loop). Please squash. |
The netdev_driver_t::recv implementation of the w5100 does not provide the drop feature. This commit adds it. Fixes: RIOT-OS#10410
If netdev_driver_t::recv() is called and the provided buffer is smaller than the frame then `-ENOBUFS` should be returned, the frame should be dropped, and no data of the frame should be returned. Addresses: RIOT-OS#10413
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.
ACK from my side
@jia200x: I think I addressed your remarks. Can you take a look and confirm? |
@jia200x: Your "changes requested" is currently blocking this PR. I think I addressed them. Can you have a look? |
Oh sorry. Sure, I will |
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.
ACK on my side
Yepp. |
It's a bug fix, should be backport in 2019.01 ? |
Yepp. @maribu can you provide one please? |
Contribution description
The current implementation of the
netdev_driver_t::recv()
API in the W5100 driver does not comply with documentation:recv()
is not implemented-ENOBUFS
Testing procedure
It would be nice to add a test application for this, as many drivers are affected...
Issues/PRs references
#10410, #10413
Update 1: Added reference to #10413