From patchwork Wed Feb 1 14:51:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 122777 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 134ED41B99; Wed, 1 Feb 2023 07:53:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB75840A7A; Wed, 1 Feb 2023 07:53:40 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C40124021F for ; Wed, 1 Feb 2023 07:53:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675234420; x=1706770420; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ZVprypLJQKJZPq8wTUWYOsemb/HbjLG4lRGLtGyVpic=; b=SJzZf0VQGuCjaYoBqIkGtKC05/L8WrQH+b3NEvcfmTxVqjSr4vqdXH26 dZ29eVJ/0L0il7GjVqiAOx/DUYd5Fln2lhCo3rtmPWLrDFu2944doA18r kVZp/v5bpkCtBJhCEoQ/aOQprgOrn9o5Wq7AuTReaFu/DC7jy6FAwgDDF 5mhEdeHXPz7ru5hYiaOHdZ8ohwltNT3mumMNk2c6T39dA5L1mpfs7xxlN 9+E88kzA4+VaxAe0MiQu0s7rjx0/d8vW6yT5N+WxFQ+y1fdU7EedbBmPe 4QhjdoVtW/XxVrT3p1TeXsWyVDN1PRw0DAHraKMQHre3+Cx9aYlB5W0c0 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10607"; a="308408431" X-IronPort-AV: E=Sophos;i="5.97,263,1669104000"; d="scan'208";a="308408431" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 22:53:38 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10607"; a="773331578" X-IronPort-AV: E=Sophos;i="5.97,263,1669104000"; d="scan'208";a="773331578" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 22:53:37 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V2] tests/pmd_bonded: modify script to support ice nic Date: Wed, 1 Feb 2023 14:51:03 +0000 Message-Id: <20230201145103.142909-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org 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". Signed-off-by: Song Jiale --- v1: -modify title and description. tests/TestSuite_pmd_bonded.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_pmd_bonded.py b/tests/TestSuite_pmd_bonded.py index 97f76e93..7a5deaf7 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" - + 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 + ) 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": + if self.default_stats: 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): @@ -2349,4 +2353,12 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' """ Run after each test suite. """ - pass + self.dut.kill_all() + 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), + "# ", + )