What could explain a packet getting stuck in the HPS MAC on RX?
I am using a Cyclone V with dual-Arm processors in an SOC design where we use the HPS MAC to receive packets from a server. We have seen a problem where, using high packet-per-second rates, we see the last packet getting stuck in the MAC on RX.
They way this happens is thus:
- Run iperf3 to send 100 byte TCP packets at the highest rate possible ( about 77K packets per second) to the Cyclone board
- This runs for 1-2 minutes, with no issues.
- The transmission is stopped
- Wireshark is run/cleared using wiretap devices on the wires going into and out of our board (we use two HPS MACs)
- The transmission is restarted
- The very first packet we see coming out, via wireshark, is the last packet we sent in in the previous transmission. Then the new stream's packets will start coming after some delay due to retransmissions and such caused by that bogus first packet.
The first packet is obviously from the previous run as the port number changes for each run of iperf and the port number in that packet is from the previous run. The next packets all have the proper port numbers for this run.
We know the packet is stuck in the MAC for we can set breakpoints in our code and watch the first DMA from the MAC after we restart and see that it's the bad/previous packet. That is, it's not stuck in our system in our own packet buffers or anything like that.
Any ideas on how this could happen? Any possible MAC/DMA configuration that could cause packets to not get pushed out of the MAC at the end of a stream?
Thanks,
Dave