Skip to content

Commit 8d45be5

Browse files
committed
Support for 2nd interface validate_offload
eth0 is hardcoded as the interface for offload validation which is used for the primary network. Updated to support net1 and determine which interface to use depending on the test type. Signed-off-by: Venkat Kunaparaju <vkunaparaju@nvidia.com>
1 parent 981210e commit 8d45be5

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

pluginValidateOffload.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,29 +481,34 @@ def _thread_action() -> BaseOutput:
481481
logger.info("There is no VF on an external server")
482482
msg = "External Iperf Server"
483483
else:
484+
ifname = (
485+
"net1"
486+
if self._perf_instance._network_type == "secondary"
487+
else "eth0"
488+
)
484489
# Get VF representor - use DPU mode if configured
485490
if self._is_dpu_mode:
486491
logger.info("DPU mode: querying VF representor from DPU cluster")
487492
vf_rep = self._get_vf_rep_dpu_mode(
488493
pod_name=self.perf_pod_name,
489-
ifname="eth0",
494+
ifname=ifname,
490495
)
491496
else:
492497
vf_rep = self.pod_get_vf_rep(
493498
pod_name=self.perf_pod_name,
494-
ifname="eth0",
499+
ifname=ifname,
495500
host_pod_name=self.pod_name,
496501
)
497502

498503
if vf_rep is None:
499504
success_result = False
500505
msg = "cannot determine VF_REP for pod"
501506
logger.error(
502-
f"VF representor for {self.perf_pod_name} not detected"
507+
f"VF representor for {ifname} in {self.perf_pod_name} not detected"
503508
)
504509
else:
505510
logger.info(
506-
f"VF representor for eth0 in pod {self.perf_pod_name} is {repr(vf_rep)}"
511+
f"VF representor for {ifname} in pod {self.perf_pod_name} is {repr(vf_rep)}"
507512
)
508513
ethtool_cmd = f"ethtool -S {vf_rep}"
509514

0 commit comments

Comments
 (0)