xref: /spdk/doc/porting.md (revision 111d42765d96aa44f7a0c3d894f69b0b3eebc72c)
1 93ab7c31SDaniel Verkamp# SPDK Porting Guide {#porting}
2 93ab7c31SDaniel Verkamp
3 93ab7c31SDaniel VerkampSPDK is ported to new environments by implementing the *env*
4 93ab7c31SDaniel Verkamplibrary interface.  The *env* interface provides APIs for drivers
5 93ab7c31SDaniel Verkampto allocate physically contiguous and pinned memory, perform PCI
6 93ab7c31SDaniel Verkampoperations (config cycles and mapping BARs), virtual to physical
7 93ab7c31SDaniel Verkampaddress translation and managing memory pools.  The *env* API is
8 93ab7c31SDaniel Verkampdefined in include/spdk/env.h.
9 93ab7c31SDaniel Verkamp
10 93ab7c31SDaniel VerkampSPDK includes a default implementation of the *env* library based
11 93ab7c31SDaniel Verkampon the Data Plane Development Kit ([DPDK](http://dpdk.org/)).
12 93ab7c31SDaniel VerkampThis DPDK implementation can be found in `lib/env_dpdk`.
13 93ab7c31SDaniel Verkamp
14 93ab7c31SDaniel VerkampDPDK is currently supported on Linux and FreeBSD only.
15 93ab7c31SDaniel VerkampUsers who want to use SPDK on other operating systems, or in
16 93ab7c31SDaniel Verkampuserspace driver frameworks other than DPDK, will need to implement
17 93ab7c31SDaniel Verkampa new version of the *env* library.  The new implementation can be
18 93ab7c31SDaniel Verkampintegrated into the SPDK build by updating the following line
19 93ab7c31SDaniel Verkampin CONFIG:
20 93ab7c31SDaniel Verkamp
21 *111d4276SMaciej Wawryk```bash
22 93ab7c31SDaniel VerkampCONFIG_ENV?=$(SPDK_ROOT_DIR)/lib/env_dpdk
23 *111d4276SMaciej Wawryk```
24