Hi Team,
Customer is using Linux SDK 8.2 for AM6548--They are trying to use the PRU to auto-forward packets from RX0 port to their TX1 port. Ideally, they'd like to use the AM65x as a sniffer on this comms line.
This auto-forwarding works fine on low-speed tests (<100MHz), but when moving up to higher speeds (1GHz) the kernel crashes. Here's some info on the current status from the customer:
"
The kernel crash is happening because the driver tries to push a packet of length 1563 into a socket buffer that was allocated as the max allowable size of 1522. I can prevent the kernel crash from happening by just increasing the max allowable packet size to 1600 in the driver so that it allocates 1600 bytes every packet instead of 1522, rebuilding the driver, and following the same procedure I did before. What this seems to mean though is that something with the auto forwarding settings isn’t quite right. I should never be getting packets of lengths > 1522, so somehow packets are getting mushed together, and then the kernel freaks out when that packet is too long. Any ideas on the correct register settings in regards to auto forwarding to prevent this from happening?
Again it would seem the actual packet forwarding is functioning correctly, just what the driver is reading isn’t correct. I am waiting on a better network tap to verify as my current one has some issues, but it can capture the network traffic well enough. When comparing the two captures, I can see that occasionally the PRU ethernet isn’t getting the whole packet or sometimes misses a smaller packet entirely. In the below screencap, the first 66 bytes are missing, but then the rest of the data is correct (PRU ethernet capture on left, network tap on right)
It’s almost as if the PRU isn’t getting notified that the frame was there at the proper time, and so that RX L2 buffer gets overwritten before it can be read. That’s pretty much a wild guess at this point though. So yeah I guess my question is am I missing something in my settings that might explain all of this?
Settings are as follows right now:
RXCFG0 = 0x5B = RX_AUTO_FWD_PRE0 | RX_L2_EN0 | RX_MUX_SEL0 | RX_DATA_RDY_MODE_ DIS0 | RX_ENABLE0
RXCFG1 = 0x53 = RX_AUTO_FWD_PRE1 | RX_L2_EN1 | RX_DATA_RDY_MODE_ DIS1 | RX_ENABLE1
TXCFG0 = 0x140201 = TX_START_DELAY0 = 0x14 | PRE_TX_AUTO_SEQUENCE0| TX_ENABLE0
TXCFG1 = 0x140301 = TX_START_DELAY0 = 0x14 | PRE_TX_AUTO_SEQUENCE0| TX_MUX_SEL0 | TX_ENABLE0
MII_G_RT_ICSS_G_CFG = 0x1002D = RGMII | RGMII | RX_L2_G_EN | TX_L1_EN
"
Any suggestions on modifications to the PRU settings that may be able to mitigate this?
BR,
-RT