aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2019-01-28 20:12:02 +0000
committerPeter Mikus <pmikus@cisco.com>2019-02-05 06:45:28 +0000
commit09110dba36e5bef6d2702ff386434b34598e1e4b (patch)
tree9097ee7a79f1310d454eba6d883b01ee159d10d7
parent22ff475dae7f9f09e8b3b7c899731803752761c0 (diff)
Improve 1n-skx vpp_device mapping function
Improve mapping function for 1n-skx vpp_device to pickup available DUT1 net_dev and replace the name with TG net_dev prefix. This way we can eliminate situation, when pair with not equal VLANs are picked. Change-Id: If78329e730bfb4df34fb8d8924c8715d69a15e0c Signed-off-by: Peter Mikus <pmikus@cisco.com> (cherry picked from commit 1c108d51c08631548dc2b2ba1b7652e0b577d82c) (cherry picked from commit 44bc8611bca15c49663a89cfb29cf0ec1a5ed17e)
-rw-r--r--resources/libraries/bash/function/device.sh26
1 files changed, 20 insertions, 6 deletions
diff --git a/resources/libraries/bash/function/device.sh b/resources/libraries/bash/function/device.sh
index 7d175a9ac3..dce7c7f004 100644
--- a/resources/libraries/bash/function/device.sh
+++ b/resources/libraries/bash/function/device.sh
@@ -298,12 +298,26 @@ function get_available_interfaces () {
fi
done
- for netdev in "${tg_side[@]::2}"; do
- TG_NETDEVS+=(${netdev})
- done
- for netdev in "${dut1_side[@]::2}"; do
- DUT1_NETDEVS+=(${netdev})
- done
+ case "${case_text}" in
+ "1n_skx")
+ # Pick up first two DUT1 interfaces binded to i40evf.
+ for netdev in "${dut1_side[@]::2}"; do
+ DUT1_NETDEVS+=(${netdev})
+ done
+ # Corresponding TG interfaces will be same ID.SUB_ID, but on
+ # opposite linked device.
+ for netdev in "${DUT1_NETDEVS[@]}"; do
+ TG_NETDEVS+=(${netdev/$dut1_netdev/$tg_netdev})
+ done
+ ;;
+ *)
+ for netdev in "${tg_side[@]::2}"; do
+ TG_NETDEVS+=(${netdev})
+ done
+ for netdev in "${dut1_side[@]::2}"; do
+ DUT1_NETDEVS+=(${netdev})
+ done
+ esac
for NETDEV in "${TG_NETDEVS[@]}"; do
get_pci_addr