dma_ip_drivers
dma_ip_drivers copied to clipboard
XDMA: End of packet has issues and needs more testing.
I ran a simple test on the new EOP code added by 2c01de2211bcf452e90cb65b2ee49fcaafda375c and the code fails with larger transfer sizes. Sometimes the reported number of transfered bytes is negative, other times the transfer is accidentally split in two.
Rather than posting the exact failures, I think it's probably best to just write a test bash script similar to the already present one but using the -e
flag with longer transactions.
I've included a sample test script below. With sizes of 100kB+ the transfers fail quite often with too few bytes received, too many bytes received, or negative bytes received (very large value indicitive of overflow).
#!/bin/bash
tool_path=../tools
transferSize=${1:-4096}
transferMax=${2:-8192}
transferCount=${3:-1}
# Read max transfer size.
$tool_path/dma_from_device -v -e -d /dev/xdma0_c2h_0 -f data/output_temp.bin -s $transferMax -c $transferCount &
sleep 0.1
# Write smaller transfers.
$tool_path/dma_to_device -v -d /dev/xdma0_h2c_0 -f data/datafile_32M.bin -s $transferSize -c $transferCount &
wait
# Compare the last transfer.
cmp data/output_temp.bin data/datafile_32M.bin -n $transferSize
if [ ! $? == 0 ]; then
echo "Error: The data written does not match the data that was read."
else
echo "Info: Data check passed."
fi