xref: /spdk/scripts/env_dpdk/README.md (revision 60982c759db49b4f4579f16e3b24df0725ba4b94)
1# Introduction
2
3Starting with DPDK 22.11, PCI API are no longer public. In order to implement
4out-of-tree driver like SPDK NVMe driver that is compatible with DPDK,
5a copy of PCI API headers are required in SPDK.
6
7`check_dpdk_pci_api.sh` script is intended simplify the maintenance of the
8compatibility between SPDK copies of the headers and multiple DPDK versions.
9
10## Arguments
11
12The script has two optional positional arguments:
13$1 - `check` or `fix` mode (default: check)
14$2 - path to DPDK sources (default: DPDK submodule)
15
16## Check mode
17
18When calling the script, default is to check the diff of the in-tree headers with
19DPDK and report any differences found. This is used for testing of current and
20future DPDK versions.
21
22## Fix mode
23
24Similar to check mode, but additionally patches the differences to the
25currently tested DPDK version. This should be done only for cosmetic changes,
26not for changes that break compatibility.
27
28## Workarounds for specific DPDK version
29
30Any changes that should be applied to all copied headers have to be part of the
31`check_dpdk_pci_api.sh`. For example referring to in-tree copied PCI headers
32rather than system installed ones.
33
34In rare cases there might be a need to apply a specific workaround for
35particular DPDK PCI API version. Then a patch should be added in
36`spdk_root/scripts/env_dpdk/<ver>` where ver is the matching DPDK version.
37
38## Flow for adding support for new DPDK PCI API version
39
40If API was changed, a new directory should be created `spdk_root/lib/env_dpdk/<ver>`
41where ver is the appropriate DPDK version name. There the relevant headers should be copied.
42
43Please note that the directories should match only the first DPDK version that modified the API.
44Not every DPDK version requires new directory.
45