Hacker News new | ask | show | jobs
by rasz 17 days ago
No amount of software would have helped. It had limitations as to where it could fetch data from and where it put received packets, both requiring copying all network data around. Plus shallow TX queue resulting in higher interrupt load. Afaik 3Coms had proper descriptor rings DMA Master engine allowing zero copy and deep queues.

You couldnt saturate 100Mbit link with weak CPU on Realtek while 3Com did all the data shuffling for free. It didnt matter when browsing internet on contemporary slow links, and stopped being noticeable when copying data over Lan on >400MHz CPUs.

1 comments

Did anything stop you from processing the packets in the place they were received and putting the data you want to send in the place it could be transmitted from?
You really dont want userspace poking in your kernel space, plus there were additional alignment limitations.
So in other words the software stack didn't allow it, and a different one could have allowed it, but that didn't exist.

I bet it did exist though, on MS-DOS. It was Windows NT and Linux that came later and insisted that hardware must do things that it did not do.

No amount of software would be able to force Realtek chip into reading/writing packets directly from/into user provided buffer correctly.

In Windows land Winsock 2 in win98 together with capable hardware (3C905) allowed for sending data directly from user provided buffers with no additional buffering (zero copy), same goes for win NT. OS reused user provided buffer. Realtek could never do that because of hardware limitations. You cant force userspace software to allocate buffer that will be compatible with broken hardware.

Receiving still requires one copy with good hardware (you dont know who the packet belongs to without fist storing it in kernel buffer and checking received headers, at least not without 'fancy' NIC running own OS and offloading TCP/IP stack or more modern Flow Steering). Problem with Realtek is it cant even do that because it lacks scatter-gather meaning Kernel has to babysit one ring buffer - constantly copying data from it into its own buffer, and only then from that into user provided buffers.

In both cases Realtek was hammering CPU with interrupts to copy data around to/from tiny fixed/limited buffers while 3Com/Intel would happily do all the data moving automagically in hardware without touching CPU.

Browsing internet at 100KB/s around the year 2000 on ISDN/first slow DSL wasnt a problem, but try to copy data over 100mbit LAN and suddenly you notice 100% CPU load and inability to saturate 10MB/s.