144290e13STomasz Zawadzki# Introduction 244290e13STomasz Zawadzki 344290e13STomasz ZawadzkiStarting with DPDK 22.11, PCI API are no longer public. In order to implement 444290e13STomasz Zawadzkiout-of-tree driver like SPDK NVMe driver that is compatible with DPDK, 544290e13STomasz Zawadzkia copy of PCI API headers are required in SPDK. 644290e13STomasz Zawadzki 744290e13STomasz Zawadzki`check_dpdk_pci_api.sh` script is intended simplify the maintenance of the 844290e13STomasz Zawadzkicompatibility between SPDK copies of the headers and multiple DPDK versions. 944290e13STomasz Zawadzki 1044290e13STomasz Zawadzki## Arguments 1144290e13STomasz Zawadzki 1244290e13STomasz ZawadzkiThe script has two optional positional arguments: 1344290e13STomasz Zawadzki$1 - `check` or `fix` mode (default: check) 1444290e13STomasz Zawadzki$2 - path to DPDK sources (default: DPDK submodule) 1544290e13STomasz Zawadzki 1644290e13STomasz Zawadzki## Check mode 1744290e13STomasz Zawadzki 1844290e13STomasz ZawadzkiWhen calling the script, default is to check the diff of the in-tree headers with 1944290e13STomasz ZawadzkiDPDK and report any differences found. This is used for testing of current and 2044290e13STomasz Zawadzkifuture DPDK versions. 2144290e13STomasz Zawadzki 2244290e13STomasz Zawadzki## Fix mode 2344290e13STomasz Zawadzki 2444290e13STomasz ZawadzkiSimilar to check mode, but additionally patches the differences to the 2544290e13STomasz Zawadzkicurrently tested DPDK version. This should be done only for cosmetic changes, 2644290e13STomasz Zawadzkinot for changes that break compatibility. 2744290e13STomasz Zawadzki 2844290e13STomasz Zawadzki## Workarounds for specific DPDK version 2944290e13STomasz Zawadzki 3044290e13STomasz ZawadzkiAny changes that should be applied to all copied headers have to be part of the 3144290e13STomasz Zawadzki`check_dpdk_pci_api.sh`. For example referring to in-tree copied PCI headers 3244290e13STomasz Zawadzkirather than system installed ones. 3344290e13STomasz Zawadzki 3444290e13STomasz ZawadzkiIn rare cases there might be a need to apply a specific workaround for 3544290e13STomasz Zawadzkiparticular DPDK PCI API version. Then a patch should be added in 3644290e13STomasz Zawadzki`spdk_root/scripts/env_dpdk/<ver>` where ver is the matching DPDK version. 37*11694e8dSTomasz ZawadzkiFilename for any patch within that directory should start with first DPDK version 38*11694e8dSTomasz Zawadzkithat it applies to, only latest patch is used. 3944290e13STomasz Zawadzki 4044290e13STomasz Zawadzki## Flow for adding support for new DPDK PCI API version 4144290e13STomasz Zawadzki 4244290e13STomasz ZawadzkiIf API was changed, a new directory should be created `spdk_root/lib/env_dpdk/<ver>` 4344290e13STomasz Zawadzkiwhere ver is the appropriate DPDK version name. There the relevant headers should be copied. 4444290e13STomasz Zawadzki 4544290e13STomasz ZawadzkiPlease note that the directories should match only the first DPDK version that modified the API. 4644290e13STomasz ZawadzkiNot every DPDK version requires new directory. 47