From patchwork Thu May 20 03:41:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Xia X-Patchwork-Id: 93329 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 D5163A0A0A; Thu, 20 May 2021 05:37:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 968D640143; Thu, 20 May 2021 05:37:06 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 038F740041 for ; Thu, 20 May 2021 05:37:04 +0200 (CEST) IronPort-SDR: A7iW+mDzYZ3Wq9A79O6w9e4UO1ryI/ntC118zs53jZVcUZVMg1rLK4sWRbPYxIzsi1ZjoUUOV7 03EFgWq5N7rw== X-IronPort-AV: E=McAfee;i="6200,9189,9989"; a="286661537" X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="286661537" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 20:37:02 -0700 IronPort-SDR: 76Mp96b8ouCNkzoPiEMlF1Q+N4DnGS52Msr8nEjQzSRaQepIXf/o0ebZMQ1VMMzWBBmwdybLSZ WMsTnz/Xjs6w== X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="631239427" Received: from unknown (HELO localhost.localdomain) ([10.240.183.80]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 20:37:01 -0700 From: Yan Xia To: dts@dpdk.org Cc: Yan Xia Date: Thu, 20 May 2021 11:41:56 +0800 Message-Id: <20210520034157.10877-1-yanx.xia@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1 1/2] test_plans/ftag_test_plan: remove ftag_test_plan 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 Sender: "dts" Signed-off-by: Yan Xia --- test_plans/ftag_test_plan.rst | 110 ---------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 test_plans/ftag_test_plan.rst diff --git a/test_plans/ftag_test_plan.rst b/test_plans/ftag_test_plan.rst deleted file mode 100644 index 413d0cee..00000000 --- a/test_plans/ftag_test_plan.rst +++ /dev/null @@ -1,110 +0,0 @@ -.. Copyright (c) <2016-2017>, Intel Corporation - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - - Neither the name of Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - -=========================== -FM10k FTAG Forwarding Tests -=========================== - -FM10000 supports the addition of a Fabric Tag (FTAG) to carry special -information between Switches, between Switch and PCIe Host Interface or -between Switch and Tunneling Engines. This tag is essential for a set of -switches to behave like one switch (switch aggregation). - -The FTAG is placed at the beginning of the frame. The case will validate -packet forwarding function based on FTAG. - -Prerequisites -============= - -Turn on CONFIG_RTE_LIBRTE_FM10K_FTAG_FWD in common_linuxapp configuration file. -Startup testpoint and export Port0 and Port1's GLORT ID. - -Strip port logic value from mac table information. -There's the sample output from RubyRapid. From the output, port0's logic -value is 4122 and port1's logic value is 4123:: - - <0>% show mac table all - MAC Mode FID1 FID2 Type Value Trig ... - ------------------ --------- ---- ---- ------ ------ ----- - 00:00:00:00:01:01 Dynamic 1 NA Local 1 1 - a0:36:9f:60:b6:6e Static 1 NA PF/VF 4506 1 - a0:36:9f:60:b6:68 Static 1 NA PF/VF 4123 1 - 00:00:00:00:01:00 Dynamic 1 NA Local 1 1 - a0:36:9f:60:b6:66 Static 1 NA PF/VF 4122 1 - - -Strip port glort ID from stacking information. -There's the sample output from RubyRapid. Logic port0's GLORT ID is 0x4000. -Logic port1's GLORT ID is 0x4200:: - - show stacking logical-port all - <0>% show stacking logical-port all - - SW GLORT LOGICAL PORT PORT TYPE - ---- ----- --------------- --------- - ... - 0 0x4000 4122 ? - 0 0x4200 4123 ? - -Add port's GLORT ID into environment variables:: - - export PORT1_GLORT=0x4200 - export PORT0_GLORT=0x4000 - -Test Case: Ftag forwarding unit test -==================================== - -1. port 0 pci 85:00.0, port 1 pci 87:00.0,start test application:: - - ./x86_64-native-linuxapp-gcc/app/test -c f -n 4 -w 0000:85:00.0,enable_ftag=1 -w 0000:87:00.0,enable_ftag=1 - -2. Run FTAG test function:: - - RTE>>fm10k_ftag_autotest - -3. Send one packet to Port0 and verify packet with ftag forwarded to Port1:: - - Receive 1 packets on port 0 - test for FTAG RX passed - Send out 1 packets with FTAG on port 0 - Receive 1 packets on port 1 - test for FTAG TX passed - Test OK - -4. Send one packet to Port1 and verify packet with ftag forwarded to Port0:: - - Receive 1 packets on port 0 - test for FTAG RX passed - Send out 1 packets with FTAG on port 0 - Receive 1 packets on port 1 - test for FTAG TX passed - Test OK From patchwork Thu May 20 03:41:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Xia X-Patchwork-Id: 93330 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 CEA28A0A0A; Thu, 20 May 2021 05:37:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE760410F0; Thu, 20 May 2021 05:37:10 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id D8E6240041 for ; Thu, 20 May 2021 05:37:08 +0200 (CEST) IronPort-SDR: +zOhL320CRKQqIph1jWWhH27eMA0DmU/QcoDMTJTVD5uqSgDs/Pg9iwAJJaDZQWCqG0n7v09Zf 8H4usw54sETQ== X-IronPort-AV: E=McAfee;i="6200,9189,9989"; a="198042583" X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="198042583" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 20:37:08 -0700 IronPort-SDR: Jo3Oykxwdbm3mK1f58nVXlaMlXw8FD/GVwuyh1fJuv5uqyqOhm0zQQjxoaN6kZZ7VCYMVvaX1O qEvd29tbDC+w== X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="631239438" Received: from unknown (HELO localhost.localdomain) ([10.240.183.80]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 20:37:07 -0700 From: Yan Xia To: dts@dpdk.org Cc: Yan Xia Date: Thu, 20 May 2021 11:41:57 +0800 Message-Id: <20210520034157.10877-2-yanx.xia@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210520034157.10877-1-yanx.xia@intel.com> References: <20210520034157.10877-1-yanx.xia@intel.com> Subject: [dts] [PATCH V1 2/2] tests/ftag: remove TestSuite_ftag 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 Sender: "dts" Signed-off-by: Yan Xia --- tests/TestSuite_ftag.py | 172 ---------------------------------------- 1 file changed, 172 deletions(-) delete mode 100644 tests/TestSuite_ftag.py diff --git a/tests/TestSuite_ftag.py b/tests/TestSuite_ftag.py deleted file mode 100644 index 2f5c6c78..00000000 --- a/tests/TestSuite_ftag.py +++ /dev/null @@ -1,172 +0,0 @@ -# BSD LICENSE -# -# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -""" -DPDK Test suite. - -Test ftag feature - -""" - -import re -import os -import time -import dut -from config import PortConf -from test_case import TestCase -from pmd_output import PmdOutput -from settings import FOLDERS -from packet import Packet - -# -# -# Test class. -# - - -class TestFtag(TestCase): - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - self.verify(self.nic in ['redrockcanyou','atwood','boulderrapid'], 'ftag test can not support %s nic'%self.nic) - self.ports = self.dut.get_ports(self.nic) - self.verify(len(self.ports) >= 2, "Insufficient number of ports.") - patch_file = r'dep/fm10k-add-a-unit-test-for-FTAG-based-forwarding.patch' - patch_dst = "/tmp/" - self.dut.session.copy_file_to(patch_file, patch_dst) - self.patch_hotfix_dpdk(patch_dst + "fm10k-add-a-unit-test-for-FTAG-based-forwarding.patch", True) - self.dut.send_expect("sed -i -e '/CONFIG_RTE_VIRTIO_USER=y/a\CONFIG_RTE_LIBRTE_FM10K_FTAG_FWD=y' config/common_linux", "# ") - self.dut.send_expect("sed -i -e '/SRCS-y += test_pmd_perf.c/a\SRCS-y += test_fm10k_ftag.c' app/test/Makefile", "# ") - self.dut.build_install_dpdk(self.dut.target) - - - def set_up(self): - """ - Run before each test case. - """ - pass - - - def check_forwarding(self, txPort, rxPort, nic, received=True): - self.send_packet(txPort, rxPort, self.nic, received) - - def send_packet(self, txPort, rxPort, nic, received=True): - """ - Send packets according to parameters. - """ - rxitf = self.tester.get_interface(self.tester.get_local_port(rxPort)) - txitf = self.tester.get_interface(self.tester.get_local_port(txPort)) - - dmac_tx = self.dut.get_mac_address(txPort) - dmac_rx = self.dut.get_mac_address(rxPort) - - pkg = 'Ether(dst="%s",src="52:00:00:00:00:00")/IP()/TCP()/("X"*46)' %dmac_rx - self.tester.scapy_foreground() - self.tester.scapy_append('sendp(%s, iface="%s")' % (pkg, txitf)) - self.tester.scapy_execute() - time.sleep(3) - - def patch_hotfix_dpdk(self, patch_dir, on = True): - """ - This function is to apply or remove patch for dpdk. - patch_dir: the abs path of the patch - on: True for apply, False for remove - """ - if on: - self.dut.send_expect("patch -p1 < %s" % patch_dir, "#") - else: - self.dut.send_expect("patch -p1 -R < %s" % patch_dir, "#") - - - def test_ftag_function(self): - """ - ftag functional test - """ - self.dut.send_expect("./%s/app/testpmd -c f -n 4 -- -i" %self.dut.target,"testpmd", 60) - self.tx_port = self.ports[0] - self.rx_port = self.ports[1] - - dmac_tx = self.dut.get_mac_address(self.tx_port) - dmac_rx = self.dut.get_mac_address(self.rx_port) - """ - get port glort id in the mac table of testpoint switch - """ - if self.kdriver == "fm10k": - netobj = self.dut.ports_info[self.tx_port]['port'] - port0_glortid = netobj.get_glortid_bymac(dmac_tx) - port1_glortid = netobj.get_glortid_bymac(dmac_rx) - - self.dut.send_expect("quit", "# ") - """ - export port glort id - """ - self.dut.send_expect("export PORT0_GLORT=%s" %port0_glortid, "#", 2) - self.dut.send_expect("export PORT1_GLORT=%s" %port1_glortid, "#", 2) - enable_ftag_ports = '' - for port in range(0,len(self.ports)): - pci_bus = self.dut.ports_info[port]['pci'] - enable_ftag_ports += '-w %s,enable_ftag=1 ' % pci_bus - self.dut.send_expect("./%s/app/test -c f -n 4 %s" %(self.dut.target,enable_ftag_ports),"R.*T.*E.*>.*>", 60) - - #fm10k ftag auto test - for txport in range(0,len(self.ports)): - for rxport in range(0,len(self.ports)): - self.dut.send_expect("fm10k_ftag_autotest", "Dump", 100) - self.check_forwarding(txport, rxport, self.nic, received=False) - out = self.dut.get_session_output() - print(("out:%s" %out)) - self.verify("Test OK" in out, "Fail to do fm10k ftag test") - self.dut.send_expect("quit", "# ") - - def tear_down(self): - """ - Run after each test case. - """ - pass - - - def tear_down_all(self): - """ - Run after each test suite. - """ - self.dut.kill_all() - self.dut.send_expect("sed -i '/CONFIG_RTE_LIBRTE_FM10K_FTAG_FWD=y/d' config/common_linux", "# ") - self.dut.send_expect("sed -i '/SRCS-y += test_fm10k_ftag.c/d' app/test/Makefile", "# ") - patch_dst = "/tmp/" - self.patch_hotfix_dpdk(patch_dst + "fm10k-add-a-unit-test-for-FTAG-based-forwarding.patch", False) - self.dut.build_install_dpdk(self.dut.target)