This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cpsw davinci driver poor dma performance



I profiled our drivers transmit routine.  It looks there are large delays when DMA.  The kdiff values are in nanoseconds from the time I call cpdma_chan_submit, till the tx_handler is called.  The bytes is the number of bytes in the dma. the times have outliers in the 6572650 range.  I would be interested to know if there has been a patch or fix to this.  thanks.

K-

root@touchlink-9059af3cfac8:~# /media/sdb1/main 10 192.168.0.1
[  196.010000] cpsw_tx_handler:684 dma diff 0 kdiff 55600 bytes 1502
[  196.020000] cpsw_tx_handler:684 dma diff 0 kdiff 27750 bytes 1502
[  196.030000] cpsw_tx_handler:684 dma diff 0 kdiff 43450 bytes 1502
[  196.040000] cpsw_tx_handler:684 dma diff 0 kdiff 27400 bytes 1502
[  196.060000] cpsw_tx_handler:684 dma diff 0 kdiff 45450 bytes 1502
[  196.060000] cpsw_tx_handler:684 dma diff 0 kdiff 28100 bytes 1502
[  196.070000] cpsw_tx_handler:684 dma diff 0 kdiff 40900 bytes 1502
[  196.080000] cpsw_tx_handler:684 dma diff 6 kdiff 6572650 bytes 1502
[  196.110000] cpsw_tx_handler:684 dma diff 0 kdiff 48050 bytes 1502
[  196.110000] cpsw_tx_handler:684 dma diff 0 kdiff 27450 bytes 1502
end 1395019098 nsec 739626850  start 1395019098 nsec 642101350
pack 10 bytes 14600 bits 116800 ms 97525 pac 9752 bytes 0
root@touchlink-9059af3cfac8:~# /media/sdb1/main 10 192.168.0.1
[  214.400000] cpsw_tx_handler:684 dma diff 0 kdiff 51800 bytes 1502
[  214.400000] cpsw_tx_handler:684 dma diff 0 kdiff 29800 bytes 1502
[  214.410000] cpsw_tx_handler:684 dma diff 0 kdiff 43700 bytes 1502
[  214.420000] cpsw_tx_handler:684 dma diff 6 kdiff 6580201 bytes 1502
[  214.440000] cpsw_tx_handler:684 dma diff 0 kdiff 49550 bytes 1502
[  214.440000] cpsw_tx_handler:684 dma diff 0 kdiff 28250 bytes 1502
[  214.450000] cpsw_tx_handler:684 dma diff 0 kdiff 29800 bytes 1502
[  214.470000] cpsw_tx_handler:684 dma diff 0 kdiff 38550 bytes 1502
[  214.470000] cpsw_tx_handler:684 dma diff 0 kdiff 29550 bytes 1502
[  214.480000] cpsw_tx_handler:684 dma diff 0 kdiff 35150 bytes 1502
end 1395019144 nsec 229010251  start 1395019144 nsec 147718950
pack 10 bytes 14600 bits 116800 ms 81291 pac 8129 bytes 0
root@touchlink-9059af3cfac8:~# /media/sdb1/main 10 192.168.0.1
[  218.580000] cpsw_tx_handler:684 dma diff 0 kdiff 50050 bytes 1502
[  218.590000] cpsw_tx_handler:684 dma diff 0 kdiff 46750 bytes 1502
[  218.590000] cpsw_tx_handler:684 dma diff 0 kdiff 28200 bytes 1502
[  218.600000] cpsw_tx_handler:684 dma diff 0 kdiff 37650 bytes 1502
[  218.610000] cpsw_tx_handler:684 dma diff 6 kdiff 6562350 bytes 1502
[  218.620000] cpsw_tx_handler:684 dma diff 0 kdiff 42200 bytes 1502
[  218.620000] cpsw_tx_handler:684 dma diff 6 kdiff 6532700 bytes 1502
[  218.630000] cpsw_tx_handler:684 dma diff 0 kdiff 40300 bytes 1502
[  218.640000] cpsw_tx_handler:684 dma diff 6 kdiff 6542050 bytes 1502
[  218.640000] cpsw_tx_handler:684 dma diff 0 kdiff 33250 bytes 1502
end 1395019148 nsec 394431599  start 1395019148 nsec 327564051
pack 10 bytes 14600 bits 116800 ms 66867 pac 6686 bytes 0

  •  If I understand correctly I believe you have instrumented the time from packet queuing to after the packet has been sent. The variance in time is because is coming the various other things the processor is doing, including going through the interrupt handler and whatever the processor has been doing at the time.  In essence there is more than just the transmit time that is being measured.

    What is the transmit bit rate you are trying to acheive? Or what are you trying to acheive with the transmit time? There are a lot of variables here, which processor and board are you benchmarking? It also depends on what else the processor is doing in addition to the networking.