test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V4] tests/pmd_bonded: modify script to support ice nic
@ 2023-02-23 18:54 Jiale Song
  2023-03-03  5:37 ` lijuan.tu
  0 siblings, 1 reply; 2+ messages in thread
From: Jiale Song @ 2023-02-23 18:54 UTC (permalink / raw)
  To: dts; +Cc: Jiale Song

1.if the link status of the port of the ice nic needs to be
synchronized with the peer, the peer needs to enable 
"link-down-on-close".
2.the value of 'self.dut_ports' does not want to be changed. 
optimize the assignment method.

Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
 tests/TestSuite_pmd_bonded.py | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

v2:
-modify title and description.

v3:
-increase optimization.

v4:
-the value of a does not want to be changed. optimize the assignment method

diff --git a/tests/TestSuite_pmd_bonded.py b/tests/TestSuite_pmd_bonded.py
index 97f76e93..cedcdd36 100644
--- a/tests/TestSuite_pmd_bonded.py
+++ b/tests/TestSuite_pmd_bonded.py
@@ -885,14 +885,18 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
         self.pmdout = PmdOutput(self.dut)
 
         self.tester_bond = "bond0"
-
-        for port in self.dut_ports:
-            tester_port = self.tester.get_local_port(port)
-            intf = self.tester.get_interface(tester_port)
-            driver = self.tester.ports_info[tester_port]["port"].get_nic_driver()
-            if driver == "i40e":
+        tester_port0 = self.tester.get_local_port(self.dut_ports[0])
+        self.tport_iface0 = self.tester.get_interface(tester_port0)
+        self.flag = "link-down-on-close"
+        self.default_stats = self.tester.get_priv_flags_state(
+            self.tport_iface0, self.flag
+        )
+        if self.default_stats:
+            for port in self.dut_ports:
+                tester_port = self.tester.get_local_port(port)
+                intf = self.tester.get_interface(tester_port)
                 self.tester.send_expect(
-                    "ethtool --set-priv-flags %s link-down-on-close on" % intf, "# ", 10
+                    "ethtool --set-priv-flags %s %s on" % (intf, self.flag), "# "
                 )
 
     def set_up(self):
@@ -1052,7 +1056,7 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
         self.dut.send_expect("start", "testpmd> ")
 
         port_disabled_num = 0
-        testpmd_all_ports = self.dut_ports
+        testpmd_all_ports = self.dut_ports[:]
         testpmd_all_ports.append(bond_port)
         for port_id in testpmd_all_ports:
             value = self.get_detail_from_port_info(
@@ -2349,4 +2353,13 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
         """
         Run after each test suite.
         """
-        pass
+        self.dut.kill_all()
+        if self.default_stats:
+            for port in self.dut_ports:
+                tester_port = self.tester.get_local_port(port)
+                tport_iface = self.tester.get_interface(tester_port)
+                self.tester.send_expect(
+                    "ethtool --set-priv-flags %s %s %s"
+                    % (tport_iface, self.flag, self.default_stats),
+                    "# ",
+                )
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dts] [PATCH V4] tests/pmd_bonded: modify script to support ice nic
  2023-02-23 18:54 [dts] [PATCH V4] tests/pmd_bonded: modify script to support ice nic Jiale Song
@ 2023-03-03  5:37 ` lijuan.tu
  0 siblings, 0 replies; 2+ messages in thread
From: lijuan.tu @ 2023-03-03  5:37 UTC (permalink / raw)
  To: dts, Jiale Song; +Cc: Jiale Song

On Fri, 24 Feb 2023 02:54:21 +0800, Jiale Song <songx.jiale@intel.com> wrote:
> 1.if the link status of the port of the ice nic needs to be
> synchronized with the peer, the peer needs to enable 
> "link-down-on-close".
> 2.the value of 'self.dut_ports' does not want to be changed. 
> optimize the assignment method.
> 
> Signed-off-by: Jiale Song <songx.jiale@intel.com>

Reviewed-by: Lijuan Tu <lijuan.tu@intel.com>
Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-03  5:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 18:54 [dts] [PATCH V4] tests/pmd_bonded: modify script to support ice nic Jiale Song
2023-03-03  5:37 ` lijuan.tu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).