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的更多相关文章

  1. Intel 推出 DPDK 开发包的意义是什么?

    Intel 推出 DPDK 开发包的意义是什么? http://www.zhihu.com/question/27413080?sort=created 基于intel dpdk的包处理器,相较于基于 ...

  2. [dpdk] 熟悉SDK与初步使用 (四)(L3 Forwarding源码分析)

    接续前节:[dpdk] 熟悉SDK与初步使用 (三)(IP Fragmentation源码分析) 前文中的最后一个问题,搁置,并没有找到答案.所以继续阅读其他例子的代码,想必定能在其他位置看到答案. ...

  3. [dpdk] 熟悉SDK与初步使用 (一)(qemu搭建实验环境)

    搭建实验环境: troubleshoot 第一步加载驱动 第二步切换驱动 使用了所有qemu支持的卡 [tong@T7:~/VM/dpdk] % cat start.sh sudo qemu-syst ...

  4. [dpdk] 熟悉SDK与初步使用 (二)(skeleton源码分析)

    接续前节:[dpdk] 熟悉SDK与初步使用 (一)(qemu搭建实验环境) 程序逻辑: 运行参数: 关键API: 入口函数: int rte_eal_init(int argc, char **ar ...

  5. [dpdk] 熟悉SDK与初步使用 (三)(IP Fragmentation源码分析)

    对例子IP Fragmentation的熟悉,使用,以及源码分析. 功能: 该例子的功能有二: 一: 将IP分片? 二: 根据路由表,做包转发. 路由表如下: IP_FRAG: Socket : ad ...

  6. DPDK编译步骤

    大页内存分配:  NUMA系统(现在的linux一般都是) echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048 ...

  7. DPDK内存管理(1)

    1 前言 DPDK将利用hugepage预留的物理内存统一的组织管理起来,然后以库的方式对外提供使用的接口.下图展示了DPDK中内存有关的模块的相互关系. rte_eal            是统一 ...

  8. [DPDK][转]DPDK编程开发(4)—lcore

    1.知识百科 返回值 操作函数 函数功能 RTE_DECLARE_PER_LCORE (unsigned, _lcore_id) RTE_DECLARE_PER_LCORE (rte_cpuset_t ...

  9. DPDK学习之开篇介绍

    1.前言 记得刚开始工作的时,老大将我安排到数据面组,当时第一次听说”数据面“这个概念,感觉挺新鲜的.误打误撞就开始搞了,刚开始接触的时候,由于不懂其中的原理,觉得很神奇,因为报文的转发是在应用层,通 ...

随机推荐

  1. Websocket - Websocket原理(握手、解密、加密)、基于Python实现简单示例

    一.Websocket原理(握手.解密.加密) WebSocket协议是基于TCP的一种新的协议.WebSocket最初在HTML5规范中被引用为TCP连接,作为基于TCP的套接字API的占位符.它实 ...

  2. 简单认识TCP/IP协议

    HTTP协议—— 简单认识TCP/IP协议 本文转自: https://www.cnblogs.com/roverliang/p/5176456.html   大学没读计算机专业,所以很多的专业知识都 ...

  3. 学习Zookeeper需要了解的专业名词

    一.Zookeeper的集群角色 Leader:该角色是整个zookeeper集群工作机制中的核心 Follower:该角色是zookeeper集群状态的跟随者 Observer:在集群中充当观察者的 ...

  4. pycharm激活(转)

    1.注册码激活Activation code http://idea.lanyus.com/ 2.服务器激活License server(推荐) 或者http://182.254.242.193:10 ...

  5. 001-搭建spring boot项目

    1.第一步.file--new--project. 2.spring initializr--project sdk--default--next 3. 4.spring boot--选择依赖项--n ...

  6. HBase1.2.6 预分区后,数据不进入预定分区的一个 bug

    rowkey 如下: 19000015115042900001511504390000151150449000015115045900001511504690000151150479000015115 ...

  7. java中元注解

    java中元注解有四个: @Retention @Target @Document @Inherited:  @Retention:注解的保留位置 @Retention(RetentionPolicy ...

  8. Python --之练习题

    一,两个小组对战,对战规则如下:team1 = ['a','b','c']team2 = ['x','y','z'] #a 不和x对战,b 不和y,z 对战# for i in team1: #法一# ...

  9. c++ 跳转语句块

    p170~p172:跳转语句:1.break:对while for switcho有效!2.continue:中断当前迭代,但是循环还要继续.因此对while for有效,对switch无效!3.go ...

  10. ElasticSearch(一)ElasticSearch的应用场景及为什么要选择ElasticSearch?

    先了解一下数据的分类 结构化数据又可以称之为行数据,存储在数据库里,可以用二维表结构来逻辑表达实现的数据.其实就是可以能够用数据或者统一的结构加以表示的数据.比如在数据表存储商品的库存,可以用整型表示 ...