Live data from Hacker News

Raspberry Pi Pico does line rate 100M Ethernet

github.com

11–20 of 67 posts

Re: Raspberry Pi Pico does line rate 100M Ethernet

#11

> receive side uses a per-packet interrupt to finalize a received packet This has made much faster systems not being able to process packets at line speed. A classic was that standard Gigabit network cards and contemporary CPUs were not able to process VoIP packets (which are tiny) at line speed, while they could easily download files (which are basically MTU-sized packets) at line speed.

Fortunately, the receive ISR isn't cracking packets, just calculating a checksum and passing the packet on to LWIP. I wish there were two DMA sniffers, so that the checksum could be calculated by the DMA engine(s), as that's where a lot of processor time is spent (event with a table driven CRC routine).

Re: Raspberry Pi Pico does line rate 100M Ethernet

#12
post #3

Impressive. At first I thought it was the new Pico 2 (RP2350), but no, it’s the old Pi Pico with RP2040.

I expect the RP2350 to perform much better in this scenario! At the minimum, one of the DMA channels should be eliminated, and I'm hoping the CRC calculation will get faster.

Re: Raspberry Pi Pico does line rate 100M Ethernet

#13
Very impressive!

It would be interesting to see a short writeup of what kind of magic was required to achieve this, as there have been multiple failed attempts before this.

I'm also curious about the performance boost from 2.81Mbit/link failure at 150MHz to 65.4Mbit/31.4Mbit at 200MHz. That doesn't sound like basic processor bottlenecks, but rather some kind of catastrophic breakdown at a lower level? Does it just occasionally completely fail to lock onto an incoming clock signal or something?

Re: Raspberry Pi Pico does line rate 100M Ethernet

#15
I see some examples that show this can be used as a lite http daemon.

Is there enough room to have it control the ethernet port for another weaker or perhaps more powerful microcontroller?

Can you combine multiple picos with one being the ethernet stack and another that modifies certain packets?

Are there any other interesting things that can be done?

Re: Raspberry Pi Pico does line rate 100M Ethernet

#18
post #5

I just started playing around with PIO and DMA on a Pico, and it’s really fun just how much you can do on the chip without invoking the main CPU. For context, PIO is a mini-language you can program at the edge of the chip that can directly respond to and write to external IO. DMA allows you to tell the chip to send a signal based on data in memory, and can be programmed to loop or interrupt to limit re-invoking. The…

For added clarity, the Pico includes an RP2040 which is where the PIO runs.

Thanks, and you're correct; not sure why you got downvoted for this. For anyone curious here are the data sheets for RP2040 [for original Pico] and RP2350 [for Pico 2], which describe the systems in detail.

RP2040: https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.p...

RP2350: https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.p...

Re: Raspberry Pi Pico does line rate 100M Ethernet

#19
post #14

Why is the transfer rate non-linear with respect to the system clock? At 100 MHz the rate is 1.38 Mbit/s and at 200 Mhz it is 65.4 Mbit/s.

Latency kills...and Ethernet uses exponential backoff.

More specifically TCP uses exponential backoff. Ethernet will happily keep drowning you in packages at line rate, if I'm not mistaken.
Post reply on HN