diff --git a/hack/prepare.sh b/hack/prepare.sh index 8f67dd39..2cbe87c0 100755 --- a/hack/prepare.sh +++ b/hack/prepare.sh @@ -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() { @@ -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 @@ -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"