Screencast on writing Snabb in Rust

Rush Git Source Repository

Part 1: packets ๐Ÿ”—๏ธ

Introduction, the packet structure, and managing heap-allocated packet memory on a freelist. (2020-03-27)

Part 2: links ๐Ÿ”—๏ธ

Links. Simple circular ring buffers that store pointers to packets. Transmit and receive. (2020-03-27)

Part 3: the engine in a nutshell ๐Ÿ”—๏ธ

A first overview of the engine, and the state it manages. How apps are represented, how they get linked to each other, and how they get executed. (2020-03-31)

Part 4: configurations ๐Ÿ”—๏ธ

How configurations are declaratively built, and configuration diffs are applied to the engine. (2020-04-02)

Part 5: tying it all up in engine::main() ๐Ÿ”—๏ธ

Implementing the main engine entry point, engine and link statistics, and battling with Rust closures. Finally, weโ€™re ready to run our first Snabb micro-benchmark: basic1 (2020-04-02)

Appendix A: engine time and timers ๐Ÿ”—๏ธ

How the engine manages time and timers. (2020-04-02)

Part 6: breathe order ๐Ÿ”—๏ธ

We compute the order in which to invoke apps during configure. We ensure the breathe order is deterministic, and try to resolve dependencies. (2020-04-06)

Part 7: struggling with references, traits, and global mutable state ๐Ÿ”—๏ธ

While reflecting on some refactorings, I ramble about my difficulties with Rust. We find a lean way to have dynamic static mutable variables. We avoid references by copying values instead to escape the draconian compiler. And we end up with an extra portion of sticky trait glue. (2020-04-06)

Part 8: DMA and Rust profiling ๐Ÿ”—๏ธ

We allocating memory form huge pages for DMA, and populate the packet freelist on demand. In doing that we introduce a performance regression which we fix after hunting it down using Linuxโ€™ perf. (2020-04-08)

Part 9: device drivers and protocol headers ๐Ÿ”—๏ธ

We borrow to implement a device driver app, and process real packets on real wires. We also mess around with protocol header synthesizing and parsing. (2020-04-09)

Part 10: inline assembly and running on aarch64 ๐Ÿ”—๏ธ

We port the x86 assembly routine for calculating IP checksums from Snabb to Rust inline assembly, and then port it to ARM/aarch64. Janneย Grunau optimizes the hell out of the ARM code, and teaches us advanced ARM assembly magic. Finally, we run our Snabb clone on a Cortex-A72, and briefly evaluate our results. (2020-04-21)