Zero-copy Receive Path in Virtio

Slides:



Advertisements
Similar presentations
Device Layer and Device Drivers
Advertisements

COMS W6998 Spring 2010 Erich Nahum
EEE 435 Principles of Operating Systems Structure of I/O Software Pt II (Modern Operating Systems & 5.3.4)
The Journey of a Packet Through the Linux Network Stack
XEN AND THE ART OF VIRTUALIZATION Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, lan Pratt, Andrew Warfield.
Computer Organization and Architecture
Performance Evaluation of Open Virtual Routers M.Siraj Rathore
Network Devices COMS W6998 Spring 2010 Erich Nahum.
Network Implementation for Xen and KVM Class project for E : Network System Design and Implantation 12 Apr 2010 Kangkook Jee (kj2181)
ECE Department: University of Massachusetts, Amherst ECE 354 Spring 2009 Lab 3: Transmitting and Receiving Ethernet Packets.
Supporting ethtool with Linux Integration Service Open Source Technology Center Microsoft.
FreeBSD Network Stack Performance Srinivas Krishnan University of North Carolina at Chapel Hill.
Gursharan Singh Tatla Transport Layer 16-May
Introduction to Linux Network 劉德懿
Agostinho L S Castro Telecommunications and Multimedia Unit BPF - BSD Packet Filter.
© 2008 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Achieving 10 Gb/s Using Xen Para-virtualized.
LWIP TCP/IP Stack 김백규.
1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.
Xen I/O Overview. Xen is a popular open-source x86 virtual machine monitor – full-virtualization – para-virtualization para-virtualization as a more efficient.
LWIP TCP/IP Stack 김백규.
Xen I/O Overview.
© 2010 IBM Corporation Plugging the Hypervisor Abstraction Leaks Caused by Virtual Networking Alex Landau, David Hadas, Muli Ben-Yehuda IBM Research –
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
Penn State CSE “Optimizing Network Virtualization in Xen” Aravind Menon, Alan L. Cox, Willy Zwaenepoel Presented by : Arjun R. Nath.
Layer 3: Internet Protocol.  Content IP Address within the IP Header. IP Address Classes. Subnetting and Creating a Subnet. Network Layer and Path Determination.
An initial study on Multi Path Routing Over Multiple Devices in Linux 2.4.x kernel Towards CS522 term project By Syama Sundar Kosuri.
CSE 6590 Department of Computer Science & Engineering York University 111/9/ :26 AM.
Virtual Machine Queue Driver Development Sambhrama Mundkur Sr. Software Design Engineer Core Networking
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
TCP/IP Protocol Suite DHCP The Dynamic Host Configuration Protocol (DHCP) provides static and dynamic address allocation that can be manual or automatic.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Device Driver Concepts Digital UNIX Internals II Device Driver Concepts Chapter 13.
Lecture 3: Stateless Packet Filtering. 2 Agenda 1 1 Linux file system - networking sk_buff 2 2 Stateless packet filtering 3 3 About next assignment 4.
Tgt: Framework Target Drivers FUJITA Tomonori NTT Cyber Solutions Laboratories Mike Christie Red Hat, Inc Ottawa Linux.
1 CMPT 471 Networking II Multicasting © Janice Regan,
Module 12: I/O Systems I/O hardware Application I/O Interface
Agenda About us Why para-virtualize RDMA Project overview Open issues
LWIP TCP/IP Stack 김백규.
sudo ./snull_load Two interfaces created: sn0, sn1
Scaling the Network: The Internet Protocol
COMPUTER NETWORKS CS610 Lecture-9 Hammad Khalid Khan.
Hubs Hubs are essentially physical-layer repeaters:
Virtio ring and virtio-net
Want to play a game? – Linux Kernel Modules
Net 323: NETWORK Protocols
PQI vs. NVMe® Queuing Comparison
An NP-Based Router for the Open Network Lab
CS Introduction to Operating Systems
Data Link Issues Relates to Lab 2.
An NP-Based Router for the Open Network Lab Overview by JST
Virtio Keith Wiles July 11, 2016.
Xen Network I/O Performance Analysis and Opportunities for Improvement
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
TCP/IP Protocol Suite: Review
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Scaling the Network: The Internet Protocol
Remote Page Faults Over RDMA
Ch 17 - Binding Protocol Addresses
VIRTIO 1.1 FOR HARDWARE Rev2.0
Chapter 11 Processor Structure and function
System Virtualization
Lecture 12 Input/Output (programmer view)
ECE 671 – Lecture 8 Network Adapters.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Update Summary of DPACC docs
Presentation transcript:

Zero-copy Receive Path in Virtio Kalman Meth, Mike Rapoport, Joel Nider {meth,rapoport,joeln}@il.ibm.com This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 645402.

Virtio Architecture p Host VM Guest user space kernel space User buffer Guest kernel buffer …………. network DMA KVM Hypervisor Ethernet adapter virtio/vnet Ethernet ring buffer(s) MAC1 MAC4 MAC3 MAC2 NIC Socket interface Copy data between guest buffers and host buffers

Problem In the KVM hypervisor, incoming packets from the network must pass through several objects in the Linux kernel before being delivered to the guest VM. To keep the implementation simple, both the hypervisor and the guest keep their own sets of buffers on the receive path. For large packets, the overall processing time is dominated by the copying of data from hypervisor buffers to guest buffers.

Solution: Zero-copy receive Maintain separate ring buffer for each guest. Guest allocates buffers and posts to appropriate host adapter ring buffer. When data arrives, the NIC performs DMA directly into guest- allocated buffers.

Zero-Copy Rx Architecture Host VM Guest user space kernel space User buffer Guest kernel buffer …………. network DMA KVM Hypervisor Ethernet adapter macvlan macvtap virtio/vnet Per-MAC ring buffer MAC1 MAC4 MAC3 MAC2 NIC Socket interface Pass the buffers down through the kernel layers

Technical Issues Need to match guest interface with adapter device that consumes its buffers. Need support in ethernet adapter to assign a particular queue to a specified MAC address. What if not enough user-space buffers have been posted? Drop packets? Ethernet adapter driver expects 4K page aligned buffers (not what virtio-net currently provides). Add flag in virtio/vhost to negotiate and use 4K aligned pages Need 2 values returned for each buffer: For each buffer filled by Ethernet adapter, need to match it back to index in virtio-net ring. Need to provide virtio with number of bytes actually written into buffer. Special handling for broadcast and multicast packets? Do we need to turn off GRO, and have the guest do all the re-assembly? Allow different virtio/vhost devices to use different schemes (4K vs meargeable vs big buffers, etc), depending on capabilities of underlying physical device.

Proposed Interfaces int (*ndo_set_zero_copy_rx)(struct net_device *dev, struct net_device *base_dev); Pass base_dev down the stack to the ethernet adapter so it knows which MAC address is using zero-copy rx. int (*ndo_post_rx_buffer)(struct net_device *dev, struct sk_buff *skb); Passes a single (4K aligned) buffer to the ethernet adapter skb contains pointer to upper level device, so ethernet adapter knows to which MAC address the buffer is associated. Ethernet adapter should save the skb to return the buffer up the stack (via the sock interface). Can use the skb auxiliary fields to hold the index of the buffer in the virtio-net ring. May need a callback to handle some cases; perhaps similar to zero- copy transmit mechanism. Need to provide both number of bytes and index into virtio-net ring buffer.