From patchwork Mon Jul 17 06:52:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Ling X-Patchwork-Id: 129566 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 E58F742E96; Mon, 17 Jul 2023 08:53:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E1905410D7; Mon, 17 Jul 2023 08:53:24 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 702CA4068E for ; Mon, 17 Jul 2023 08:53:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689576803; x=1721112803; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RZLXtFTLQbS0F52Tsb66fHiiau+jWrH5DT9tTTHz3T8=; b=bCWFzqemF8PGQn2SvqmgC1ufN9Ks8nbypmqOElqP2wHFTgnZ0kYWWyj7 /7HdUW4DAgn6a7IjGj2QICBKGFac1XhSAAkZ10EBff0bwni6mjiX0ora4 75K1ezrsZt7qOQY6LiXkmTZ9KXBOuLF0Zfdxh3Owjx3D4vguVObfK06dA mU3Gu2MQwWzJ5TB5AbkLzNkqBjA6jEEbFgfF8nLOC5raSqbGGQTU5oYBZ ZNSFECl8DP8s503GOj/oBzTlMEQICnx2OIj6Cjt09ipEciSJ2W8Vvom+q ZjQqjZVhUUL2uLPHHDA0sVBktd+SARqYWWuv6GEfxQxYlJKD35bE/ZpNT g==; X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="363321511" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="363321511" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2023 23:53:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="813189566" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="813189566" Received: from dpdk-lingjin.sh.intel.com ([10.67.114.163]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jul 2023 23:53:00 -0700 From: Jin Ling To: dts@dpdk.org Cc: Jin Ling Subject: [DTS][PATCH V1 1/3] test_plan/ice_config_port_speed: add new test plan Date: Mon, 17 Jul 2023 14:52:51 +0800 Message-Id: <20230717065253.1611703-2-jin.ling@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230717065253.1611703-1-jin.ling@intel.com> References: <20230717065253.1611703-1-jin.ling@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 Signed-off-by: Jin Ling --- .../ice_config_port_speed_test_plan.rst | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 test_plans/ice_config_port_speed_test_plan.rst -- 2.25.1 diff --git a/test_plans/ice_config_port_speed_test_plan.rst b/test_plans/ice_config_port_speed_test_plan.rst new file mode 100644 index 00000000..afb13896 --- /dev/null +++ b/test_plans/ice_config_port_speed_test_plan.rst @@ -0,0 +1,141 @@ +.. Copyright (c) <2022-2023>, Intel Corporation + All rights reserved. + +=========================== +ICE Config Port Speed Tests +=========================== + +Description +=========== + +This document provides the testplan for configuring the port speed function in testpmd +You can get the link speed supported of the NIC by executing `ethtool `, only the supported speed can be configured, +if its' link partner also supports this speed, then once the speed of the dut is reconfigured, the link partner's speed will also be configured + + +Prerequisites +============= + +topology +-------- + +dut_port_0 <-----------> tester_port_0 + + +Hardware +-------- + +Supported NICs: columbiaville_25g/columbiaville_100g + +Software +-------- + +dpdk: http://dpdk.org/git/dpdk +scapy: http://www.secdev.org/projects/scapy/ + +General set up +-------------- + +1. Compile DPDK:: + + CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib --default-library=static x86_64-native-linuxapp-gcc + ninja -C x86_64-native-linuxapp-gcc -j 110 + +2. Get the pci device id of DUT, for example:: + + ./usertools/dpdk-devbind.py -s + + 0000:31:00.0 'Device 159b' if=ens4 drv=ice unused=vfio-pci + +3. Get the supported speed of dut and tester:: + + Dut:: + ethtool ens785f0: + Settings for ens785f0: + Supported ports: [ FIBRE ] + Supported link modes: 1000baseT/Full + 10000baseT/Full + 25000baseCR/Full + 25000baseSR/Full + 1000baseX/Full + 10000baseSR/Full + 10000baseLR/Full + Supported pause frame use: Symmetric + Supports auto-negotiation: Yes + Supported FEC modes: None + Advertised link modes: 1000baseX/Full + 10000baseSR/Full + + tester:: + ethtool ens260f0 + Settings for ens260f0: + Supported ports: [ FIBRE ] + Supported link modes: 1000baseX/Full + 10000baseSR/Full + Supported pause frame use: Symmetric Receive-only + Supports auto-negotiation: Yes + Supported FEC modes: Not reported + Advertised link modes: 1000baseX/Full + 10000baseSR/Full + Advertised pause frame use: No + Advertised auto-negotiation: Yes + + Notice that the link speed of dut cannot be configured when dut is `link down`, + so if dut is `link up` , only `Advertised link modes` can be cofigured. + + +Test case 1: port config link speed +------------------------------------- + +In this test case, use `port config speed 10|100|1000|10000|25000|40000|50000|100000|200000|400000|auto duplex half|full|auto` +to set port speed, then use `show port info ` can see the new speed and duplex. + +test steps +~~~~~~~~~~ +1. launch testpmd:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c f -n 4 -a 31:00.0 -- -i + +2. make sure that the link status of dut is up:: + + testpmd> show port info 0 + ********************* Infos for port 0 ********************* + MAC address: B4:96:91:BB:64:D8 + Device name: 31:00.0 + Driver name: net_ice + Firmware-version: 4.20 0x8001642c 1.3341.0 + Devargs: + Connect to socket: 0 + memory allocation on the socket: 0 + *Link status: up + Link speed: 100 Gbps* + Link duplex: full-duplex + Autoneg status: On + +3. stop all ports and set new speed:: + + testpmd> port stop all + testpmd> port config 0 speed 1000|100000 duplex full + testpmd> port start all + +Expected result +~~~~~~~~~~~~~~~ + + 1. Check that the speed has been changed:: + + testpmd> show port info all + + ********************* Infos for port 0 ********************* + ... + Link speed: 10 Gbps + Link duplex: full-duplex + ... + + 2. check tester's has been changed if it supports this spped:: + + ethtool ens10: + Settings for ens10: + ... + Speed: 10000Mb/s + Duplex: Full + ... From patchwork Mon Jul 17 06:52:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Ling X-Patchwork-Id: 129567 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 12B6142E96; Mon, 17 Jul 2023 08:53:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E71640E25; Mon, 17 Jul 2023 08:53:26 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 2BB4F4068E for ; Mon, 17 Jul 2023 08:53:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689576804; x=1721112804; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0PQZi6fqp/J2mGf/X9akhSUJxBoZWUh+9R91HErjpD8=; b=WOR42Ts4qcEOhYm/qQvJNAavK8zCvJUCrnYsBhDbqYOdOZx6x4xu9rro tqUOWSXZAntdTIALrzmcXdcJMlE+m390LyXt/AofyNMUULb3f+Jt3QXff fEcSaKDwBPK9ujpfkxKCZJ878Dx6QdODp9wcF6Xc62W6YPZbNLZ9UbgCu XBZRGJSX27Oy4B+UsbCyNFkBC5qQHv8LrtyiNWZcmBd3cONBu+mitIMw6 JWpyMuALp0mCBqCWLk79sh1pnvB18WtYmqBf8PxPXH395juwDomaXWbu4 fsrUwnAAceHjOfAAfzeyJ6fCcUvMiwpsPnYcXEmqwoLqwUAK/IOfljDQX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="363321514" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="363321514" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2023 23:53:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="813189573" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="813189573" Received: from dpdk-lingjin.sh.intel.com ([10.67.114.163]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jul 2023 23:53:02 -0700 From: Jin Ling To: dts@dpdk.org Cc: Jin Ling Subject: [DTS][PATCH V1 2/3] tests/ice_config_port_speed: add new test cases Date: Mon, 17 Jul 2023 14:52:52 +0800 Message-Id: <20230717065253.1611703-3-jin.ling@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230717065253.1611703-1-jin.ling@intel.com> References: <20230717065253.1611703-1-jin.ling@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 Signed-off-by: Jin Ling --- tests/TestSuite_ice_config_port_speed.py | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 tests/TestSuite_ice_config_port_speed.py -- 2.25.1 diff --git a/tests/TestSuite_ice_config_port_speed.py b/tests/TestSuite_ice_config_port_speed.py new file mode 100644 index 00000000..bc7b38de --- /dev/null +++ b/tests/TestSuite_ice_config_port_speed.py @@ -0,0 +1,63 @@ +import copy +import os +import re +import time +from framework.settings import * +import framework.utils as utils +import tests.rte_flow_common as rfc +from framework.packet import Packet +from framework.pmd_output import PmdOutput +from framework.test_case import TestCase, skip_unsupported_pkg +from framework.utils import GREEN, RED + +class ConfigPortSpeed(TestCase): + def set_up_all(self): + """ + Run at the start of each test suite. + """ + self.dut_ports = self.dut.get_ports(self.nic) + self.pmdout = PmdOutput(self.dut) + # Get the Supported Speed list. + def set_up(args): + pass + def tear_down(args): + pass + def tear_down_all(self): + self.dut.kill_all() + + def test_ice_config_port_speed(self): + # bind ice driver + + # self.tester_kdriver = get_nic_driver(self.tester.ports_info[0]["type"]) + self.pmdout.execute_cmd(f"./usertools/dpdk-devbind.py --force -b={self.kdriver} {self.dut.ports_info[0]['pci']}","#") + # self.pmdout.execute_cmd(f"./usertools/dpdk-devbind.py --force -b={self.drivername} {self.dut.ports_info[0]['peer']}","#") + link_speed = [] + out = self.pmdout.execute_cmd(f"ethtool {self.dut.ports_info[0]['intf']}","#") + link_modes= re.findall('Advertised link modes: (.*)Advertised pause frame use',repr(out)) + for line in link_modes[0].split(r"\r\n\t"): + if line !="": + line = line.strip().split("/") + speed = re.findall("(\w*)base",line[0])[0] + duplex= line[1] + link_speed.append((speed,duplex)) + + link_speed = list(set(link_speed)) + # launch testpmd + self.pmdout.execute_cmd(f"./usertools/dpdk-devbind.py --force -b={self.drivername} {self.dut.ports_info[0]['pci']}","#") + # self.pmdout.execute_cmd(f"./usertools/dpdk-devbind.py --force -b={self.kdriver} {self.dut.ports_info[0]['peer']}","#") + self.pmdout.start_testpmd("Default") + + # make sure link speed is up + self.verify(self.pmdout.get_port_link_status(self.dut_ports[0])=="up","link is down, cannot set link speed") + for item in link_speed: + self.pmdout.execute_cmd("port stop all") + self.pmdout.execute_cmd(f"port config {self.dut_ports[0]} speed {item[0]} duplex {item[1].lower()}") + self.pmdout.execute_cmd("port start all") + self.pmdout.wait_link_status_up(self.dut_ports[0],timeout=30) + # port_info = self.pmdout.execute_cmd(f"show port info {self.dut_ports[0]}") + changed_link_speed = self.pmdout.get_port_link_speed(self.dut_ports[0]) + change_link_duplex = self.pmdout.get_port_link_duplex(self.dut_ports[0]) + + self.verify(int(changed_link_speed) == eval(item[0])//1000 + and item[1].lower() in change_link_duplex, + "link speed mode not changed") From patchwork Mon Jul 17 06:52:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Ling X-Patchwork-Id: 129568 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 8FE3B42E97; Mon, 17 Jul 2023 08:53:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32F7242D1D; Mon, 17 Jul 2023 08:53:26 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id BB7E34068E for ; Mon, 17 Jul 2023 08:53:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689576804; x=1721112804; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1TbMmoXExQiAA+qcod1PspSuejgAuVFLL5wCpnTBH60=; b=EaZPi0cndBmeZtxXunCGTz0M8oVDKMv/RGIxCl/D+r2ybb6Vx3pQ15wr g84iaiTFJzCwQnfW1Wc2QJ/4/f50Us1ySNKE0C13KJCEzrJ0kf/hjLFDU ZU875GsNPMXlMybH6fXhJQBFZKyuk/yTaXIVKv1ErBPBxHgnfWsf0pQzi D+iDCm40tuCRCiSDt7ttCpYUFLlkPu0kTB6TVhoVJ6vYdX6YMmccfOlfn yV9aNSVaP0FWiQCi39Q7S1IEjNXtXzLPdsX5DxOws4kEm38VpaCtbGhYr vfBfaATmc6baeONJIyFDtDhc+liEYI/CIM2d48hn+pLy/BPlHU+2sh6s/ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="363321518" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="363321518" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2023 23:53:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="813189576" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="813189576" Received: from dpdk-lingjin.sh.intel.com ([10.67.114.163]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jul 2023 23:53:03 -0700 From: Jin Ling To: dts@dpdk.org Cc: Jin Ling Subject: [DTS][PATCH V1 3/3] test_plans/index: add new test_suite Date: Mon, 17 Jul 2023 14:52:53 +0800 Message-Id: <20230717065253.1611703-4-jin.ling@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230717065253.1611703-1-jin.ling@intel.com> References: <20230717065253.1611703-1-jin.ling@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 Signed-off-by: Jin Ling --- test_plans/index.rst | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 diff --git a/test_plans/index.rst b/test_plans/index.rst index 2ac4850d..beb1657e 100644 --- a/test_plans/index.rst +++ b/test_plans/index.rst @@ -57,6 +57,7 @@ The following are the test plans for the DPDK DTS automated test system. ice_vf_support_multicast_address_test_plan ice_rss_protocol_agnostic_flow_test_plan ice_fdir_protocol_agnostic_flow_test_plan + ice_config_port_speed_test_plan cloud_filter_with_l4_port_test_plan dcf_lifecycle_test_plan crypto_perf_cryptodev_perf_test_plan