Comments (7)
The first things I think of would be:
- Make sure that the AXI DMA driver is loaded (either compiled into the kernel or added as a module).
- Make sure your devicetree contains both the nodes for the AXI DMA core, and for ezdma (and that the ezdma node properly refers to the AXI DMA's node).
Notes:
If the AXI DMA driver is compiled as a module and its "compatible" attribute is correct, the OS will usually load the module automatically at boot.
If you're not sure about whether the device tree is correct you could post it here and I could take a look to see if anything obvious jumps out at me. A .dts or .dtb file is fine.
from ezdma.
from ezdma.
By not using petalinux, I just succeeded in inserting ezdma module into linux kernel, and now character files "loop_tx" and "loop_rx" could be oberved in dir β/devβ. Then I tried to test speed of ezdma:
bash' arm-xilinx-linux-gnueabi-gcc ezdma_speed_test.c -lrt -o speed_test
bash' ./speed_test
I find "write(tx_fd, tx_buf, PACKET_SIZE)" and "read (rx_fd, rx_buf, PACKET_SIZE)" in "ezdma_speed_test.c " can only pass once and the former is dump in the next loop. I am trying to solve this problem. Any suggestions? ^_^
from ezdma.
Glad to hear you got it loaded. As for the issue with the loop only executing once -- do you see any complaints from the AXI DMA driver in dmesg? What does the output of speed_test look like?
from ezdma.
@jeremytrimble I added several printed info into the source code as follows:
while ( i < NUM_TRIALS )
{
assert( PACKET_SIZE == write(tx_fd, tx_buf, PACKET_SIZE) );
printf("write complete!\n");
assert( PACKET_SIZE == read (rx_fd, rx_buf, PACKET_SIZE) );
printf("read complete!\n");
//{
//int rv = read (rx_fd, rx_buf, PACKET_SIZE);
//printf("read returned %d\n", rv);
//}
{
int j;
for (j = 0; j < PACKET_SIZE; ++j)
{
if ( rx_buf[j] != tx_buf[j] )
{
printf("ERROR IN DATA\n");
printf(" @ j=%d: rx_buf[%d]: %u, tx_buf[%d]: %u\n",
j, j, rx_buf[j], j, tx_buf[j]);
return 2;
}
}
}
tx_buf[i % PACKET_SIZE] += 5; // modify data each time
i++;
printf("%d\n", i);
}
The output in terminal is:
write complete!
read complete!
1
write complete!
It seems blocked at "read (rx_fd, rx_buf, PACKET_SIZE)" among the second loop. When I modify PACKET_SIZE=1024, the test runs successfully, and achieves ~8.2 MBytes/s throughput. How to improve the data rate of transferred? Another report shows a data rate of 270MB/s transferred from the PS to the PL and back could be achieved. (https://tobygomersallwordpresscom.wordpress.com/blog/)
from ezdma.
Darren,
I'm not sure why the test is only succeeding when the packet size is reduced -- how deep is your FIFO configured in the PL?
Performance-wise, the throughput is dependent on a number of factors as I'm sure you know. Clock speeds, which AXI PS/PL interfaces you're using (and how deep you have the associated FIFOs configured) are a few factors that play a role.
Another thing to note is that in the case of ezdma_speed_test.c, the "throughput" being measured is based on a "round trip" (e.g. data being sent into the PL by the write() call, and then read back out by the read() call), and the write() and read() happen synchronously (in the same thread). Decoupling the write() and read() (performing them in separate threads or separate processes, if appropriate for your application) could speed things up considerably.
Also, in order to use simple write() and read() calls, ezdma has to "map" the associated memory for each read() or write() call -- this "mapping" process basically makes the memory visible to the DMA core, and sometimes has to be done on a page-by-page basis, which incurs some overhead for every read()/write() call. More optimized DMA schemes are able to reduce this overhead but make the process much more complicated (see the "IIO" subsystem in the kernel).
from ezdma.
I have the same problem in petalinux:
"ezdma: allocated chrdev region: Major: 244 , Minor: 0-8
probing ezdma
ezdma: couldn't find dma channel: loop_tx, deferring...
ezdma: loop_tx (TX) available
ezdma: couldn't find dma channel: loop_rx, deferring...
ezdma: loop_rx (RX) available"
from ezdma.
Related Issues (17)
- Status? HOT 3
- Use ezdma from kernel-space HOT 4
- Trouble working with pl330 HOT 6
- Kernel error with dma size of 65 KB HOT 2
- dma_map_sg fails HOT 3
- Was this Module added to mainline kernel? HOT 1
- userspace nodes for Debain rootfs HOT 1
- QUESTION
- zynq Ultrscale +
- read() throws error when transfer size is 1 MB HOT 8
- DMA transactions read() or write() with size bigger than 32 kB DMA transactions, Is Possible?? HOT 7
- Physical Addresses HOT 2
- Loopback Devicetree Troubles HOT 5
- Does ezdma support contiguous memory ? HOT 3
- Problem stopping an uncompleted read or write operation HOT 5
- Transferring very large DMA buffers HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ezdma.