-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Ethernet not working until ping is sent from the Pi (Only happens on Pi3b+) #2617
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
Comments
Probably because the driver doesn't start polling for incoming packets until an outbound one has been sent. Think driver needs a |
@vanfanel I'm not able to reproduce your issue with Rasbian and Kernel 4.14.54 (downstream) and 4.18rc3 (upstream). I added the following to /etc/dhcpcd.conf: And this to /etc/network/interfaces: Then i bring up the interface manual with the commands like in your script. So please provide your changes more in detail. Also the output of |
@maxnet : Thanks to your comment, I may have an idea on what's going on: since most people run Raspbian with services that are sending packets from the Pi3b+ at startup and I don't, this problem may have gone unnoticed to most people. @lategoodbye : dhcpcd is NOT running on my system. There are no other services sending packets from the Pi. This is my list of services run at startup:
This is all my system needs. So the first difference about your system and mine is that you could have something sending some packets outside the Pi after you bring up the interface and configure it, while I don't. Now, this is the output of
The IP is correct, as is the mask. |
Does is reproducible to me.
Now configure IP manually. |
Yes, I see the failure with that configuration. A tcpdump in one terminal window on the Pi recording all activity sees no traffic until the very first packet is transmitted, at which point incoming traffic appears. |
I suspect from my limited reading of the source, that there is a missing netif_wake_queue. There is one in lan78xx_rx_bh which kicks the queue, I presume if something is received, there's another in lan78xx_delayedwork, I think only activated if the EVENT_TX_HALT bit is set, but I wonder if there needs to be one somewhere else just to kick everything in to life on first startup. Or perhaps the EVENT_TX_HALT bit needs setting somewhere on start? |
I don't have time to compile a kernel today myself, so haven't tried it. Try if it helps if you insert a As long as the tasklet is started once, it will reschedule itself again and again afterwards. |
You are absolutely right. usbnet ( used by smsc95xx ) already does this since 2.6.12, which really scares me because both drivers seems to have the same roots. Until the driver is ported to usbnet, the lan78xx should do the same and schedule the tasklet from the net device open callback. |
Wouldn't the moment the link is actually up (it has carrier), instead of when device is opened, be better? |
I think improving the polling should be done with an different patch, because the polling will be still aggressive if we disconnect the cable after the tasklet has been scheduled once. It's also important to keep the driver easy to read. |
Ok, fair enough. For later reference: this is how usbnet prevents polling when link is down: 4b49f58 |
That's definitely worth having - both the extra bandwidth and likely power saving. |
I agree this is scary - as I referred in another issue, this should really use usbnet rather than hacking out great chucks of it's code which then never get the usbnet bug fixes. |
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: #2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
Having a play incorproating the polling commit referenced above. Not trivial, having to guess where to put some stuff, as usbnet has diverged significantly in some places, but seem to start up, however, pulling the ethernet cable and it doesn't realise it's gone! |
As i said the polling behavior is a different issue, so we better don't mix them here. Instead of trying to backport features from usbnet it would be better to make the driver use usbnet. I think a simple cherry-pick won't work. Back to the issue here, i'm waiting from feedback from @vanfanel and @dgriswo until i send the patch upstream. |
Although just tested with a Top of tree kernel, and that shows the same symptoms. Unplug the ethernet plug, network icon top right stays on, ifconfig still indicates connected. Hmm. |
@lategoodbye Definitely not a cherry pick - the differences are considerable. The effort to move it to usbnet is also, I suspect, considerable. Can you try pulling the ethernet cable and seeing what happens? I suspect we may have introduced a regression (unless this has never operated correctly). |
I currently don't have access to my Pi 3B+ so you have to wait until the evening. |
@JamesH65 Thanks for spotting this. I can confirm that the link level isn't properly update as long as the dhcpcd is disabled. I reverted my last 2 patches and the symptom stays the same. So this isn't a regression, it never worked before :-( Maybe we should open a new issue for this. Unfortunately i don't have the time for fixing this. |
Isn't that how it is supposed to work? |
I would expect that the Ethernet LED state and |
This appears to be an issue with this commit #2614, . In my tests I reverted that commit, functionality came back, put it back in, functionality broke. I have no idea why that might be - seems to be entirely unrelated to the effect being seen. Only thing that vaguely comes to mind is that if something 'underneath' during the queue walk tries to grab that spinlock, find it cannot, and gives up. Shoudl probably continue this discussion on the PR. |
I cannot confirm your observation. I reverted this patch, too and the issue is still there. This patch has nothing to do with link level handling. |
Does go to 0 for me.
Do have that commit in my build. (As far as the icon in Raspbian goes, be aware it's a dhcpcd frontend, so don't look at that if dhcpcd is not running) |
@maxnet Do you have the same configuration as described to reproduce the original issue (dhcpcd off, manual and static ip configuration)? |
I see the issue even with dhcpcd running, and it's this commit (not the skb locking fix) that makes the difference. This one-liner shows the problem:
In the failure case, only the output from ethtool changes when the cable is unplugged. |
Yes
Unplug my cable
|
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
[ Upstream commit 136f55f660192ce04af091642efc75d85e017364 ] As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet after link reset. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
[ Upstream commit 136f55f660192ce04af091642efc75d85e017364 ] As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet after link reset. Link: raspberrypi/linux#2617 Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
[ Upstream commit 136f55f ] As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet after link reset. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 136f55f660192ce04af091642efc75d85e017364 ] As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet after link reset. Link: raspberrypi/linux#2617 Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 136f55f660192ce04af091642efc75d85e017364 ] As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet after link reset. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet during ndo_open like in usbnet. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]>
[ Upstream commit 136f55f660192ce04af091642efc75d85e017364 ] As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet after link reset. Link: raspberrypi/linux#2617 Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 136f55f660192ce04af091642efc75d85e017364 ] As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet after link reset. Link: raspberrypi/linux#2617 Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 136f55f660192ce04af091642efc75d85e017364 ] As long the bh tasklet isn't scheduled once, no packet from the rx path will be handled. Since the tx path also schedule the same tasklet this situation only persits until the first packet transmission. So fix this issue by scheduling the tasklet after link reset. Link: raspberrypi/linux#2617 Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet") Suggested-by: Floris Bos <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Hi there,
I am not using dhcpcd. I am manually setting up the wired networking as I have been doing for years, but I have just moved from Pi3b to Pi3b+ and I found that I can't ping the Pi3b+ from the PC unless I ping the PC from the pi3b+ first. Strange!
Just in case, this is the simple sequence of commands I am using on my personal networking setup script:
Any ideas on what's going on?
The text was updated successfully, but these errors were encountered: