BeagleBone Black: Ethernet transmits packets but does not receive them

I see a similar issue on my Beaglebone Black. eth0 comes up initially but if I take it down it won’t come back without a reboot. When it is in this state, Wireshark can see packets coming to and from the BBB on the wire, but TX and RX stats displayed in ifconfig do not increase.

I have tried this with:

  • two different BBBs,
  • three different Linux 3.8 loads (the 3.8.11 it shipped with, 3.8.13 (2013-06-06, booting from SD), and a Debian demo image (3.8.13-bone20).
  • 5V1A supply or USB power.
  • I have the serial FTDI cable.

Example:

— after boot (just the eth0 dmesg shown): ----

root@beaglebone:~# dmesg

… // just the eth -related ones (I think)

[ 12.843873] net eth0: initializing cpsw version 1.12 (0)
[ 12.848216] net eth0: phy found : id is : 0x7c0f1
[ 12.848248] libphy: PHY 4a101000.mdio:01 not found
[ 12.853364] net eth0: phy 4a101000.mdio:01 not found on slave 1
[ 12.920613] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 15.926429] libphy: 4a101000.mdio:00 - Link is Up - 100/Full
[ 15.926491] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

// eth0 did dhcp and came up automatically

root@beaglebone:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr C8:A0:30:B6:B0:AB
inet addr:10.10.10.100 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::caa0:30ff:feb6:b0ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16 errors:0 dropped:1 overruns:0 frame:0
TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2421 (2.3 KiB) TX bytes:5349 (5.2 KiB)
Interrupt:56

// take it down.

root@beaglebone:~# ifconfig eth0 down
root@beaglebone:~# ifconfig -a eth0

eth0 Link encap:Ethernet HWaddr C8:A0:30:B6:B0:AB
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:21 errors:0 dropped:1 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3119 (3.0 KiB) TX bytes:5841 (5.7 KiB)
Interrupt:56

// take it back up.
// TX and RX stop incrementing, even though when we do
// udhcpc we can see traffic to and from the bone on the wire!.
// ( note I think the libphy messages about mdio:01 are a red herring,
// relating to the not-present second slave port?? )

root@beaglebone:~# ifconfig eth0 up
[ 46.543648] libphy: PHY 4a101000.mdio:01 not found
[ 46.548717] net eth0: phy 4a101000.mdio:01 not found on slave 1
root@beaglebone:~#
root@beaglebone:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr C8:A0:30:B6:B0:AB
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21 errors:0 dropped:1 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3119 (3.0 KiB) TX bytes:5841 (5.7 KiB)
Interrupt:56

root@beaglebone:~# udhcpc -i eth0
udhcpc (v1.20.2) started
Sending discover…
Sending discover…
Sending discover…
Sending discover…
Sending discover…
Sending discover…
^C
root@beaglebone:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr C8:A0:30:B6:B0:AB
inet addr:169.254.66.231 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21 errors:0 dropped:1 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3119 (3.0 KiB) TX bytes:5841 (5.7 KiB)
Interrupt:56

// new dmesg after ifconfig eth0 down and then ifconfig eth0 up:

[ 250.747282] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

[ 264.214253] net eth0: initializing cpsw version 1.12 (0)

[ 264.217970] net eth0: phy found : id is : 0x7c0f1

[ 264.218000] libphy: PHY 4a101000.mdio:01 not found

[ 264.223112] net eth0: phy 4a101000.mdio:01 not found on slave 1

[ 264.234179] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

[ 266.223290] libphy: 4a101000.mdio:00 - Link is Up - 100/Full

[ 266.223348] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

When testing it with the debian image I also tried

network restart /etc/init.d/network restart, same results.

I have found eth0 is very stable on the Beaglebone White and from the schematic nothing has changed, so I am wondering about the driver changes under 3.8 kernel … but can’t find any known issues or patches or anything. Linux Noob so maybe looking in the wrong places.

Thanks -

Kathryn.

I can reproduce this behavior as well…note that I’m not on the 2013-06-06 image, but on the 2013.05.27 (I’m waiting to upgrade to 2013.06.17).
Initially I suspected that this was due to interaction with connman (which is quite poorly documented) however I’m not so sure.

In short, if “ifconfig eth0 down” is ever run, reboot is required to recover the ethernet port (even disconnecting/reconnecting the cable won’t recover the port)
Also it behaves as the OP and Kathryn noted (transmit counted in ifconfig counts, but no rx counts).

So perhaps there’s a software bug here? maybe something is not re-configured properly after “ifconfig eth0 up” or some power management interaction?

FWIW, the following will disconnect/reconnect without issues…but note the interface is not marked down.
Connman flags are: * = favorite, A = autoconnect, R = ready, O = online

root@beaglebone:~# /usr/lib/connman/test/test-connman services

  • AO Wired { ethernet_c8a030aec6a8_cable }

root@beaglebone:~# /usr/lib/connman/test/test-connman disconnect ethernet_c8a030aec6a8_cable

