scripts/get-pmr: Return failure if neither CMB/PMR buf is found
Signed-off-by: Michal Berger <michal.berger@intel.com> Change-Id: I7d7b12ee7c5b081bda52659706e9aed8cefbd5a4 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14820 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
4978c4fe32
commit
29756d4c69
@ -61,7 +61,13 @@ info() {
|
|||||||
bar4=$(get_bar "$dev" 0x20)
|
bar4=$(get_bar "$dev" 0x20)
|
||||||
bar5=$(get_bar "$dev" 0x24)
|
bar5=$(get_bar "$dev" 0x24)
|
||||||
|
|
||||||
# QEMU uses 64-bit BARs
|
# QEMU uses 64-bit BARs. If there is no CMB or PMR present, report
|
||||||
|
# that to the user and signal failure.
|
||||||
|
if ((!(bar2 & 1 << 2) && !(bar4 & 1 << 2))); then
|
||||||
|
echo "No CMB|PMR present under $dev" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if ((bar2 & 1 << 2)); then
|
if ((bar2 & 1 << 2)); then
|
||||||
bar_type2=pmr
|
bar_type2=pmr
|
||||||
if [[ -e $nvme/cmb ]]; then
|
if [[ -e $nvme/cmb ]]; then
|
||||||
@ -70,14 +76,16 @@ info() {
|
|||||||
base_addr2=$(((bar2 & ~0xf) + (bar3 << 32)))
|
base_addr2=$(((bar2 & ~0xf) + (bar3 << 32)))
|
||||||
print_info "$bar2" "$base_addr2" "$bar_type2"
|
print_info "$bar2" "$base_addr2" "$bar_type2"
|
||||||
fi
|
fi
|
||||||
# QEMU uses 64-bit BARs
|
|
||||||
if ((bar4 & 1 << 2)); then
|
if ((bar4 & 1 << 2)); then
|
||||||
base_addr4=$(((bar4 & ~0xf) + (bar5 << 32)))
|
base_addr4=$(((bar4 & ~0xf) + (bar5 << 32)))
|
||||||
print_info "$bar4" "$base_addr4" pmr
|
print_info "$bar4" "$base_addr4" pmr
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
missing_buf=0
|
||||||
for nvme in /sys/class/nvme/nvme*; do
|
for nvme in /sys/class/nvme/nvme*; do
|
||||||
pci=$(readlink -f "$nvme/device") pci=${pci##*/}
|
pci=$(readlink -f "$nvme/device") pci=${pci##*/}
|
||||||
info "$pci"
|
info "$pci" || ((++missing_buf))
|
||||||
done
|
done
|
||||||
|
((missing_buf == 0))
|
||||||
|
Loading…
Reference in New Issue
Block a user