-
Notifications
You must be signed in to change notification settings - Fork 1
/
0001-setup.sh-Speed-up-the-VMD-device-unbind-by-running-i.patch
88 lines (77 loc) · 2.95 KB
/
0001-setup.sh-Speed-up-the-VMD-device-unbind-by-running-i.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
From b0aba3fcd5aceceea530a702922153bc75664978 Mon Sep 17 00:00:00 2001
From: Samir Raval <[email protected]>
Date: Thu, 24 Mar 2022 16:37:50 +0000
Subject: [PATCH] setup.sh: Speed up the VMD device unbind by running in
parallel.
If a VMD device present, add message to communicate to the user to use next steps.
Allow for DRIVER_OVERRIDE="none" to just unbind the driver without binding it to any other.
Fixes #2423
Signed-off-by: Samir Raval <[email protected]>
Change-Id: Ifef6ed50dd619ce7629eabf458edd54e6bb22fa4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12035
Community-CI: Broadcom CI <[email protected]>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
Reviewed-by: Paul Luse <[email protected]>
Tested-by: SPDK CI Jenkins <[email protected]>
---
scripts/setup.sh | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/scripts/setup.sh b/scripts/setup.sh
index d0c09430a..a56c74dd6 100755
--- a/scripts/setup.sh
+++ b/scripts/setup.sh
@@ -141,6 +141,10 @@ function linux_bind_driver() {
pci_dev_echo "$bdf" "$old_driver_name -> $driver_name"
+ if [[ $driver_name == "none" ]]; then
+ return 0
+ fi
+
echo "$ven_dev_id" > "/sys/bus/pci/drivers/$driver_name/new_id" 2> /dev/null || true
echo "$bdf" > "/sys/bus/pci/drivers/$driver_name/bind" 2> /dev/null || true
@@ -248,6 +252,17 @@ function collect_devices() {
if [[ $PCI_ALLOWED != *"$bdf"* ]]; then
pci_dev_echo "$bdf" "Skipping not allowed VMD controller at $bdf"
in_use=1
+ elif [[ " ${drivers_d[*]} " =~ "nvme" ]]; then
+ if [[ "${DRIVER_OVERRIDE}" != "none" ]]; then
+ if [ "$mode" == "config" ]; then
+ cat <<- MESSAGE
+ Binding new driver to VMD device. If there are NVMe SSDs behind the VMD endpoint
+ which are attached to the kernel NVMe driver,the binding process may go faster
+ if you first run this script with DRIVER_OVERRIDE="none" to unbind only the
+ NVMe SSDs, and then run again to unbind the VMD devices."
+ MESSAGE
+ fi
+ fi
fi
fi
fi
@@ -305,7 +320,9 @@ function configure_linux_pci() {
fi
fi
- if [[ -n "${DRIVER_OVERRIDE}" ]]; then
+ if [[ "${DRIVER_OVERRIDE}" == "none" ]]; then
+ driver_name=none
+ elif [[ -n "${DRIVER_OVERRIDE}" ]]; then
driver_path="$DRIVER_OVERRIDE"
driver_name="${DRIVER_OVERRIDE##*/}"
# modprobe and the sysfs don't use the .ko suffix.
@@ -337,10 +354,12 @@ function configure_linux_pci() {
fi
# modprobe assumes the directory of the module. If the user passes in a path, we should use insmod
- if [[ -n "$driver_path" ]]; then
- insmod $driver_path || true
- else
- modprobe $driver_name
+ if [[ $driver_name != "none" ]]; then
+ if [[ -n "$driver_path" ]]; then
+ insmod $driver_path || true
+ else
+ modprobe $driver_name
+ fi
fi
for bdf in "${!all_devices_d[@]}"; do
--
2.31.1