Commit 9c55555c authored by paul luse's avatar paul luse Committed by Tomasz Zawadzki
Browse files

scrtips/setup.sh: Add support for IAA device



Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Change-Id: I59cfa9c9c673a2215a8cd42450b94dfcfc959971
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12763


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent bf234f42
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -241,23 +241,24 @@ function get_used_bdf_block_devs() {
}

function collect_devices() {
	# NVMe, IOAT, DSA, VIRTIO, VMD
	# NVMe, IOAT, DSA, IAA, VIRTIO, VMD

	local ids dev_type dev_id bdf bdfs in_use driver

	ids+="PCI_DEVICE_ID_INTEL_IOAT"
	ids+="|PCI_DEVICE_ID_INTEL_DSA"
	ids+="|PCI_DEVICE_ID_INTEL_IAA"
	ids+="|PCI_DEVICE_ID_VIRTIO"
	ids+="|PCI_DEVICE_ID_INTEL_VMD"
	ids+="|SPDK_PCI_CLASS_NVME"

	local -gA nvme_d ioat_d dsa_d virtio_d vmd_d all_devices_d drivers_d
	local -gA nvme_d ioat_d dsa_d iaa_d virtio_d vmd_d all_devices_d drivers_d

	while read -r _ dev_type dev_id; do
		bdfs=(${pci_bus_cache["0x8086:$dev_id"]})
		[[ $dev_type == *NVME* ]] && bdfs=(${pci_bus_cache["$dev_id"]})
		[[ $dev_type == *VIRT* ]] && bdfs=(${pci_bus_cache["0x1af4:$dev_id"]})
		[[ $dev_type =~ (NVME|IOAT|DSA|VIRTIO|VMD) ]] && dev_type=${BASH_REMATCH[1],,}
		[[ $dev_type =~ (NVME|IOAT|DSA|IAA|VIRTIO|VMD) ]] && dev_type=${BASH_REMATCH[1],,}
		for bdf in "${bdfs[@]}"; do
			in_use=0
			if [[ $1 != status ]]; then
@@ -311,6 +312,7 @@ function collect_driver() {
		[[ -n ${nvme_d["$bdf"]} ]] && driver=nvme
		[[ -n ${ioat_d["$bdf"]} ]] && driver=ioatdma
		[[ -n ${dsa_d["$bdf"]} ]] && driver=dsa
		[[ -n ${iaa_d["$bdf"]} ]] && driver=iaa
		[[ -n ${virtio_d["$bdf"]} ]] && driver=virtio-pci
		[[ -n ${vmd_d["$bdf"]} ]] && driver=vmd
	fi 2> /dev/null
@@ -668,6 +670,7 @@ function status_linux() {
		desc=${desc:-${nvme_d["$bdf"]:+NVMe}}
		desc=${desc:-${ioat_d["$bdf"]:+I/OAT}}
		desc=${desc:-${dsa_d["$bdf"]:+DSA}}
		desc=${desc:-${iaa_d["$bdf"]:+IAA}}
		desc=${desc:-${virtio_d["$bdf"]:+virtio}}
		desc=${desc:-${vmd_d["$bdf"]:+VMD}}

@@ -724,6 +727,9 @@ function status_freebsd() {
		DSA DMA
		$(status_print "${!dsa_d[@]}")

		IAA DMA
		$(status_print "${!iaa_d[@]}")

		VMD
		$(status_print "${!vmd_d[@]}")
	BSD_INFO
@@ -735,6 +741,7 @@ function configure_freebsd_pci() {
	BDFS+=("${!nvme_d[@]}")
	BDFS+=("${!ioat_d[@]}")
	BDFS+=("${!dsa_d[@]}")
	BDFS+=("${!iaa_d[@]}")
	BDFS+=("${!vmd_d[@]}")

	# Drop the domain part from all the addresses