From 6e6212c4f163d5e1d8455666f4d86af7976895f5 Mon Sep 17 00:00:00 2001 From: lijiaping Date: Thu, 7 Jan 2021 18:10:46 +0800 Subject: [PATCH] Use PCI_SLOT_NAME cut instead of ls -ld cut more precisely If the vf port file like /sys/class/net/ens4f0/device/virtfn0 date is 'Jan 5', ls -ld result will be 'Jan 5', there are two space between Jan and 5, if use the old "cut -f 11 -d ''", it will not get the vf pci id, should be cut 12. So here we use the context in /sys/class/net/p2p1/device/virtfn*/uevent, do with it will be more precise. Change-Id: If7145744bc66514e33f08071a07238ab8c7c7786 --- doc/source/app-openvswitch-asap.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/app-openvswitch-asap.rst b/doc/source/app-openvswitch-asap.rst index b8afd7f3..4abf1049 100644 --- a/doc/source/app-openvswitch-asap.rst +++ b/doc/source/app-openvswitch-asap.rst @@ -167,7 +167,7 @@ Configure Open vSwitch hardware offloading .. code-block:: console - # for vf in `ls -ld /sys/class/net/ens4f0/device/virt* | cut -f 11 -d ' ' | cut -b 4-` + # for vf in `grep PCI_SLOT_NAME /sys/class/net/ens4f0/device/virtfn*/uevent | cut -d'=' -f2` do echo $vf > /sys/bus/pci/drivers/mlx5_core/unbind done @@ -189,7 +189,7 @@ Configure Open vSwitch hardware offloading .. code-block:: console - # for vf in `ls -ld /sys/class/net/ens4f0/device/virt* | cut -f 11 -d ' ' | cut -b 4-` + # for vf in `grep PCI_SLOT_NAME /sys/class/net/ens4f0/device/virtfn*/uevent | cut -d'=' -f2` do echo $vf > /sys/bus/pci/drivers/mlx5_core/bind done