Originally Posted by
volca
Hey, sorry for the delay.
I left the effort sometime at the end of last year, solely for the lack of time. The state I left it was that I still didn't come up with a way to stop the freezes. I think the culprit is double sema locking, so disabling interrupts instead could help. The only combination that did work was using the SMS assembly fifo handling with the threaded SMAP code, which produced some 0.5 Mb/s speed gain, probably due to the fact that it does not block the IOP so much.
I thought about the way to get from the mess that it is currently in. I came up with a plan I currently have little time to realize:
1. Write a threaded SMAP.irx replacement, from scratch, that does not depend on SMSTCPIP.irx in any way.
2. Tune this on a piece of packet generating code - prepare a blocking read method that'd replace the one in SMSTCPIP at the end of the journey. In this state the PS2 should be able to reply to some hand made packets.
3. Rewrite the ARP, ICMP and UDP parts of the stack, so it will be able to communicate by UDP, reply to ping packets and manage ARP requests.
4. Write TCP stack on top of this.
By the end this should be capable doing client side of TCP.
I know jimmi has started such a rewrite, but without threading the SMAP - it may still be viable alternative, all we need is DMA code in single thread and working blocking read impl. Problem was doing DMA in interrupt context - namely dev9DmaTransfer which uses non-interrupt Sema calls, if not because of other problems.
Also, I think write operations should borrow buffers from the packet driver and write into those directly - should save some time.