From dfa9c5bb9a6e9548267f3456724a5a1a7f342b06 Mon Sep 17 00:00:00 2001 From: Peter Ginchev Date: Tue, 11 Oct 2016 15:34:24 +0300 Subject: Rebind kernel drivers on VPP uninstall Change-Id: Icb0ce47134146c3a212b234f088c682982480128 Signed-off-by: Peter Ginchev --- build-root/deb/debian/vpp.postrm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 build-root/deb/debian/vpp.postrm (limited to 'build-root/deb/debian/vpp.postrm') diff --git a/build-root/deb/debian/vpp.postrm b/build-root/deb/debian/vpp.postrm new file mode 100644 index 00000000..ac16a459 --- /dev/null +++ b/build-root/deb/debian/vpp.postrm @@ -0,0 +1,21 @@ +#!/bin/sh -e + +removed= + +# Unbind user-mode PCI drivers +pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci` +for d in $pci_dirs; do + for f in ${d}/*; do + [ -e "${f}/config" ] || continue + echo 1 > ${f}/remove + basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}` + removed=y + done +done +if [ -n "${removed}" ]; then + echo "There are changes in PCI drivers, rescaning" + echo 1 > /sys/bus/pci/rescan +else + echo "There weren't PCI devices binded" +fi + -- cgit 1.2.3-korg From 02767e9f2eaf7ccfc4079f83d467ad2d3faee203 Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Thu, 23 Feb 2017 14:28:49 +0000 Subject: Fixed QAT device binding and device unbinding when vpp package is removed Change-Id: I35ad6a42093cad0945df1df09a39c63c4560dce6 Signed-off-by: Radu Nicolau --- build-root/deb/debian/vpp.postrm | 2 +- build-root/rpm/vpp.spec | 2 +- src/vnet/devices/dpdk/init.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'build-root/deb/debian/vpp.postrm') diff --git a/build-root/deb/debian/vpp.postrm b/build-root/deb/debian/vpp.postrm index ac16a459..24b4842f 100644 --- a/build-root/deb/debian/vpp.postrm +++ b/build-root/deb/debian/vpp.postrm @@ -7,7 +7,7 @@ pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_gener for d in $pci_dirs; do for f in ${d}/*; do [ -e "${f}/config" ] || continue - echo 1 > ${f}/remove + echo ${f##*/} > ${d}/unbind basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}` removed=y done diff --git a/build-root/rpm/vpp.spec b/build-root/rpm/vpp.spec index 95196e9b..7bc18ca4 100644 --- a/build-root/rpm/vpp.spec +++ b/build-root/rpm/vpp.spec @@ -244,7 +244,7 @@ pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_gener for d in $pci_dirs; do for f in ${d}/*; do [ -e "${f}/config" ] || continue - echo 1 > ${f}/remove + echo ${f##*/} > ${d}/unbind basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}` removed=y done diff --git a/src/vnet/devices/dpdk/init.c b/src/vnet/devices/dpdk/init.c index 7249cc52..c50c0659 100755 --- a/src/vnet/devices/dpdk/init.c +++ b/src/vnet/devices/dpdk/init.c @@ -858,7 +858,7 @@ dpdk_bind_devices_to_uio (dpdk_config_main_t * conf) vec_reset_length (pci_addr); pci_addr = format (pci_addr, "%U%c", format_vlib_pci_addr, &d->bus_address, 0); - if (d->device_class != PCI_CLASS_NETWORK_ETHERNET) + if (d->device_class != PCI_CLASS_NETWORK_ETHERNET && d->device_class != PCI_CLASS_PROCESSOR_CO) continue; if (num_whitelisted) -- cgit 1.2.3-korg