aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support
diff options
context:
space:
mode:
Diffstat (limited to 'resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support')
-rwxr-xr-xresources/tools/disk-image-builder/nested/image-patches/06-dpdk-support11
1 files changed, 7 insertions, 4 deletions
diff --git a/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support b/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support
index 5990f0925b..2de4ad6962 100755
--- a/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support
+++ b/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support
@@ -46,10 +46,13 @@ echo 1af4 1000 > /sys/bus/pci/drivers/${TARGET_DRIVER}/new_id
#
for dev in $(find /sys/bus/pci/drivers/virtio-pci -type l -name '*:*:*.*' | sed -e 's/.*\///')
do
- echo Unbinding $dev from virtio-pci
- echo $dev > /sys/bus/pci/drivers/virtio-pci/unbind
- echo Binding $dev to ${TARGET_DRIVER}
- echo $dev > /sys/bus/pci/drivers/${TARGET_DRIVER}/bind
+ class=$(cat /sys/bus/pci/drivers/virtio-pci/${dev}/class)
+ if [ "$class" = "0x020000" ]; then
+ echo Unbinding $dev from virtio-pci
+ echo $dev > /sys/bus/pci/drivers/virtio-pci/unbind
+ echo Binding $dev to ${TARGET_DRIVER}
+ echo $dev > /sys/bus/pci/drivers/${TARGET_DRIVER}/bind
+ fi
done
# RCU and IRQ affinity