From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: VFIO in setup.sh Date: Mon, 30 Mar 2015 13:35:07 -0700 Message-ID: <20150330133507.77ff6b1d@urahara> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Anatoly Burakov Return-path: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" This code around vfio in setup script looks incorrect, is anyone using it: 1. Why set the execute bit, when you want read-write? Looks like a bug (or worse a security hole). # make sure regular users can read /dev/vfio echo "chmod /dev/vfio" sudo chmod a+x /dev/vfio 3. Why depend on location of vfio module in kernel tree? modprobe does the right thing and finds it. VFIO_PATH="kernel/drivers/vfio/pci/vfio-pci.ko" echo "Loading VFIO module" /sbin/lsmod | grep -s vfio_pci > /dev/null if [ $? -ne 0 ] ; then if [ -f /lib/modules/$(uname -r)/$VFIO_PATH ] ; then sudo /sbin/modprobe vfio-pci fi fi