Skip to content

Commit

Permalink
Make prepare script end on error
Browse files Browse the repository at this point in the history
  • Loading branch information
PlagueCZ committed Oct 17, 2024
1 parent 1e8379e commit 722a29d
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions hack/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,10 @@ function get_ipv6() {
while read -r l1; do
if [ "$l1" != "::1/128" ]; then
echo ${l1%/*}
break
return
fi
done < <(ip -6 -o addr show lo | awk '{print $4}')
err "no ipv6 found"
}

function make_config() {
Expand All @@ -257,17 +258,27 @@ function make_config() {
return
fi

# To make error propagation work, need to assign separately
conf_pf0="$(get_ifname 0)"
conf_pf1="$(get_ifname 1)"
conf_vf_pattern="$(get_pattern ${devs[0]})"
conf_ipv6="$(get_ipv6)"
if [[ "$OPT_MULTIPORT" == "true" ]]; then
conf_pf1_proxy="$(get_pf1_proxy ${devs[1]})"
conf_pf1_proxy_vf="$(get_pf1_proxy_vf)"
fi

{ echo "# This has been generated by prepare.sh"
echo "no-stats"
echo "pf0 $(get_ifname 0)"
echo "pf1 $(get_ifname 1)"
echo "vf-pattern $(get_pattern ${devs[0]})"
echo "ipv6 $(get_ipv6)"
echo "pf0 $conf_pf0"
echo "pf1 $conf_pf1"
echo "vf-pattern $conf_vf_pattern"
echo "ipv6 $conf_ipv6"
if [[ "$OPT_MULTIPORT" == "true" ]]; then
echo "a-pf0 ${devs[0]},class=rxq_cqe_comp_en=0,rx_vec_en=1,dv_flow_en=2,dv_esw_en=1,fdb_def_rule_en=1,representor=pf[0-1]vf[0-$[$actualvfs-1]]"
if [[ "$OPT_PF1_PROXY" == "true" ]]; then
echo "pf1-proxy $(get_pf1_proxy ${devs[1]})"
echo "pf1-proxy-vf $(get_pf1_proxy_vf)"
echo "pf1-proxy $conf_pf1_proxy"
echo "pf1-proxy-vf $conf_pf1_proxy_vf"
fi
echo "multiport-eswitch"
else
Expand All @@ -278,7 +289,7 @@ function make_config() {
if [[ "$OPT_MULTIPORT" == "true" ]]; then
log "dpservice configured in multiport-eswitch mode"
if [[ "$OPT_PF1_PROXY" == "true" ]]; then
log "dpservice will create a PF1-proxy"
log "dpservice will create a pf1-proxy"
fi
else
log "dpservice configured in normal mode"
Expand Down

0 comments on commit 722a29d

Please sign in to comment.