Skip to content

Commit

Permalink
Fixed bug in sdnfv#228
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanBaron14 committed Jun 11, 2020
1 parent ba8b4a1 commit ebd067d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion onvm/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,32 @@ fi

shift 3

# Verify that bc is installed
if [[ $(dpkg-query -W -f='${Status}' bc 2>/dev/null | grep -c "ok installed") == 0 ]]
then
echo "Error: bc is not installed. Install using:"
echo " sudo apt-get install bc"
echo "See dependencies for more information"
exit 1
fi

if [ -z "$nf_cores" ]
then
usage
fi

ports_bin=$(echo "obase=2; ibase=16; $ports" | bc)
count_ports=0
while [[ $ports_bin -ne 0 ]]
do
if [[ $((ports_bin % 10)) -eq 1 ]]
then
count_ports=$((count_ports+1))
fi
ports_bin=$ports_bin/10
done
ports_detected=$("$RTE_SDK"/usertools/dpdk-devbind.py --status-dev net | sed '/Network devices using kernel driver/q' | grep -c "drv")
if [[ $ports_detected -lt $ports ]]
if [[ $ports_detected -lt $count_ports ]]
then
echo "Error: Invalid port mask. Insufficient NICs bound."
exit 1
Expand Down

0 comments on commit ebd067d

Please sign in to comment.