Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/114333/?format=api
https://patches.dpdk.org/api/patches/114333/?format=api", "web_url": "https://patches.dpdk.org/project/dts/patch/20220728160900.310528-4-yaqi.tang@intel.com/", "project": { "id": 3, "url": "https://patches.dpdk.org/api/projects/3/?format=api", "name": "DTS", "link_name": "dts", "list_id": "dts.dpdk.org", "list_email": "dts@dpdk.org", "web_url": "", "scm_url": "git://dpdk.org/tools/dts", "webscm_url": "http://git.dpdk.org/tools/dts/", "list_archive_url": "https://inbox.dpdk.org/dts", "list_archive_url_format": "https://inbox.dpdk.org/dts/{}", "commit_url_format": "" }, "msgid": "<20220728160900.310528-4-yaqi.tang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/20220728160900.310528-4-yaqi.tang@intel.com", "date": "2022-07-28T16:09:00", "name": "[V3,3/3] tests/ice_iavf_rx_timestamp: ice iavf support rx timestamp", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "557e3e5331178430935f4081ff392703be27d5b7", "submitter": { "id": 2357, "url": "https://patches.dpdk.org/api/people/2357/?format=api", "name": "Yaqi Tang", "email": "yaqi.tang@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dts/patch/20220728160900.310528-4-yaqi.tang@intel.com/mbox/", "series": [ { "id": 24109, "url": "https://patches.dpdk.org/api/series/24109/?format=api", "web_url": "https://patches.dpdk.org/project/dts/list/?series=24109", "date": "2022-07-28T16:08:57", "name": "ice iavf support rx timestamp", "version": 3, "mbox": "https://patches.dpdk.org/series/24109/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/114333/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/114333/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dts-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 1074DA00C4;\n\tThu, 28 Jul 2022 10:11:03 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 13B6042B73;\n\tThu, 28 Jul 2022 10:11:03 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 1484040E25\n for <dts@dpdk.org>; Thu, 28 Jul 2022 10:11:00 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 28 Jul 2022 01:11:00 -0700", "from dpdk-yaqi.sh.intel.com ([10.67.119.99])\n by orsmga003.jf.intel.com with ESMTP; 28 Jul 2022 01:10:59 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1658995861; x=1690531861;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=swj2xjoWrQtwn5VQNcUBT4l+ULc1WithY1dneq3VW/0=;\n b=HfQtR/vpROkHLofCaP6BDkLYJ+PrkpQdBbfhXjSYhiminQBjX7tO/jNR\n sqz1AW0WeN3pJYJlYAGdTixWJ1lwCpDvLjFiduU+/xoKtKX8LD6o9ykUk\n UYDhIkfObYY/C9GSSMlGow+h/jmu/NKihHn8sBkukY3rDBLpi/J+ZC7bS\n oakYpl3LTJuYmIWo81mqqke8XtcM/vW7gHUeaWpCKIwTiXLahPcXCsNmf\n EhcewcUK2rxLMiuMfbwQuKerr7zEu10GDwFhY+7xjxe1S0PN7D0Ne396a\n 3ANaAbbifZ4Mx5WgbsC0bCmN+yV6sCH/QpsV9xCyeFcndCAh0974WAQfh Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6400,9594,10421\"; a=\"287206527\"", "E=Sophos;i=\"5.93,196,1654585200\"; d=\"scan'208\";a=\"287206527\"", "E=Sophos;i=\"5.93,196,1654585200\"; d=\"scan'208\";a=\"551202826\"" ], "X-ExtLoop1": "1", "From": "Yaqi Tang <yaqi.tang@intel.com>", "To": "dts@dpdk.org", "Cc": "Yaqi Tang <yaqi.tang@intel.com>", "Subject": "[dts][PATCH V3 3/3] tests/ice_iavf_rx_timestamp: ice iavf support rx\n timestamp", "Date": "Thu, 28 Jul 2022 16:09:00 +0000", "Message-Id": "<20220728160900.310528-4-yaqi.tang@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220728160900.310528-1-yaqi.tang@intel.com>", "References": "<20220728160900.310528-1-yaqi.tang@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dts@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "test suite reviews and discussions <dts.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dts>,\n <mailto:dts-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dts/>", "List-Post": "<mailto:dts@dpdk.org>", "List-Help": "<mailto:dts-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dts>,\n <mailto:dts-request@dpdk.org?subject=subscribe>", "Errors-To": "dts-bounces@dpdk.org" }, "content": "The IAVF driver is able to enable rx timestamp offload.\n\nSigned-off-by: Yaqi Tang <yaqi.tang@intel.com>\n---\n tests/TestSuite_ice_iavf_rx_timestamp.py | 251 +++++++++++++++++++++++\n 1 file changed, 251 insertions(+)\n create mode 100644 tests/TestSuite_ice_iavf_rx_timestamp.py", "diff": "diff --git a/tests/TestSuite_ice_iavf_rx_timestamp.py b/tests/TestSuite_ice_iavf_rx_timestamp.py\nnew file mode 100644\nindex 00000000..2527afc0\n--- /dev/null\n+++ b/tests/TestSuite_ice_iavf_rx_timestamp.py\n@@ -0,0 +1,251 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2022 Intel Corporation\n+#\n+\n+import copy\n+import os\n+import re\n+import time\n+\n+from framework.packet import Packet\n+from framework.pmd_output import PmdOutput\n+from framework.test_case import TestCase\n+from framework.utils import GREEN, RED\n+\n+tv_packets_basic = {\n+ \"tv_mac\": 'Ether(dst=\"00:11:22:33:44:55\")/(\"X\"*480)',\n+ \"tv_mac_ipv4\": 'Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.2\",dst=\"192.168.0.3\")/(\"X\"*480)',\n+ \"tv_mac_ipv6\": 'Ether(dst=\"00:11:22:33:44:55\")/IPv6(src=\"2001::2\", dst=\"2001::3\")/(\"X\"*480)',\n+ \"tv_mac_ipv4_udp\": 'Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.2\", dst=\"192.168.0.3\")/UDP(sport=1026, dport=1027)/(\"X\"*480)',\n+ \"tv_mac_ipv6_udp\": 'Ether(dst=\"00:11:22:33:44:55\")/IPv6(src=\"2001::2\", dst=\"2001::3\")/UDP(sport=1026, dport=1027)/(\"X\"*480)',\n+ \"tv_mac_ipv4_tcp\": 'Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.2\", dst=\"192.168.0.3\")/TCP(sport=1026, dport=1027)/(\"X\"*480)',\n+ \"tv_mac_ipv6_tcp\": 'Ether(dst=\"00:11:22:33:44:55\")/IPv6(src=\"2001::2\", dst=\"2001::3\")/TCP(sport=1026, dport=1027)/(\"X\"*480)',\n+ \"tv_mac_ipv4_sctp\": 'Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.2\", dst=\"192.168.0.3\")/SCTP(sport=1026, dport=1027)/(\"X\"*480)',\n+ \"tv_mac_ipv6_sctp\": 'Ether(dst=\"00:11:22:33:44:55\")/IPv6(src=\"2001::2\", dst=\"2001::3\")/SCTP(sport=1026, dport=1027)/(\"X\"*480)',\n+}\n+\n+command_line_option_with_timestamp = {\n+ \"casename\": \"command_line_option_with_timestamp\",\n+ \"port_id\": 0,\n+ \"test\": [\n+ {\n+ \"send_packet\": tv_packets_basic[\"tv_mac\"],\n+ \"action\": {\"check_timestamp\": \"ether\"},\n+ },\n+ {\n+ \"send_packet\": tv_packets_basic[\"tv_mac_ipv4\"],\n+ \"action\": {\"check_timestamp\": \"ipv4\"},\n+ },\n+ {\n+ \"send_packet\": tv_packets_basic[\"tv_mac_ipv6\"],\n+ \"action\": {\"check_timestamp\": \"ipv6\"},\n+ },\n+ {\n+ \"send_packet\": tv_packets_basic[\"tv_mac_ipv4_udp\"],\n+ \"action\": {\"check_timestamp\": \"ipv4-udp\"},\n+ },\n+ {\n+ \"send_packet\": tv_packets_basic[\"tv_mac_ipv6_udp\"],\n+ \"action\": {\"check_timestamp\": \"ipv6-udp\"},\n+ },\n+ {\n+ \"send_packet\": tv_packets_basic[\"tv_mac_ipv4_tcp\"],\n+ \"action\": {\"check_timestamp\": \"ipv4-tcp\"},\n+ },\n+ {\n+ \"send_packet\": tv_packets_basic[\"tv_mac_ipv6_tcp\"],\n+ \"action\": {\"check_timestamp\": \"ipv6-tcp\"},\n+ },\n+ {\n+ \"send_packet\": tv_packets_basic[\"tv_mac_ipv4_sctp\"],\n+ \"action\": {\"check_timestamp\": \"ipv4-sctp\"},\n+ },\n+ {\n+ \"send_packet\": tv_packets_basic[\"tv_mac_ipv6_sctp\"],\n+ \"action\": {\"check_timestamp\": \"ipv6-sctp\"},\n+ },\n+ ],\n+}\n+\n+\n+class IAVFTimestampConfigureTest(TestCase):\n+ def set_up_all(self):\n+ \"\"\"\n+ Run at the start of each test suite.\n+ Generic filter Prerequistites\n+ \"\"\"\n+ self.verify(\n+ self.nic in [\"ICE_25G-E810C_SFP\", \"ICE_100G-E810C_QSFP\"],\n+ \"%s nic not support vf timestamp\" % self.nic,\n+ )\n+ self.dut_ports = self.dut.get_ports(self.nic)\n+ self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])\n+ # Verify that enough ports are available\n+ self.verify(len(self.dut_ports) >= 1, \"Insufficient ports\")\n+ self.tester_port0 = self.tester.get_local_port(self.dut_ports[0])\n+ self.tester_iface0 = self.tester.get_interface(self.tester_port0)\n+ self.pkt = Packet()\n+ self.pmdout = PmdOutput(self.dut)\n+\n+ self.vf_driver = self.get_suite_cfg()[\"vf_driver\"]\n+ if self.vf_driver is None:\n+ self.vf_driver = \"vfio-pci\"\n+ self.pf0_intf = self.dut.ports_info[self.dut_ports[0]][\"intf\"]\n+ self.create_vf()\n+\n+ self.current_saved_timestamp = \"\"\n+ self.timestamp_records = {}\n+ self.handle_output_methods = {\"check_timestamp\": self.check_timestamp}\n+ self.error_msgs = []\n+\n+ def set_up(self):\n+ \"\"\"\n+ Run before each test case.\n+ \"\"\"\n+ pass\n+\n+ def launch_testpmd(self, line_option=\"\"):\n+ \"\"\"\n+ start testpmd\n+ \"\"\"\n+ # Prepare testpmd EAL and parameters\n+ self.pmdout.start_testpmd(\n+ param=line_option,\n+ eal_param=f\"-a {self.vf0_pci}\",\n+ socket=self.ports_socket,\n+ )\n+ # test link status\n+ res = self.pmdout.wait_link_status_up(\"all\", timeout=15)\n+ self.verify(res is True, \"there have port link is down\")\n+ self.pmdout.execute_cmd(\"set fwd rxonly\")\n+ self.pmdout.execute_cmd(\"set verbose 1\")\n+ self.pmdout.execute_cmd(\"start\")\n+\n+ def create_vf(self):\n+ self.dut.bind_interfaces_linux(\"ice\")\n+ self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], 1)\n+ self.sriov_vfs_port = self.dut.ports_info[self.dut_ports[0]][\"vfs_port\"]\n+ self.dut.send_expect(\"ifconfig %s up\" % self.pf0_intf, \"# \")\n+ self.dut.send_expect(\n+ \"ip link set %s vf 0 mac 00:11:22:33:44:55\" % self.pf0_intf, \"#\"\n+ )\n+ self.vf0_pci = self.sriov_vfs_port[0].pci\n+ try:\n+ for port in self.sriov_vfs_port:\n+ port.bind_driver(self.vf_driver)\n+ except Exception as e:\n+ self.destroy_vf()\n+ raise Exception(e)\n+\n+ def destroy_vf(self):\n+ self.dut.send_expect(\"quit\", \"# \", 60)\n+ time.sleep(2)\n+ self.dut.destroy_sriov_vfs_by_port(self.dut_ports[0])\n+\n+ def check_timestamp(self, out, key=\"\", port_id=0):\n+ timestamps = self.get_timestamp(out, port_id)\n+ if len(timestamps) == 0:\n+ self.logger.info(\"There is no timestamp value\")\n+ return\n+ if len(key) == 0:\n+ for item in timestamps:\n+ if item <= self.current_saved_timestamp:\n+ error_msg = (\n+ \"timestamp value {} should be larger \"\n+ \"than current saved timestamp {}\".format(\n+ item, self.current_saved_timestamp\n+ )\n+ )\n+ self.logger.error(error_msg)\n+ self.error_msgs.append(error_msg)\n+ else:\n+ self.timestamp_records[key] = timestamps\n+ for item in timestamps:\n+ if item == self.timestamp_records[key]:\n+ error_msg = (\n+ \"timestamp value {} should be increment \"\n+ \"with {} {}\".format(item, key, self.timestamp_records[key])\n+ )\n+ self.logger.error(error_msg)\n+ self.error_msgs.append(error_msg)\n+\n+ def get_timestamp(self, out, port_id=0):\n+ timestamp_pattern = re.compile(\".*timestamp\\s(\\w+)\")\n+ timestamp_infos = timestamp_pattern.findall(out)\n+ self.logger.info(\"timestamp_infos: {}\".format(timestamp_infos))\n+ return timestamp_infos\n+\n+ def send_pkt_get_output(self, pkts, port_id=0, count=3):\n+ self.logger.info(\"----------send packet-------------\")\n+ self.logger.info(\"{}\".format(pkts))\n+ self.pkt.update_pkt(pkts)\n+ self.pkt.send_pkt(crb=self.tester, tx_port=self.tester_iface0, count=count)\n+ out = self.pmdout.get_output(timeout=1)\n+ pkt_pattern = (\n+ \"port\\s%d/queue\\s\\d+:\\sreceived\\s(\\d+)\\spackets.+?\\n.*length=\\d{2,}\\s\"\n+ % port_id\n+ )\n+ reveived_data = re.findall(pkt_pattern, out)\n+ reveived_pkts = sum(map(int, [i[0] for i in reveived_data]))\n+ return out\n+\n+ def send_pkt_get_timestamp(self, pkts, port_id=0, count=3):\n+ output = self.send_pkt_get_output(pkts, port_id, count)\n+ timestamps = self.get_timestamp(output, port_id)\n+ return timestamps\n+\n+ def handle_actions(self, output, actions, port_id=0):\n+ actions = [actions]\n+ for action in actions: # [{}]\n+ self.logger.info(\"action: {}\\n\".format(action))\n+ for method in action: # {'save': ''}\n+ if method in self.handle_output_methods:\n+ self.handle_output_methods[method](\n+ output, action[method], port_id=port_id\n+ )\n+\n+ def handle_tests(self, tests, port_id=0):\n+ out = \"\"\n+ for test in tests:\n+ if \"send_packet\" in test:\n+ out = self.send_pkt_get_output(test[\"send_packet\"], port_id)\n+ if \"action\" in test:\n+ self.handle_actions(out, test[\"action\"])\n+\n+ def handle_timestamp_case(self, case_info):\n+ # clear timestamp_records before each case\n+ self.timestamp_records = {}\n+ self.error_msgs = []\n+ self.current_saved_timestamp = \"\"\n+ port_id = case_info.get(\"port_id\") if case_info.get(\"port_id\") else 0\n+ # handle tests\n+ tests = case_info[\"test\"]\n+ self.logger.info(\"------------handle test--------------\")\n+ self.handle_tests(tests, port_id)\n+ if self.error_msgs:\n+ self.verify(False, str(self.error_msgs[:500]))\n+\n+ def test_iavf_without_timestamp(self):\n+ self.launch_testpmd(line_option=\"--rxq=16 --txq=16\")\n+ self.handle_timestamp_case(command_line_option_with_timestamp)\n+\n+ def test_iavf_single_queue_with_timestamp(self):\n+ self.launch_testpmd(line_option=\"--enable-rx-timestamp\")\n+ self.handle_timestamp_case(command_line_option_with_timestamp)\n+\n+ def test_iavf_multi_queues_with_timestamp(self):\n+ self.launch_testpmd(line_option=\"--rxq=16 --txq=16 --enable-rx-timestamp\")\n+ self.handle_timestamp_case(command_line_option_with_timestamp)\n+\n+ def tear_down(self):\n+ \"\"\"\n+ Run after each test case.\n+ \"\"\"\n+ self.pmdout.execute_cmd(\"quit\", \"#\")\n+\n+ def tear_down_all(self):\n+ \"\"\"\n+ Run after each test suite.\n+ \"\"\"\n+ self.destroy_vf()\n+ self.dut.kill_all()\n", "prefixes": [ "V3", "3/3" ] }{ "id": 114333, "url": "