lowRISC Summer of Code TCP/IP Offload to Minion Cores using Rump Kernels
Sebastian Wicki
Mentored by: Justin Cormack, Antti Kantee Organizer: Alex Bradbury, lowRISC
1 We want an open computing eco-system: comprehensible, flexible and reusable
Operating System Processor Peripherals
2 hardware platform I/O shims & pins lowRISC minion cores RISC-V RISC-V application application ● small, dedicated RISC-V RISC-V RISC-V cores cores minion minion … minion RISC-V cores coherent network I/O network ● specialized for I/O processing L2 cache
● protocols in software
‒e.g. SPI, I2C, SDIO off-chip memory
3 software platform rump kernels
● driver container
‒ file systems, network, audio
● run anywhere
‒ userspace, hypervisors, bare-metal
‒ integrate into own system
● based on NetBSD
4 project proposal
I/O shims & pins ● rump kernels on RISC-V minion cores application RISC-V RISC-V cores minion … minion ● process I/O using rump drivers coherent network I/O network
‒ e.g. TCP/IP L2 cache
● traditional OS on
application cores off-chip memory
5 rump kernels
6 rump kernels: not an operating system
● no processes or application user space threading
● no virtual memory system calls interrupts management net vfs dev paging signals bt tcp smb ext2 cgd usb vm processes ● no privilege levels ip blk ums scheduling
● no interrupt handling if kernel
hardware
7 rump kernels: not an operating system
● hypercall interface application
‒ thread scheduling host process
‒ memory allocation system calls
‒ console output net vfs dev bt tcp smb ext2 cgd usb ‒ I/O hypercalls ip blk ums
if
rump hypercall interface
host platform
8 rump kernels: run anywhere
user space client server unikernel
client app client application client rump kernel client clientrump libc libc codeapp code kernelcode hypercall hijack rump kernel
libc rumpclient hypercall hypercall interface
posix posix posix hardwareposix
● client code is aware of ● unmodified client code ● unmodified client code rump kernel ● intercept libc calls ● rump kernel aware libc ● forward over network
9 rump kernels on minion cores
● hypercalls for bare-metal RISC-V
rump kernel ‒ based on the rumprun unikernel user application ethernet sysproxy ● drivers running on rump server tcp/ip ‒ custom ethernet driver rump hijack I/O libc net ‒ TCP/IPrump stack client from NetBSD ● syscall proxy server hypercall implementation linux kernel ‒ rewritten to run on bare-metal minion core application core ‒ uses serial line instead of network
10 rump kernels on minion cores
← Request: syscall “send”, data → Request: copyin, data.buf rump kernel ← Response: copyin, data → Response: syscall, retval user application ethernet Ethernet Frame sysproxy send(fd, “GET / HTTP/1.1”, ...) open(“/etc/passwd”) tcp/ip server rump hijack I/O serial libc net rump client syscall open rump_sys_send(fd, …)
hypercall implementation linux kernel
minion core application core
11 Limitations
● currently only runs in Spike
‒ wrote virtual network card
‒ simulates minion core
‒ host offloads into Spike
● system requirements
● everything over serial protocol ‒ use DMA engine for copy{in,out}
● code needs some cleanup
12 Conclusions
● rump kernels are flexible http://rumpkernel.org ‒ not limited to TCP/IP offload @rumpkernel ‒ no need to use syscall proxy #rumpkernel irc.freenode.net ‒ run your own apps on minion cores
● code is reusable Contact: @gandro23
13