Forum Discussion
Altera_Forum
Honored Contributor
15 years agoAn update:
I fixed all or most of the problems in the driver that were causing TCP errors or slow downs and also added some optimizations with help from the FPGA engineer. Now I get: UDP TX 46 MBit/s, tested with 50x1KiB messages TCP TX 38 MBit/s, TCP RX 54 MBit/s with 32KiB socket buffers, 30x128KiB messages The changes:- 110MHz processor with 32KiB caches.
- Updated altera_tse.c. There was a fix in December to reschedule NAPI if there are more descriptors to process. I also changed it to disable IRQs again in this case, I think that is the correct behavior for NAPI.
- TX and RX checksum offload. This is done with a custom FPGA component doing the checksums between the SGDMA and the MAC. Linux has some support for checksum offload, but I had to do hack out some of the checksum calls in the TCP/IP stack to get it to never waste time on them.
- Scatter-gather (NETIF_F_SG) support in the driver. Checksum offload was necessary for this, Linux won't support one without the other. Unaligned transfer support on the SGDMA was also necessary.
- Define NO_TX_IRQ in the driver and fix it to work without a TX interrupt.
- This is actually the important part. To get the driver to correctly work with scatter gather and no TX interrupt, I had to fix it to only restart the SGDMA in one place. Since the SGDMA doesn't provide any feedback on the descriptor it last processed, and it turned out to be very difficult to correctly keep track of this, I have to walk part of the descriptor list in the transmit function to start the SGDMA in the right place. Only restarting the SGDMA in one place made it more reliable and a lock on the TX ring is no longer needed.
- Cut out some error checking in the driver.