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-04 17:43:46 +0000
commit1c108d51c08631548dc2b2ba1b7652e0b577d82c (patch)
tree8b89733afb8d3311780a3a902e84296e3e2d1330
parent26637ca4fdb026cea585df4c9e6c0fc2c07492ba (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>
-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