GithubHelp home page GithubHelp logo

rust-ibverbs's Introduction

ibverbs

Crates.io Documentation Build Status

Rust API wrapping the ibverbs Remote Direct Memory Access (RDMA) library.

libibverbs is a library that allows userspace processes to use RDMA "verbs" to perform high-throughput, low-latency network operations for both Infiniband (according to the Infiniband specifications) and iWarp (iWARP verbs specifications). It handles the control path of creating, modifying, querying and destroying resources such as Protection Domains, Completion Queues, Queue-Pairs, Shared Receive Queues, Address Handles, and Memory Regions. It also handles sending and receiving data posted to QPs and SRQs, and getting completions from CQs using polling and completions events.

A good place to start is to look at the programs in examples/, and the upstream C examples. You can test RDMA programs on modern Linux kernels even without specialized RDMA hardware by using SoftRoCE.

For the detail-oriented

The control path is implemented through system calls to the uverbs kernel module, which further calls the low-level HW driver. The data path is implemented through calls made to low-level HW library which, in most cases, interacts directly with the HW provides kernel and network stack bypass (saving context/mode switches) along with zero copy and an asynchronous I/O model.

iWARP ethernet NICs support RDMA over hardware-offloaded TCP/IP, while InfiniBand is a general high-throughput, low-latency networking technology. InfiniBand host channel adapters (HCAs) and iWARP NICs commonly support direct hardware access from userspace (kernel bypass), and libibverbs supports this when available.

For more information on RDMA verbs, see the InfiniBand Architecture Specification vol. 1, especially chapter 11, and the RDMA Consortium's RDMA Protocol Verbs Specification. See also the upstream libibverbs/verbs.h file for the original C definitions, as well as the manpages for the ibv_* methods.

Library dependency

libibverbs is usually available as a free-standing library package. It used to be self-contained, but has recently been adopted into rdma-core. cargo will automatically build the necessary library files and place them in vendor/rdma-core/build/lib. If a system-wide installation is not available, those library files can be used instead by copying them to /usr/lib, or by adding that path to the dynamic linking search path.

Thread safety

All interfaces are Sync and Send since the underlying ibverbs API is thread safe.

Documentation

Much of the documentation of this crate borrows heavily from the excellent posts over at RDMAmojo. If you are going to be working a lot with ibverbs, chances are you will want to head over there. In particular, this overview post may be a good place to start.

Build hints

You must have clang installed (as of now, 6.0 seems to work) in order for this library to compile. Otherwise, you get weird errors such as:

/root/.cargo/git/checkouts/rust-ibverbs-ba51b5a9eecfbe0d/2d53c14/vendor/rdma-core/build/include/ccan/build_assert.h:23:26: error: size of unnamed array is negative
    do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
                            ^
  /root/.cargo/git/checkouts/rust-ibverbs-ba51b5a9eecfbe0d/2d53c14/vendor/rdma-core/ibacm/src/acm.c:629:3: note: in expansion of macro ‘BUILD_ASSERT’
     BUILD_ASSERT(sizeof(IBACM_IBACME_SERVER_PATH) <=
     ^~~~~~~~~~~~

and

/usr/include/sched.h:29:10: fatal error: 'stddef.h' file not found

even though, for example, stddef.h clearly exists at /usr/include/linux/stddef.h.

rust-ibverbs's People

Contributors

amytai avatar bionicles avatar iwahbe avatar jonhoo avatar kuenishi avatar

Watchers

 avatar

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.