From 09110dba36e5bef6d2702ff386434b34598e1e4b Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Mon, 28 Jan 2019 20:12:02 +0000 Subject: 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 (cherry picked from commit 1c108d51c08631548dc2b2ba1b7652e0b577d82c) (cherry picked from commit 44bc8611bca15c49663a89cfb29cf0ec1a5ed17e) --- resources/libraries/bash/function/device.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'resources') 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 -- cgit 1.2.3-korg