4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 rootdevs=`jq -r .resourceList[].rootDevices[] </etc/pcidp/config.json 2>/dev/null`
21 if [[ -n "$rootdevs" ]]; then
22 for pci in $rootdevs; do
23 vf=`cat /sys/bus/pci/devices/0000:$pci/sriov_numvfs`
25 if [[ -z "$vf" || "$vf" == "0" ]]; then
26 echo "No VFs found -> SR-IOV DP cannot be started"
31 echo "No SR-IOV designated PF found -> SR-IOV DP cannot be started"
35 if [ $err -eq 0 ]; then
38 echo "Error happened -> sleep 10 -> retry"