Giter Site home page Giter Site logo

vfio-python's Introduction

vfio-python

Framework for userspace VFIO drivers and test code written in python

Credit to Olav Morken for their [python-ioctl]: https://github.com/olavmrk/python-ioctl module used here for VFIO ioctls.

Documentation

TBD

NVMe Interrupt test driver

The included NVMe driver will try to open the first NVMe device with vfio support. Please make sure your user has ownership of the VFIO group file associated with the device. For example:

$ lspci -Dd ::0108
0000:05:00.0 Non-Volatile memory controller: Silicon Motion, Inc. SM2262/SM2262EN SSD Controller (rev 03)

$ readlink -f /sys/bus/pci/devices/0000:05:00.0/iommu_group
/sys/kernel/iommu_groups/15

$ ls -l /dev/vfio/15
crw-rw----. 1 alwillia alwillia 505, 0 Mar 18 12:41 /dev/vfio/15

NB. The code makes use of the vfio-dev directory to detect a device is bound to a VFIO driver. This support was added in kernel v6.1 and as been backported for various downstream distributions.

The driver initializes the device, creates DMA mapped buffers for admin queue, fills the command queue with NOP commands, and increments head and tail pointers to trigger interrupts as quickly as possible. Each of INTx, MSI, and MSI-X mode interrupts are exercised:

$ python nvme-interrupt-test-driver.py 
Found vfio NVMe device: 0000:05:00.0
Testing INTx...
INTx: 12422.95 interrupts/second
Testing MSI...
MSI: 61855.1 interrupts/second
Testing MSI-X...
MSI-X: 61771.4 interrupts/second
['INTx', 12422.95, 'MSI', 61855.1, 'MSI-X', 61771.4]

Current status

This code initially only supports the "legacy" container/group access to vfio devices with the "type1" IOMMU backing device. The intention is to also include support for VFIO cdev access with IOMMUFD.

vfio-python's People

Contributors

awilliam avatar

Stargazers

Jiri Kastner avatar Marc-Andre Lureau avatar

Watchers

 avatar Jiri Kastner avatar  avatar

Forkers

cz172638

vfio-python's Issues

os.eventfd warning

while playing with vfio-python on ubuntu 20.04, i've found that python versions provided in ubuntu repos do not have os.eventfd, which was new in 3.10. would be nice to have some python version check

[rfe] - support for non-nvme and vfio-platform devices

i'm playing with pcie endpoint on arm soc boards (rk3399, j271e, armada 3720, ...)
goal is to have userspace-to-userspace communication over pcie, using low budget devices in python.
on arm boards i would like to have module vfio-platform loaded instead of pci-endpoint driver

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.