Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/104504/?format=api
https://patches.dpdk.org/api/patches/104504/?format=api", "web_url": "https://patches.dpdk.org/project/dts/patch/1637219866-13785-4-git-send-email-yux.jiang@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": "<1637219866-13785-4-git-send-email-yux.jiang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/1637219866-13785-4-git-send-email-yux.jiang@intel.com", "date": "2021-11-18T07:17:46", "name": "[V3,3/3] tests/generic_flow_api: add case test_fdir_for_match_report", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "97e6e574fb03e13dabf63e72b23a7e81b37d5f6d", "submitter": { "id": 1709, "url": "https://patches.dpdk.org/api/people/1709/?format=api", "name": "Yu Jiang", "email": "yux.jiang@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dts/patch/1637219866-13785-4-git-send-email-yux.jiang@intel.com/mbox/", "series": [ { "id": 20639, "url": "https://patches.dpdk.org/api/series/20639/?format=api", "web_url": "https://patches.dpdk.org/project/dts/list/?series=20639", "date": "2021-11-18T07:17:43", "name": "[V3,1/3] test_plans/fdir: move case:fdir for Control levels of FDir match reporting to generic_flow_api", "version": 3, "mbox": "https://patches.dpdk.org/series/20639/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/104504/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/104504/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 79D28A0C41;\n\tThu, 18 Nov 2021 08:18:17 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 704664114F;\n\tThu, 18 Nov 2021 08:18:17 +0100 (CET)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 243B441143\n for <dts@dpdk.org>; Thu, 18 Nov 2021 08:18:14 +0100 (CET)", "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 17 Nov 2021 23:18:14 -0800", "from unknown (HELO localhost.localdomain) ([10.240.183.163])\n by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA;\n 17 Nov 2021 23:18:12 -0800" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10171\"; a=\"320346624\"", "E=Sophos;i=\"5.87,243,1631602800\"; d=\"scan'208\";a=\"320346624\"", "E=Sophos;i=\"5.87,243,1631602800\"; d=\"scan'208\";a=\"495260395\"" ], "From": "Yu Jiang <yux.jiang@intel.com>", "To": "yuan.peng@intel.com,\n\tdts@dpdk.org", "Cc": "Yu Jiang <yux.jiang@intel.com>", "Subject": "[dts][PATCH V3 3/3] tests/generic_flow_api: add case\n test_fdir_for_match_report", "Date": "Thu, 18 Nov 2021 15:17:46 +0800", "Message-Id": "<1637219866-13785-4-git-send-email-yux.jiang@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1637219866-13785-1-git-send-email-yux.jiang@intel.com>", "References": "<1637219866-13785-1-git-send-email-yux.jiang@intel.com>", "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": "add case test_fdir_for_match_report\n\nSigned-off-by: Yu Jiang <yux.jiang@intel.com>\n---\n tests/TestSuite_generic_flow_api.py | 113 +++++++++++++++++++++++++++++++++++-\n 1 file changed, 111 insertions(+), 2 deletions(-)", "diff": "diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py\nindex e6b04ab..269b6c8 100644\n--- a/tests/TestSuite_generic_flow_api.py\n+++ b/tests/TestSuite_generic_flow_api.py\n@@ -54,6 +54,7 @@ from framework.project_dpdk import DPDKdut\n from framework.settings import DRIVERS, HEADER_SIZE\n from framework.test_case import TestCase\n from framework.virt_dut import VirtDut\n+from framework.test_case import check_supported_nic\n \n MAX_VLAN = 4095\n MAX_QUEUE = 15\n@@ -158,9 +159,10 @@ class TestGeneric_flow_api(TestCase):\n \"\"\"\n return 1024 * queue_num + 512\n \n- def verify_result(self, pf_vf, expect_rxpkts, expect_queue, verify_mac):\n+ def verify_result(self, pf_vf, expect_rxpkts, expect_queue, verify_mac, check_fdir=''):\n \"\"\"\n verify the packet to the expected queue or be dropped\n+ : check_fdir=[exist|non-exist]\n \"\"\"\n # self.tester.scapy_execute()\n # time.sleep(2)\n@@ -217,12 +219,39 @@ class TestGeneric_flow_api(TestCase):\n queue_index = len(m) - 1\n curr_queue = int(m[queue_index][len(\"port 0/queue\"):])\n self.verify(int(expect_queue) == curr_queue, \"the actual queue doesn't equal to the expected queue.\")\n-\n+ if check_fdir == 'exist':\n+ self.verify(\"RTE_MBUF_F_RX_FDIR\" in out_pf, 'FDIR information should be printed.')\n+ elif check_fdir == 'non-exist':\n+ self.verify(\"FDIR\" not in out_pf, 'FDIR information should not be printed.')\n self.dut.send_expect(\"start\", \"testpmd> \")\n \n if self.vf_flag == 1:\n self.session_secondary.send_expect(\"start\", \"testpmd> \")\n self.session_third.send_expect(\"start\", \"testpmd> \")\n+ return out_pf\n+\n+ def launch_start_testpmd(self, queue='', pkt_filter_mode='', report_hash='', disable_rss=False, fwd='', verbose=''):\n+ \"\"\"\n+ Launch and start testpmd\n+ \"\"\"\n+ param = ''\n+ eal_param = ''\n+ if queue:\n+ param += '--rxq={} --txq={} '.format(queue, queue)\n+ if pkt_filter_mode:\n+ param += '--pkt-filter-mode={} '.format(pkt_filter_mode)\n+ if disable_rss:\n+ param += '--disable-rss '\n+ if report_hash:\n+ param += '--pkt-filter-report-hash={} '.format(report_hash)\n+ self.pmdout.start_testpmd(\"{}\".format(self.cores), param=param, eal_param=eal_param)\n+ if fwd:\n+ self.pmdout.execute_cmd('set fwd rxonly', )\n+ if verbose:\n+ self.pmdout.execute_cmd('set verbose 1')\n+ self.pmdout.execute_cmd('start')\n+ self.pmdout.execute_cmd('show port info all')\n+ self.pmdout.wait_link_status_up(self.dut_ports[0])\n \n def compare_memory_rules(self, expectedRules):\n \"\"\"\n@@ -2664,6 +2693,86 @@ class TestGeneric_flow_api(TestCase):\n else:\n self.verify(False, \"%s not support this test\" % self.nic)\n \n+ @check_supported_nic([\"niantic\"])\n+ def test_fdir_for_match_report(self):\n+ \"\"\"\n+ Test case: IXGBE fdir for Control levels of FDir match reporting\n+ only supported by ixgbe\n+ \"\"\"\n+ fdir_scanner = re.compile(\"FDIR matched hash=(0x\\w+) ID=(0x\\w+)\")\n+ pkt0 = 'Ether(dst=\"{}\")/IP(src=\"192.168.0.1\", dst=\"192.168.0.2\")/Raw(\"x\" * 20)'.format(self.pf_mac)\n+ pkt1 = 'Ether(dst=\"{}\")/IP(src=\"192.168.1.1\", dst=\"192.168.1.2\")/Raw(\"x\" * 20)'.format(self.pf_mac)\n+ rule0 = \"flow create 0 ingress pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 / end actions queue index 1 / mark id 1 / end\"\n+ rule1 = \"flow create 0 ingress pattern eth / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions queue index 2 / mark id 2 / end\"\n+\n+ self.logger.info(\"Sub-case1: ``--pkt-filter-report-hash=none`` mode\")\n+ pkt_filter_report_hash = \"none\"\n+ self.launch_start_testpmd(queue=MAX_QUEUE + 1, pkt_filter_mode='perfect', report_hash=pkt_filter_report_hash,\n+ disable_rss=True, fwd='rxonly', verbose='1')\n+\n+ # Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed\n+ self.sendpkt(pktstr=pkt0)\n+ self.verify_result(\"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.pf_mac, check_fdir=\"non-exist\")\n+\n+ # Add flow filter rule, and send the matched packet again.\n+ # No FDir information is printed, but it can be seen that the packet went to queue 1\n+ self.pmdout.execute_cmd(rule0)\n+ self.sendpkt(pktstr=pkt0)\n+ self.verify_result(\"pf\", expect_rxpkts=\"1\", expect_queue=\"1\", verify_mac=self.pf_mac, check_fdir=\"non-exist\")\n+ self.pmdout.quit()\n+\n+ self.logger.info(\"Sub-case2: ``--pkt-filter-report-hash=match`` mode\")\n+ pkt_filter_report_hash = \"match\"\n+ self.launch_start_testpmd(queue=MAX_QUEUE + 1, pkt_filter_mode='perfect', report_hash=pkt_filter_report_hash,\n+ disable_rss=True, fwd='rxonly', verbose='1')\n+\n+ # Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed\n+ self.sendpkt(pktstr=pkt0)\n+ self.verify_result(\"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.pf_mac, check_fdir=\"non-exist\")\n+\n+ # Add flow filter rule, and send the matched packet again.\n+ # the match is indicated (``RTE_MBUF_F_FDIR``), and its details (hash, id) printed\n+ self.pmdout.execute_cmd(rule0)\n+ self.sendpkt(pktstr=pkt0)\n+ self.verify_result(\"pf\", expect_rxpkts=\"1\", expect_queue=\"1\", verify_mac=self.pf_mac, check_fdir=\"exist\")\n+\n+ # Add flow filter rule by using different scr,dst, and send the matched pkt1 packet again.\n+ # the match is indicated (``RTE_MBUF_F_FDIR``), and its details (hash, id) printed\n+ self.pmdout.execute_cmd(rule1)\n+ self.sendpkt(pktstr=pkt1)\n+ self.verify_result(\"pf\", expect_rxpkts=\"1\", expect_queue=\"2\", verify_mac=self.pf_mac, check_fdir=\"exist\")\n+\n+ # Remove rule1 and send the matched pkt0 packet again. Check that no FDir information is printed\n+ self.pmdout.execute_cmd('flow destroy 0 rule 0')\n+ self.sendpkt(pktstr=pkt0)\n+ self.verify_result(\"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.pf_mac, check_fdir=\"non-exist\")\n+\n+ # Remove rule2, and send the match pkt1 packet again. Check that no FDir information is printed\n+ self.pmdout.execute_cmd('flow destroy 0 rule 1')\n+ self.sendpkt(pktstr=pkt1)\n+ self.verify_result(\"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.pf_mac, check_fdir=\"non-exist\")\n+ self.pmdout.quit()\n+\n+ self.logger.info(\"Sub-case3: ``--pkt-filter-report-hash=always`` mode\")\n+ pkt_filter_report_hash = \"always\"\n+ self.launch_start_testpmd(queue=MAX_QUEUE + 1, pkt_filter_mode='perfect', report_hash=pkt_filter_report_hash,\n+ disable_rss=True, fwd='rxonly', verbose='1')\n+\n+ # Send matched pkt0 packet with Scapy on the traffic generator and check the output (FDIR id=0x0)\n+ self.sendpkt(pktstr=pkt0)\n+ out1 = self.verify_result(\"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.pf_mac, check_fdir=\"exist\")\n+\n+ # Add flow filter rule, and send the matched pkt0 packet again.\n+ # the filter ID is different, and the packet goes to queue 1Add flow filter rule, and send the matched packet again.\n+ self.pmdout.execute_cmd(rule0)\n+ self.sendpkt(pktstr=pkt0)\n+ out2 = self.verify_result(\"pf\", expect_rxpkts=\"1\", expect_queue=\"1\", verify_mac=self.pf_mac, check_fdir=\"exist\")\n+\n+ # check fdir id is different\n+ self.logger.info(\"FDIR ID1=\" + fdir_scanner.search(out1).group(0) + \"; FDIR ID2=\" + fdir_scanner.search(out2).group(0))\n+ self.verify(fdir_scanner.search(out1).group(0) != fdir_scanner.search(out2).group(0),\n+ 'Sub-case3.3: FDIR ID should be different')\n+\n def tear_down(self):\n \"\"\"\n Run after each test case.\n", "prefixes": [ "V3", "3/3" ] }{ "id": 104504, "url": "