Part Number: AM5708
Other Parts Discussed in Thread: AM5728
Hi:
I have a custom AM5708 based board and SDK6.02. I have an ethernet board with 2 interfaces (eth1 and eth2) over PRU_2.
There is another ethernet interface over GMAC port (eth0). In all these cases the phyter is DP83822 and the physical media is cable.
The issue only happens in the PRU ethernet interfaces (eth1 and eth2), not in the GMAC interface (eth0) under the same testing conditions.
If there is medium-high transmission rate, the issue comes up when unplugging and plugging back the cable. In this case the interface stops
sending packets.
After some investigation here are my comments:
1.- This behavior does not happen in GMAC port. It is not affected by high tx/rx traffic.
2.- PRU ports continue to receive high traffic messages, but they don´t send anything out any more.
3.- The only way to recover PRU ports are by doing "ifconfig down" and then "ifconfig up".
In this process the PRU firmwares are loaded again, so they start from an initial conditions.
4. After debugging the code, the issue seems to be in "prueth.c" in the transmission part.
Here below you have this piece of code in function "emac_ndo_start_xmit()":
qid = prueth_get_tx_queue_id(emac->prueth, skb);
if (emac->port_id == PRUETH_PORT_MII0) {
/* packet sent on MII0 */
ret = prueth_tx_enqueue(emac, skb, PRUETH_PORT_QUEUE_MII0,
qid);
} else if (emac->port_id == PRUETH_PORT_MII1) {
/* packet sent on MII1 */
ret = prueth_tx_enqueue(emac, skb, PRUETH_PORT_QUEUE_MII1,
qid);
} else {
goto fail_tx; /* switch mode not supported yet */
}
if (ret) {
if (ret != -ENOBUFS && ret != -EBUSY) {
if (netif_msg_tx_err(emac) && net_ratelimit())
netdev_err(ndev,
"packet queue failed: %d\n", ret);
goto fail_tx;
} else {
return NETDEV_TX_BUSY;
}
}
Comments about this piece of code:
1.- If I run this code, when there is high tx traffic and unplugging/plugging the cable, the system goes
very slowly and the message "RT Throttling actived" appears in the console. After a short
time, linux crashes.
To avoid this I have to replace "return NETDEV_TX_BUSY" with "goto fail_tx".
2.- When the problem comes up I see that function "ret = prueth_tx_enqueue()" is returning "-ENOBUFS".
and no messages are sent out. Reception is fine in this situation; it still continues to receive messages.
The only way I found to get out of this situation and come back to a normal situation is by issuing "ifconfig eth1 down"
and then "ifconfig eth1 up". (The same for eth2 interface).
Regards
Billa