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可以做些什么
Python具有简单.易学.免费.开源.可移植.可扩展.可嵌入.面向对象等优点,它的面向对象甚至比java和C#.net更彻底. 作为一种通用语言,Python几乎可以用在任何领域和场合,角色几乎是无 ...
- 1.新建项目出现包名有一道红线The SDK platform-tools version ((23)) is too old to check APIs compiled with API 20
原因分析: 就是platform-tools的版本太低导致的 解决方法: 1.点开SDK Manager,打开SDK Tools面板,将Platform-tools更新 2.更新完之后重启as即可
- HttpServletRequest获取请求参数中所有的信息
/** * 获取客户端请求参数中所有的信息 * @param request * @return */ private Map<String, String> getAllRequestP ...
- js 根据json数组中n个字段排序
function compare(name, minor) { return function (o, p) { var a, b; if (o && p && typ ...
- Way to tmux
1. tmux ls: 显示所有会话(OR: Ctrl-b s)2. tmux new -s session-name: 新建会话3. 可以简单地输入tmux a命令,这样可以接入第一个可用的会话:t ...
- appium 智能滚动
- mysql数据库从删库到跑路之mysql多表查询
一 介绍 本节主题 多表连接查询 复合条件连接查询 子查询 准备表 company.employeecompany.department #建表 create table department( id ...
- Mac下Jmeter快速安装与入门-模拟测试Post请求及设置Http头
[1]去Apache官网下载 Binaries系列的最新Jmeter.gz包 [2]下载到本地之后解压缩,进入到解压之后的目录然后,找到apache-jmeter-4.0/bin/jmeter.sh ...
- usermod命令、用户密码管理、mkpasswd命令
3.4 usermod命令--更改用户帐户属性 -a|--append ##把用户追加到某些组中,仅与-G选项一起使用 -G|--groups ##把用户追加到某些组中,仅与-a选项一起使用:把该用户 ...
- HDU 3081 Marriage Match II (二分+并查集+最大流)
题意:N个boy和N个girl,每个女孩可以和与自己交友集合中的男生配对子;如果两个女孩是朋友,则她们可以和对方交友集合中的男生配对子;如果女生a和女生b是朋友,b和c是朋友,则a和c也是朋友.每一轮 ...