root@beaglebone:~# ifconfig eth0

eth0 Link encap:Ethernet HWaddr C8:A0:30:AE:C6:A8

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:13 errors:0 dropped:0 overruns:0 frame:0

TX packets:51 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:2317 (2.2 KiB) TX bytes:10628 (10.3 KiB)

Interrupt:56

root@beaglebone:~# /usr/lib/connman/test/test-connman state

System is idle

root@beaglebone:~# /usr/lib/connman/test/test-connman services

  • A Wired { ethernet_c8a030aec6a8_cable }

root@beaglebone:~# /usr/lib/connman/test/test-connman connect ethernet_c8a030aec

6a8_cable

root@beaglebone:~# /usr/lib/connman/test/test-connman services

  • AO Wired { ethernet_c8a030aec6a8_cable }

root@beaglebone:~# ifconfig eth0

eth0 Link encap:Ethernet HWaddr C8:A0:30:AE:C6:A8

inet addr:192.168.3.200 Bcast:192.168.3.255 Mask:255.255.255.0

inet6 addr: fe80::caa0:30ff:feae:c6a8/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:26 errors:0 dropped:0 overruns:0 frame:0

TX packets:98 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:4634 (4.5 KiB) TX bytes:20521 (20.0 KiB)

Interrupt:56

root@beaglebone:~# ping 192.168.3.1

PING 192.168.3.1 (192.168.3.1) 56(84) bytes of data.

64 bytes from 192.168.3.1: icmp_req=1 ttl=64 time=0.275 ms

-Dale

Similar story here.
running Arch, Ethernet connnects once with DHCP (both dhcpcd and dhclient), either at boot or when plugged in (using netctl-ifplugd). after replugging, or down - up no more received packets.
the same configuration on a raspberry pi works without a hitch (off course the raspi is armv6l and kernel 3.6.11 (no device tree)). I don’t think I made a configuration error.

running Arch, kernel 3.8.13-bone21 (home built) and kernel 3.8.13-3 (stock) same behavior on both
It is clearly not limited to one distro.

LP

PLyttle,

I’m having the exact same issue with those kernels. I tried RCN’s Ubuntu and Debian images and both have the issue, and another with my own custom kernel based on that one. Unplugging the ethernet for >30 seconds and plugging back in makes it no longer work, and doing ifconfig eth0 down, then up and it never works, dhclient can’t get another IP.
But it does work on startup the once, like you said.

I’m not sure it is a hardware issue though because it happens on both of my rev A5A BBB boards with Ubuntu/Debian but NOT with the Angstrom image, that one seems to come back up with Ethernet no problem.

I believe it's a problem in the cpsw ethernet driver.. As the
beaglebone (classic) seems to have the same issue with v3.8.x, where
it worked fine with the old v3.2.x board tree..

Regards,

Thank you Robert, that would make sense.
I suspected there may be problems with the SMSC LAN8710 driver and tried this patch: http://www.spinics.net/lists/netdev/msg218399.html on the 3.8.13-22 kernel (newest pull from git) but it did not appear to fix it.

I guess the driver isn’t fully supported by the kernel? According to http://processors.wiki.ti.com/index.php/AM335x_CPSW_(Ethernet)_Driver’s_Guide I should be able to change things like Interrupt Pacing, but it says it is not supported:

"

ubuntu@arm:~$ sudo ethtool -C eth0 rx-usecs 500
Cannot get device coalesce settings: Operation not supported
"

I did notice one more curious thing. Sometimes after I unplug and plug the Ethernet cable back in and cannot ping the BBB, if I connect the USB to establish the USB gadget ethernet, it forces the other one to come back up and respond.

If I do this over and over a few times, it eventually stops working, but for a couple of tries, it did somehow force the main PHY to recover.

I compiled a kernel with the cpsw driver as a module. This needs fixing of the davinci_cpdma.c source, because it does not export the symbols GPL(cpdma_ctlr_int_ctrl); GPL(cpdma_ctlr_eoi); GPL(cpdma_control_set). Fortunately Internet is a big help here :slight_smile:

when booting in this new kernel with netctl for eth0 enabled (standard dynamic profile)
modprobe ti_cpsw
netctl start eth0

everything works normally even unplugging and replugging the RJ-45 cable re-initiates the network (improvement here)

netctl stop eth0 stops the interface without apparent mishap, but when followed by netctl start eth0 no more received packets, which shows up as a failed dhcp lease attempt and netctl@eth0.service entering a failed state.

The reason why I attempted a modular driver was to try to unload the module at this point an reload it to see if that would re-create a working interface, but this results in a kernel bug
[ 1734.862884] kernel BUG at net/core/dev.c:6286!
[ 1734.867528] Internal error: Oops - BUG: 0 [#1] ARM

and a segment error upon reboot.
Unable to handle kernel NULL pointer dereference at virtual address 00000000

I saved the stack trace if someone is interested.

LP