From patchwork Thu Feb 9 14:53:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 123509 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 5EC8E41B98; Thu, 9 Feb 2023 07:56:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5392740DDA; Thu, 9 Feb 2023 07:56:36 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id ECE9C4067B for ; Thu, 9 Feb 2023 07:56:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675925795; x=1707461795; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=U6E2+OhoSFrCKC4HpMOHC1MXOvZcx3WicoIowzecNxM=; b=a29wOwoBS8t/g5/StN0siS/BuTRXVBLj6eIf6bOUNaefM2opdj4ROnKM bGj2ryR5fIMCzGoidoyYMs8TgD+keEC59dMmTNXj+43yavu5+VC72cFvf Jm0Mv31eR+9VGkyyDikKp+sxHrqQVP9KBRG9U5fyGRSDhB3ECWHaBfQyh +5aMc2R+fB3yCIdyEUtVtE2a/bKnMWsNl5JScl9bVRZBg96Bs8wW8zcvm fZdKc58p8BlsVl5bMimBg2gVSbxY8x0IQWps5pvKGtzjUwIh5eVYRMWhx TWevC5OBCw/eove5MSred1Nv9jJl+b96erwKgaL9o+H3ogW8jgqKMF1jS Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="392420765" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="392420765" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:34 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="810224089" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="810224089" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:33 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V1 1/4] test_plans/pmd_bonded_8023ad: modify the script to adapt to changes in dpdk Date: Thu, 9 Feb 2023 14:53:48 +0000 Message-Id: <20230209145351.1140496-2-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230209145351.1140496-1-songx.jiale@intel.com> References: <20230209145351.1140496-1-songx.jiale@intel.com> 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 the display information of the binding port in dpdk-testpmd has changed. modify the script to adapt to this change. According to dpdk commit f3b5f3d35c59e1("app/testpmd: use dump API to show bonding info"). Signed-off-by: Song Jiale --- test_plans/pmd_bonded_8023ad_test_plan.rst | 118 +++++++++++++++++++-- 1 file changed, 108 insertions(+), 10 deletions(-) diff --git a/test_plans/pmd_bonded_8023ad_test_plan.rst b/test_plans/pmd_bonded_8023ad_test_plan.rst index f54c51d2..f5087993 100644 --- a/test_plans/pmd_bonded_8023ad_test_plan.rst +++ b/test_plans/pmd_bonded_8023ad_test_plan.rst @@ -293,11 +293,60 @@ steps #. check if agg_mode set successful:: testpmd> show bonding config 2 - Bonding mode: 4 - IEEE802.3AD Aggregator Mode: - Slaves (2): [0 1] - Active Slaves (2): [0 1] - Primary: [0] + - Dev basic: + Bonding mode: 8023AD(4) + Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER2 + IEEE802.3AD Aggregator Mode: + Slaves (2): [0 1] + Active Slaves (2): [0 1] + Current Primary: [0] + - Lacp info: + IEEE802.3 port: 2 + fast period: 900 ms + slow period: 29000 ms + short timeout: 3000 ms + long timeout: 90000 ms + aggregate wait timeout: 2000 ms + tx period: 500 ms + rx marker period: 2000 ms + update timeout: 100 ms + aggregation mode: count + + Slave Port: 0 + Aggregator port id: 0 + selection: SELECTED + Actor detail info: + system priority: 65535 + system mac address: 7A:1A:91:74:32:46 + port key: 8448 + port priority: 65280 + port number: 256 + port state: ACTIVE AGGREGATION DEFAULTED + Partner detail info: + system priority: 65535 + system mac address: 00:00:00:00:00:00 + port key: 256 + port priority: 65280 + port number: 0 + port state: ACTIVE + + Slave Port: 1 + Aggregator port id: 0 + selection: SELECTED + Actor detail info: + system priority: 65535 + system mac address: 5E:F7:F5:3E:58:D8 + port key: 8448 + port priority: 65280 + port number: 512 + port state: ACTIVE AGGREGATION DEFAULTED + Partner detail info: + system priority: 65535 + system mac address: 00:00:00:00:00:00 + port key: 256 + port priority: 65280 + port number: 0 + port state: ACTIVE #. quit testpmd:: @@ -384,11 +433,60 @@ steps #. check if bonded device has been created and slaves have been bonded successful:: testpmd> show bonding config 2 - Bonding mode: 4 - IEEE802.3AD Aggregator Mode: - Slaves (2): [0 1] - Active Slaves (2): [0 1] - Primary: [0] + - Dev basic: + Bonding mode: 8023AD(4) + Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER2 + IEEE802.3AD Aggregator Mode: + Slaves (2): [0 1] + Active Slaves (2): [0 1] + Current Primary: [0] + - Lacp info: + IEEE802.3 port: 2 + fast period: 900 ms + slow period: 29000 ms + short timeout: 3000 ms + long timeout: 90000 ms + aggregate wait timeout: 2000 ms + tx period: 500 ms + rx marker period: 2000 ms + update timeout: 100 ms + aggregation mode: count + + Slave Port: 0 + Aggregator port id: 0 + selection: SELECTED + Actor detail info: + system priority: 65535 + system mac address: 7A:1A:91:74:32:46 + port key: 8448 + port priority: 65280 + port number: 256 + port state: ACTIVE AGGREGATION DEFAULTED + Partner detail info: + system priority: 65535 + system mac address: 00:00:00:00:00:00 + port key: 256 + port priority: 65280 + port number: 0 + port state: ACTIVE + + Slave Port: 1 + Aggregator port id: 0 + selection: SELECTED + Actor detail info: + system priority: 65535 + system mac address: 5E:F7:F5:3E:58:D8 + port key: 8448 + port priority: 65280 + port number: 512 + port state: ACTIVE AGGREGATION DEFAULTED + Partner detail info: + system priority: 65535 + system mac address: 00:00:00:00:00:00 + port key: 256 + port priority: 65280 + port number: 0 + port state: ACTIVE #. check if bonded port can start:: From patchwork Thu Feb 9 14:53:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 123510 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 8825A41B98; Thu, 9 Feb 2023 07:56:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8281C4161A; Thu, 9 Feb 2023 07:56:38 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id C045C4282D for ; Thu, 9 Feb 2023 07:56:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675925796; x=1707461796; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DRIH+ugGBeX5jb2SQgwJ9DwutN7bbA2Cd4r+d27T/uw=; b=amJzTGx0Hfidm7VotjZLJ9AgvayzLODT4QrMBs+dPvJfq7eLq7v79dp0 Neg9v1vxLvFuJdVDl5fHCMr8YMpFUYBYuLAPFX1CizxbEFNsfR8ViKqSv mUBMgTTpn/V29LI7CiLj1HOGS9UCPmlqMZluFYOQ1T8hYG9YGRxLPfpxo uclia/ulDVxgUr0NquObntKAmgmLfDgmMs5Yrodgl96GXb6nszaLQk7Nz 68TfKrMFbWBDjrl4CwvNJpQyJxDITqxXq+hv1I6rFQngRoafTRHecykwV EaeAjfhDKioi8ekRDh6aMsUtJgHbasmtGXCqRPQk5QezIm6SVKMLxn2Hj w==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="392420770" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="392420770" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:35 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="810224094" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="810224094" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:34 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V1 2/4] tests/pmd_bonded_8023ad: modify the script to adapt to changes in dpdk Date: Thu, 9 Feb 2023 14:53:49 +0000 Message-Id: <20230209145351.1140496-3-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230209145351.1140496-1-songx.jiale@intel.com> References: <20230209145351.1140496-1-songx.jiale@intel.com> 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 the display information of the binding port in dpdk-testpmd has changed. modify the script to adapt to this change. According to dpdk commit f3b5f3d35c59e1("app/testpmd: use dump API to show bonding info"). Signed-off-by: Song Jiale --- tests/TestSuite_pmd_bonded_8023ad.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_pmd_bonded_8023ad.py b/tests/TestSuite_pmd_bonded_8023ad.py index c1bf2759..1921a942 100644 --- a/tests/TestSuite_pmd_bonded_8023ad.py +++ b/tests/TestSuite_pmd_bonded_8023ad.py @@ -362,7 +362,9 @@ class TestBonding8023AD(TestCase): # create commandline option format bonding_name = "net_bonding0" slaves_pci = ["slave=" + pci for pci in slave_pcis] - bonding_mode = "mode={0}".format(str(MODE_LACP)) + p = r"\w+\((\d+)\)" + mode_id = int(re.match(p, str(MODE_LACP)).group(1)) + bonding_mode = "mode={0}".format(mode_id) agg_config = "agg_mode={0}" vdev_format = ",".join([bonding_name] + slaves_pci + [bonding_mode, agg_config]) # command line option From patchwork Thu Feb 9 14:53:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 123511 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 AFA8C41B98; Thu, 9 Feb 2023 07:56:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A752242B8C; Thu, 9 Feb 2023 07:56:39 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 621F44067B for ; Thu, 9 Feb 2023 07:56:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675925797; x=1707461797; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WEqs752tUr04JFZ6IMA0ijBDcswJLletVuxwWEI2980=; b=nSC57Xt6VSNG0OR6UTn9/kYkJmlmue6/XPmlgNXpz7dPPsK554D1Hr3Z GjGcv26CHCJe31Cqlz1yPSzWSJt/ltjrAcGit7DKfcRUgIa+UL8+XsbRG opIzYjegrMLyfhd3FdEvjdzBuSNrIO3HrYPutJVmeRe7iZK/Gd31KjcgT 1kbZCVfKvMWsAC3z1zz6Fz0EIDaiyNt2pRUd+IczFNRPQkcPgWSvGn4HH wvKHnrSwzwsmehdI9Cf8KSlhhwSD3P58G6kPGQoZT0Porsb1ZnrjXFi4e NgjriXMwxzc1PdRBA0yeVZ5/M4HPTPV1McmvoSsvOuLd5fLnMArzUZUcI w==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="392420771" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="392420771" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:36 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="810224114" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="810224114" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:35 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V1 3/4] tests/pmd_bonded: modify the script to adapt to changes in dpdk Date: Thu, 9 Feb 2023 14:53:50 +0000 Message-Id: <20230209145351.1140496-4-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230209145351.1140496-1-songx.jiale@intel.com> References: <20230209145351.1140496-1-songx.jiale@intel.com> 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 the display information of the binding port in dpdk-testpmd has changed. modify the script to adapt to this change. According to dpdk commit f3b5f3d35c59e1("app/testpmd: use dump API to show bonding info"). Signed-off-by: Song Jiale --- tests/TestSuite_pmd_bonded.py | 53 ++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/tests/TestSuite_pmd_bonded.py b/tests/TestSuite_pmd_bonded.py index 97f76e93..a27a991a 100644 --- a/tests/TestSuite_pmd_bonded.py +++ b/tests/TestSuite_pmd_bonded.py @@ -25,13 +25,13 @@ from framework.test_case import TestCase SOCKET_0 = 0 SOCKET_1 = 1 -MODE_ROUND_ROBIN = 0 -MODE_ACTIVE_BACKUP = 1 -MODE_XOR_BALANCE = 2 -MODE_BROADCAST = 3 -MODE_LACP = 4 -MODE_TLB_BALANCE = 5 -MODE_ALB_BALANCE = 6 +MODE_ROUND_ROBIN = "ROUND_ROBIN(0)" +MODE_ACTIVE_BACKUP = "ACTIVE_BACKUP(1)" +MODE_XOR_BALANCE = "BALANCE(2)" +MODE_BROADCAST = "BROADCAST(3)" +MODE_LACP = "8023AD(4)" +MODE_TLB_BALANCE = "TLB(5)" +MODE_ALB_BALANCE = "ALB(6)" FRAME_SIZE_64 = 64 FRAME_SIZE_65 = 65 @@ -413,7 +413,7 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' """ Get the mode of the bonding device which you choose. """ - return self.get_info_from_bond_config("Bonding mode: ", "\d*", bond_port) + return self.get_info_from_bond_config("Bonding mode: ", "\S*", bond_port) def get_bond_balance_policy(self, bond_port): """ @@ -449,7 +449,7 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' """ Get the primary slave of the bonding device which you choose. """ - return self.get_info_from_bond_config("Primary: \[", "\d*", bond_port) + return self.get_info_from_bond_config("Current Primary: \[", "\d*", bond_port) def launch_app(self, pmd_param=" "): """ @@ -457,16 +457,18 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' """ self.pmdout.start_testpmd("all", param=pmd_param) - def create_bonded_device(self, mode=0, socket=0, verify_detail=False): + def create_bonded_device(self, mode="", socket=0, verify_detail=False): """ Create a bonding device with the parameters you specified. """ + p = r"\w+\((\d+)\)" + mode_id = int(re.match(p, mode).group(1)) out = self.dut.send_expect( - "create bonded device %d %d" % (mode, socket), "testpmd> " + "create bonded device %d %d" % (mode_id, socket), "testpmd> " ) self.verify( "Created new bonded device" in out, - "Create bonded device on mode [%d] socket [%d] failed" % (mode, socket), + "Create bonded device on mode [%s] socket [%d] failed" % (mode, socket), ) bond_port = self.get_value_from_str( "Created new bonded device net_bonding_testpmd_[\d] on \(port ", "\d+", out @@ -478,7 +480,7 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' "show bonding config %d" % bond_port, "testpmd> " ) self.verify( - "Bonding mode: %d" % mode in out, + "Bonding mode: %s" % mode in out, "Bonding mode display error when create bonded device", ) self.verify( @@ -911,19 +913,20 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' Do some basic operations to bonded devices and slaves, such as adding, removing, setting primary or setting mode. """ + p = r"\w+\((\d+)\)" + mode_id = int(re.match(p, mode_set).group(1)) bond_port_0 = self.create_bonded_device(mode_set, SOCKET_0, True) self.add_slave_to_bonding_device(bond_port_0, False, self.dut_ports[1]) - mode_value = self.get_bond_mode(bond_port_0) - self.verify("%d" % mode_set in mode_value, "Setting bonding mode error") + self.verify("%s" % mode_set in mode_value, "Setting bonding mode error") bond_port_1 = self.create_bonded_device(mode_set, SOCKET_0) self.add_slave_to_bonding_device(bond_port_0, False, self.dut_ports[0]) self.add_slave_to_bonding_device(bond_port_1, True, self.dut_ports[0]) - OTHER_MODE = mode_set + 1 if not mode_set else mode_set - 1 + OTHER_MODE = mode_id + 1 if not mode_id else mode_id - 1 self.set_mode_for_bonding_device(bond_port_0, OTHER_MODE) - self.set_mode_for_bonding_device(bond_port_0, mode_set) + self.set_mode_for_bonding_device(bond_port_0, mode_id) self.add_slave_to_bonding_device(bond_port_0, False, self.dut_ports[2]) time.sleep(5) @@ -968,14 +971,14 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' self.verify( mac_address_1_orig == mac_address_bond_now and mac_address_bond_now == mac_address_2_now, - "NOT all slaves MAC address same with bonding device in mode %d" + "NOT all slaves MAC address same with bonding device in mode %s" % mode_set, ) else: self.verify( mac_address_1_orig == mac_address_bond_now and mac_address_bond_now != mac_address_2_now, - "All slaves should not be the same in mode %d" % mode_set, + "All slaves should not be the same in mode %s" % mode_set, ) new_mac = "00:11:22:00:33:44" @@ -990,7 +993,7 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' == mac_address_2_now == mac_address_bond_now == new_mac, - "Set mac failed for bonding device in mode %d" % mode_set, + "Set mac failed for bonding device in mode %s" % mode_set, ) elif mode_set == MODE_LACP: self.verify( @@ -998,14 +1001,14 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' and mac_address_1_now != new_mac and mac_address_2_now != new_mac and mac_address_1_now != mac_address_2_now, - "Set mac failed for bonding device in mode %d" % mode_set, + "Set mac failed for bonding device in mode %s" % mode_set, ) elif mode_set in [MODE_ACTIVE_BACKUP, MODE_TLB_BALANCE]: self.verify( mac_address_bond_now == new_mac and mac_address_1_now == new_mac and mac_address_bond_now != mac_address_2_now, - "Set mac failed for bonding device in mode %d" % mode_set, + "Set mac failed for bonding device in mode %s" % mode_set, ) self.set_primary_for_bonding_device(bond_port, self.dut_ports[2], False) @@ -1117,18 +1120,18 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)' if mode_set in [MODE_ROUND_ROBIN, MODE_XOR_BALANCE, MODE_BROADCAST]: self.verify( port_disabled_num == 4, - "Not all slaves of bonded device turn promiscuous mode off in mode %d." + "Not all slaves of bonded device turn promiscuous mode off in mode %s." % mode_set, ) elif mode_set == MODE_LACP: self.verify( port_disabled_num == 1, - "Not only turn bound device promiscuous mode off in mode %d" % mode_set, + "Not only turn bound device promiscuous mode off in mode %s" % mode_set, ) else: self.verify( port_disabled_num == 2, - "Not only the primary slave turn promiscous mode off in mode %d, " + "Not only the primary slave turn promiscous mode off in mode %s, " % mode_set + " when bonded device promiscous disabled.", ) From patchwork Thu Feb 9 14:53:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 123512 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 D3EC441B98; Thu, 9 Feb 2023 07:56:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE2C442B71; Thu, 9 Feb 2023 07:56:40 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id DA6EC42B8C for ; Thu, 9 Feb 2023 07:56:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675925799; x=1707461799; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t+slbzfje+daC7MWPc4aossFzd5RMDMUHBnWf5fgXMc=; b=cZngid773cIs0ErNGY3Z5N4lqZOQjW7XUzP2H3mw0U64sgacTaX2iJ2n ComfSHmpWMKVu6s10EV3kK4JSqjlRNXU7YZC/q88QsADWhUtdERDiozxj u8KTh3lgRiwtNsdytAWpLLrp7Gd41aiLgo1cqPlqUe8ZtI4lTuRXKPA/m ws/0GUtQ51Rf+baKGbTMy1We2M+yloOt2ExGcusjFZ/fEZ1eYvkhgc8ER +0Hva62hId4ImIr9zEiVt4RNNXbbIcrYX/pXSgqH5G2jzX2ez3Ye/s8Gw otq+E3tMzO3Y7jU0tzIcK/nmBYNZqVbnXe/VD0OsQD+nWLZq28GI39C8v w==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="392420774" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="392420774" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:37 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="810224125" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="810224125" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:36 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V1 4/4] tests/bonding: modify the script to adapt to changes in dpdk Date: Thu, 9 Feb 2023 14:53:51 +0000 Message-Id: <20230209145351.1140496-5-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230209145351.1140496-1-songx.jiale@intel.com> References: <20230209145351.1140496-1-songx.jiale@intel.com> 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 the display information of the binding port in dpdk-testpmd has changed. modify the script to adapt to this change. According to dpdk commit f3b5f3d35c59e1("app/testpmd: use dump API to show bonding info"). Signed-off-by: Song Jiale --- tests/bonding.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/bonding.py b/tests/bonding.py index 30f55c7f..d6d3ea30 100644 --- a/tests/bonding.py +++ b/tests/bonding.py @@ -19,13 +19,13 @@ from framework.pmd_output import PmdOutput from framework.settings import HEADER_SIZE # define bonding mode -MODE_ROUND_ROBIN = 0 -MODE_ACTIVE_BACKUP = 1 -MODE_XOR_BALANCE = 2 -MODE_BROADCAST = 3 -MODE_LACP = 4 -MODE_TLB_BALANCE = 5 -MODE_ALB_BALANCE = 6 +MODE_ROUND_ROBIN = "ROUND_ROBIN(0)" +MODE_ACTIVE_BACKUP = "ACTIVE_BACKUP(1)" +MODE_XOR_BALANCE = "BALANCE(2)" +MODE_BROADCAST = "BROADCAST(3)" +MODE_LACP = "8023AD(4)" +MODE_TLB_BALANCE = "TLB(5)" +MODE_ALB_BALANCE = "ALB(6)" # define packet size FRAME_SIZE_64 = 64 @@ -643,7 +643,7 @@ class PmdBonding(object): def get_bonding_info(self, bond_port, info_types): """Get the specified port information by its output message format""" info_set = { - "mode": ["Bonding mode: ", "\d*"], + "mode": ["Bonding mode: ", "\S*"], "agg_mode": ["IEEE802.3AD Aggregator Mode: ", "\S*"], "balance_policy": ["Balance Xmit Policy: ", "\S+"], "slaves": [ @@ -689,13 +689,15 @@ class PmdBonding(object): return int(primary_port), [int(slave) for slave in active_slaves] - def create_bonded_device(self, mode=0, socket=0, verify_detail=False): + def create_bonded_device(self, mode="", socket=0, verify_detail=False): """ Create a bonding device with the parameters you specified. """ - cmd = "create bonded device %d %d" % (mode, socket) + p = r"\w+\((\d+)\)" + mode_id = int(re.match(p, mode).group(1)) + cmd = "create bonded device %d %d" % (mode_id, socket) out = self.d_console(cmd) - err_fmt = "Create bonded device on mode [%d] socket [%d] failed" + err_fmt = "Create bonded device on mode [%s] socket [%d] failed" self.verify("Created new bonded device" in out, err_fmt % (mode, socket)) fmts = [ "Created new bonded device net_bond_testpmd_[\d] on \(port ", @@ -708,7 +710,7 @@ class PmdBonding(object): if verify_detail: out = self.d_console("show bonding config %d" % bond_port) self.verify( - "Bonding mode: %d" % mode in out, + "Bonding mode: %s" % mode in out, "Bonding mode display error when create bonded device", ) self.verify(