dpdk CUSE
As the Userspace I/O HOWTO says
For many types of devices, creating a Linux kernel driver is overkill. All that is really needed is some way to handle an interrupt and provide access to the memory space of the device. The logic of controlling the device does not necessarily have to be within the kernel, as the device does not need to take advantage of any of other resources that the kernel provides. One such common class of devices that are like this are for industrial I/O cards.
To address this situation, the userspace I/O system (UIO) was designed. For typical industrial I/O cards, only a very small kernel module is needed. The main part of the driver will run in user space. This simplifies development and reduces the risk of serious bugs within a kernel module.
http://bryanpendleton.blogspot.com/2011/02/fuse-cuse-and-uio.html
CUSE is an extension of FUSE allowing character devices to be implemented in userspace, it has been contributed by Tejun Heo (SUSE)
https://kernelnewbies.org/Linux_2_6_31#head-80b05215d438e437ec0d6fd9430e3d13dbcee14d
https://lwn.net/Articles/308445/
https://github.com/spotify/linux/blob/master/fs/fuse/cuse.c
http://dpdk.org/doc/guides-16.04/prog_guide/vhost_lib.html
The vhost library implements a user space vhost driver. It supports both vhost-cuse (cuse: user space character device) and vhost-user(user space socket server).
vhost-cuse通过字符设备接收qemu控制命令,而vhost-user通过socket。
25.1. Vhost API Overview
Vhost driver registration
rte_vhost_driver_register registers the vhost driver into the system. For vhost-cuse, character device file will be created under the /dev directory. Character device name is specified as the parameter. For vhost-user, a Unix domain socket server will be created with the parameter as the local socket path.
Vhost session start
rte_vhost_driver_session_start starts the vhost session loop. Vhost session is an infinite blocking loop. Put the session in a dedicate DPDK thread.
Callback register
Vhost supported vSwitch could call rte_vhost_driver_callback_register to register two callbacks, new_destory and destroy_device. When virtio device is activated or deactivated by guest virtual machine, the callback will be called, then vSwitch could put the device onto data core or remove the device from data core by setting or unsetting VIRTIO_DEV_RUNNING on the device flags.
Read/write packets from/to guest virtual machine
rte_vhost_enqueue_burst transmit host packets to guest. rte_vhost_dequeue_burst receives packets from guest.
Feature enable/disable
Now one negotiate-able feature in vhost is merge-able. vSwitch could enable/disable this feature for performance consideration.
dpdk CUSE的更多相关文章
- Intel 推出 DPDK 开发包的意义是什么?
Intel 推出 DPDK 开发包的意义是什么? http://www.zhihu.com/question/27413080?sort=created 基于intel dpdk的包处理器,相较于基于 ...
- [dpdk] 熟悉SDK与初步使用 (四)(L3 Forwarding源码分析)
接续前节:[dpdk] 熟悉SDK与初步使用 (三)(IP Fragmentation源码分析) 前文中的最后一个问题,搁置,并没有找到答案.所以继续阅读其他例子的代码,想必定能在其他位置看到答案. ...
- [dpdk] 熟悉SDK与初步使用 (一)(qemu搭建实验环境)
搭建实验环境: troubleshoot 第一步加载驱动 第二步切换驱动 使用了所有qemu支持的卡 [tong@T7:~/VM/dpdk] % cat start.sh sudo qemu-syst ...
- [dpdk] 熟悉SDK与初步使用 (二)(skeleton源码分析)
接续前节:[dpdk] 熟悉SDK与初步使用 (一)(qemu搭建实验环境) 程序逻辑: 运行参数: 关键API: 入口函数: int rte_eal_init(int argc, char **ar ...
- [dpdk] 熟悉SDK与初步使用 (三)(IP Fragmentation源码分析)
对例子IP Fragmentation的熟悉,使用,以及源码分析. 功能: 该例子的功能有二: 一: 将IP分片? 二: 根据路由表,做包转发. 路由表如下: IP_FRAG: Socket : ad ...
- DPDK编译步骤
大页内存分配: NUMA系统(现在的linux一般都是) echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048 ...
- DPDK内存管理(1)
1 前言 DPDK将利用hugepage预留的物理内存统一的组织管理起来,然后以库的方式对外提供使用的接口.下图展示了DPDK中内存有关的模块的相互关系. rte_eal 是统一 ...
- [DPDK][转]DPDK编程开发(4)—lcore
1.知识百科 返回值 操作函数 函数功能 RTE_DECLARE_PER_LCORE (unsigned, _lcore_id) RTE_DECLARE_PER_LCORE (rte_cpuset_t ...
- DPDK学习之开篇介绍
1.前言 记得刚开始工作的时,老大将我安排到数据面组,当时第一次听说”数据面“这个概念,感觉挺新鲜的.误打误撞就开始搞了,刚开始接触的时候,由于不懂其中的原理,觉得很神奇,因为报文的转发是在应用层,通 ...
随机推荐
- python学习笔记(二十)初识面向对象
面向对象的编程的主要思想是把构成问题的各个事物分解成各个对象,建立对象的目的不是为了完成一个步骤,而是为了描述一个事物在解决问题的过程中经历的步骤和行为.对象作为程序的基本单位,将程序和数据封装其中, ...
- 微信js-sdk使用
<?php $appid=""; $secret=""; class JSSDK { private $appId; private $appSecret ...
- MFC程序执行过程剖析
一 MFC程序执行过程剖析 1)我们知道在WIN32API程序当中,程序的入口为WinMain函数,在这个函数当中我们完成注册窗口类,创建窗口,进入消息循环,最后由操作系统根据发送到程序窗口的消息调用 ...
- 工作笔记——js与文件上传下载
1 js判断上传文件的后缀名,文件大小 //判断照片大小 function getPhotoSize(obj){ photoExt=obj.value.substr(obj.value.lastInd ...
- Linux系统——Rsync数据同步工具
Rsync的优点及缺点 优点:类似cp命令.scp命令,但rsync为增量复制工具 缺点:针对大文件,效率非常高(打包再比对),针对小文件,效率非常低. Rsync作用 (1)可使本地和远程两台主机之 ...
- JVM类加载机制(转)
原文出自:http://www.cnblogs.com/ityouknow/p/5603287.html 1.什么是类的加载 类的加载指的是将类的.class文件中的二进制数据读入到内存中,将其放在运 ...
- GitHub上最热门的11款开源安全工具
恶意软件分析.渗透测试.计算机取证——GitHub托管着一系列引人注目的安全工具.足以应对各类规模下计算环境的实际需求. 作为开源开发领域的基石,“所有漏洞皆属浅表”已经成为一条着名的原则甚至是信条 ...
- TOSCA自动测试工具跟QTP 和 Selenium的简单对比
1. 一个课程里的,可以做个简单的参考,有些地方不是很准确
- Docker---大型项目容器化改造
虚拟化和容器化是项目云化不可避免的两个问题.虚拟化由于是纯平台操作,一个运行于linux操作系统的项目几乎不需要做任何改造就可以支持虚拟化.而项目如果要支持容器化则需要做许多细致的改造工 ...
- powershell 设置环境变量 -- go 单元测试 exit status 3221225781
执行单元测试时出错 go test -run TestImage 错误提示如下: exit status 3221225781 这个错误的意思是需要加载对应的库文件找不到,加载对应的库文件就习. 但是 ...