From patchwork Mon Oct 25 06:24:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 102731 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 59A4CA0C47; Mon, 25 Oct 2021 08:25:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51771410DA; Mon, 25 Oct 2021 08:25:24 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id AC2394003E for ; Mon, 25 Oct 2021 08:25:22 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10147"; a="210356974" X-IronPort-AV: E=Sophos;i="5.87,179,1631602800"; d="scan'208";a="210356974" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2021 23:25:21 -0700 X-IronPort-AV: E=Sophos;i="5.87,179,1631602800"; d="scan'208";a="485535151" Received: from unknown (HELO localhost.localdomain) ([10.240.183.163]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Oct 2021 23:25:19 -0700 From: Yu Jiang To: dts@dpdk.org, yuan.peng@intel.com Cc: Yu Jiang Date: Mon, 25 Oct 2021 14:24:50 +0800 Message-Id: <1635143092-11970-2-git-send-email-yux.jiang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635143092-11970-1-git-send-email-yux.jiang@intel.com> References: <1635143092-11970-1-git-send-email-yux.jiang@intel.com> Subject: [dts] [PATCH V1 1/3] test_plans/fdir: move case: fdir for Control levels of FDir match reporting to generic_flow_api 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" move plan for case: Control levels of FDir match reporting Signed-off-by: Yu Jiang --- test_plans/fdir_test_plan.rst | 134 ------------------------------------------ 1 file changed, 134 deletions(-) diff --git a/test_plans/fdir_test_plan.rst b/test_plans/fdir_test_plan.rst index dee03c3..72ac320 100644 --- a/test_plans/fdir_test_plan.rst +++ b/test_plans/fdir_test_plan.rst @@ -199,140 +199,6 @@ are free to be used is equal to 8192 (8192 * 32B = 256KB).:: ######################################################################## -Test case: Control levels of FDir match reporting -================================================= - -The status of FDir filter matching for each packet can be reported by the -hardware through the RX descriptor of each received packet, and this information -is copied into the packet mbuf, that can be examined by the application. - -There are three different reporting modes, that can be set in testpmd using the -``--pkt-filter-report-hash`` command line argument: - - -Sub-case: ``--pkt-filter-report-hash=none`` mode ------------------------------------------------- - -In this mode FDir reporting mode, matches are never reported. -Start the ``testpmd`` application as follows:: - - ./testpmd -c 0xf -- -i --portmask=0x1 --nb-cores=2 --rxq=2 --txq=2 - --disable-rss --pkt-filter-mode=perfect --pkt-filter-report-hash=none - testpmd> set verbose 1 - testpmd> set fwd rxonly - testpmd> start - -Send the ``p_udp`` packet with Scapy on the traffic generator and check that no -FDir information is printed:: - - testpmd> port 0/queue 0: received 1 packets - src=00:1B:21:53:1F:14 - dst=00:1B:21:91:3D:2C - type=0x0800 - length=60 - nb_segs=1 - PKT_RX_IP_CKSUM - PKT_RX_IPV4_HDR - -Add a perfect filter to match the ``p_udp`` packet, and send the packet again. -No Dir information is printed, but it can be seen that the packet went to queue -1:: - - testpmd> add_perfect_filter 0 udp src 192.168.0.1 1024 dst 192.168.0.2 1024 - flexbytes 0x800 vlan 0 queue 1 soft 0x14 - testpmd> port 0/queue 1: received 1 packets - src=00:1B:21:53:1F:14 - dst=00:1B:21:91:3D:2C - type=0x0800 - length=60 - nb_segs=1 - PKT_RX_IP_CKSUM - PKT_RX_IPV4_HDR - - -Sub-case: ``--pkt-filter-report-hash=match`` mode -------------------------------------------------- - -In this mode FDir reporting mode, FDir information is printed for packets that -match a filter. -Start the ``testpmd`` application as follows:: - - ./testpmd -c 0xf -- -i --portmask=0x1 --nb-cores=2 --rxq=2 --txq=2 --disable-rss - --pkt-filter-mode=perfect --pkt-filter-report-hash=match - testpmd> set verbose 1 - testpmd> set fwd rxonly - testpmd> start - -Send the ``p_udp`` packet with Scapy on the traffic generator and check that no -FDir information is printed:: - - testpmd> port 0/queue 0: received 1 packets - src=00:1B:21:53:1F:14 - dst=00:1B:21:91:3D:2C - type=0x0800 - length=60 - nb_segs=1 - PKT_RX_IP_CKSUM - PKT_RX_IPV4_HDR - -Add a perfect filter to match the ``p_udp`` packet, and send the packet again. -This time, the match is indicated (``PKT_RX_PKT_RX_FDIR``), and its details -(hash, id) printed :: - - testpmd> add_perfect_filter 0 udp src 192.168.0.1 1024 dst 192.168.0.2 1024 - flexbytes 0x800 vlan 0 queue 1 soft 0x14 - testpmd> port 0/queue 1: received 1 packets - src=00:1B:21:53:1F:14 - dst=00:1B:21:91:3D:2C - type=0x0800 - length=60 - -nb_segs=1 - FDIR hash=0x43c - FDIR id=0x14 - PKT_RX_PKT_RX_FDIR - PKT_RX_IP_CKSUM - PKT_RX_IPV4_HDR - -Update the perfect filter to match the ``p_udp1`` packet, and send the packet again. -This time, the match is indicated (``PKT_RX_PKT_RX_FDIR``), and its details -(hash, id) printed :: - - testpmd> add_perfect_filter 0 udp src 192.168.1.1 1024 dst 192.168.1.2 0 - flexbytes 0x800 vlan 0 queue 1 soft 0x14 - testpmd> port 0/queue 1: received 1 packets - src=00:1B:21:53:1F:14 - dst=00:1B:21:91:3D:2C - type=0x0800 - length=60 - -nb_segs=1 - FDIR hash=0x43c - FDIR id=0x14 - PKT_RX_PKT_RX_FDIR - PKT_RX_IP_CKSUM - PKT_RX_IPV4_HDR - -Remove the perfect filter match the ``p_udp1`` and ``p_udp`` packets, and send the packet again. -Check that no FDir information is printed:: - - testpmd> port 0/queue 0: received 1 packets - src=00:1B:21:53:1F:14 - dst=00:1B:21:91:3D:2C - type=0x0800 - length=60 - nb_segs=1 - PKT_RX_IP_CKSUM - PKT_RX_IPV4_HDR - -Sub-case: ``--pkt-filter-report-hash=always`` mode --------------------------------------------------- - -In this mode FDir reporting mode, FDir information is printed for every received -packet. -Start the ``testpmd`` application as follows:: - - ./testpmd -c 0xf -- -i --portmask=0x1 --nb-cores=2 --rxq=2 --txq=2 --disable-rss - --pkt-filter-mode=perfect --pkt-filter-report-hash=always - testpmd> set verbose 1 - testpmd> set fwd rxonly - testpmd> start - -Send the ``p_udp`` packet with Scapy on the traffic generator and check the -output (FDIR id=0x0):: - - testpmd> port 0/queue 0: received 1 packets - src=00:1B:21:53:1F:14 - dst=00:1B:21:91:3D:2C - type=0x0800 - length=60 - - nb_segs=1 - FDIR hash=0x43c - FDIR id=0x0 - PKT_RX_PKT_RX_FDIR - PKT_RX_IP_CKSUM - PKT_RX_IPV4_HDR - -Add a perfect filter to match the ``p_udp`` packet, and send the packet again. -This time, the filter ID is different, and the packet goes to queue 1 :: - - testpmd> add_perfect_filter 0 udp src 192.168.0.1 1024 dst 192.168.0.2 1024 - flexbytes 0x800 vlan 0 queue 1 soft 0x14 - testpmd> port 0/queue 1: received 1 packets - src=00:1B:21:53:1F:14 - dst=00:1B:21:91:3D:2C - type=0x0800 - length=60 - - nb_segs=1 - FDIR hash=0x43c - FDIR id=0x14 - PKT_RX_PKT_RX_FDIR - PKT_RX_IP_CKSUM - PKT_RX_IPV4_HDR - - Test case: FDir signature matching mode ======================================= From patchwork Mon Oct 25 06:24:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 102732 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 7B6BCA0C4B; Mon, 25 Oct 2021 08:25:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7181A410F8; Mon, 25 Oct 2021 08:25:25 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 718834003E for ; Mon, 25 Oct 2021 08:25:23 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10147"; a="210356978" X-IronPort-AV: E=Sophos;i="5.87,179,1631602800"; d="scan'208";a="210356978" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2021 23:25:22 -0700 X-IronPort-AV: E=Sophos;i="5.87,179,1631602800"; d="scan'208";a="485535167" Received: from unknown (HELO localhost.localdomain) ([10.240.183.163]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Oct 2021 23:25:21 -0700 From: Yu Jiang To: dts@dpdk.org, yuan.peng@intel.com Cc: Yu Jiang Date: Mon, 25 Oct 2021 14:24:51 +0800 Message-Id: <1635143092-11970-3-git-send-email-yux.jiang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635143092-11970-1-git-send-email-yux.jiang@intel.com> References: <1635143092-11970-1-git-send-email-yux.jiang@intel.com> Subject: [dts] [PATCH V1 2/3] test_plans/generic_flow_api: add case: fdir for Control levels of FDir match reporting 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" add plan: IXGBE fdir for Control levels of FDir match reporting Signed-off-by: Yu Jiang --- test_plans/generic_flow_api_test_plan.rst | 118 ++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/test_plans/generic_flow_api_test_plan.rst b/test_plans/generic_flow_api_test_plan.rst index c1c3835..cbd41bd 100644 --- a/test_plans/generic_flow_api_test_plan.rst +++ b/test_plans/generic_flow_api_test_plan.rst @@ -1149,6 +1149,124 @@ Test case: IXGBE fdir for mac/vlan(support by x540, x552, x550) testpmd> flow flush 0 testpmd> flow list 0 +Test case: IXGBE fdir for Control levels of FDir match reporting +================================================================ + +The status of FDir filter matching for each packet can be reported by the +hardware through the RX descriptor of each received packet, and this information +is copied into the packet mbuf, that can be examined by the application. + +There are three different reporting modes, that can be set in testpmd using the +``--pkt-filter-report-hash`` command line argument: + + +Sub-case: ``--pkt-filter-report-hash=none`` mode +------------------------------------------------ + +In this mode FDir reporting mode, matches are never reported. +Start the ``testpmd`` application as follows:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect --pkt-filter-report-hash=none + testpmd> set verbose 1 + testpmd> set fwd rxonly + testpmd> start + +Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed:: + + packet: pkt0=Ether(dst="90:E2:BA:AC:99:FC")/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20) + testpmd> port 0/queue 0: received 1 packets + src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 + ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + +Add flow filter rule, and send the matched packet again. +No Dir information is printed, but it can be seen that the packet goes to queue 1:: + + testpmd> 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 + testpmd> port 0/queue 1: received 1 packets + src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x1 + ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + testpmd> quit + +Sub-case: ``--pkt-filter-report-hash=match`` mode +------------------------------------------------- + +In this mode FDir reporting mode, FDir information is printed for packets that match a filter. +Start the ``testpmd`` application as follows:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect --pkt-filter-report-hash=match + testpmd> set verbose 1 + testpmd> set fwd rxonly + testpmd> start + +Send pkt0 packet with Scapy on the traffic generator and check that no FDir information is printed:: + + packet: pkt0=Ether(dst="90:E2:BA:AC:99:FC")/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20) + testpmd> port 0/queue 0: received 1 packets + src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 + ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + +Add flow filter rule, and send the pkt0 packet again. +This time, the match is indicated (``PKT_RX_FDIR``), and its details (hash, id) printed :: + + testpmd> 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 + testpmd> port 0/queue 1: received 1 packets + src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - FDIR matched hash=0x2f3 ID=0x1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x1 + ol_flags: PKT_RX_FDIR PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + +Add flow filter rule by using different src,dst, and send the matched pkt1 packet again. +This time, the match is indicated (``PKT_RX_FDIR``), and its details (hash, id) printed :: + + packet: pkt1=Ether(dst="90:E2:BA:AC:99:FC")/IP(src="192.168.1.1", dst="192.168.1.2")/Raw('x' * 20) + testpmd> 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 + testpmd> port 0/queue 2: received 1 packets + src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=64 - nb_segs=1 - FDIR matched hash=0x2f3 ID=0x2 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x2 + ol_flags: PKT_RX_FDIR PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + +Remove rule1 and send the matched pkt0 packet again. Check that no FDir information is printed:: + + testpmd> flow destroy 0 rule 0 + Flow rule #0 destroyed + testpmd> port 0/queue 0: received 1 packets + src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 + ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + +Remove rule2, and send the match pkt1 packet again. Check that no FDir information is printed:: + + testpmd> flow destroy 0 rule 1 + Flow rule #1 destroyed + testpmd> port 0/queue 0: received 1 packets + src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 + ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + testpmd> quit + +Sub-case: ``--pkt-filter-report-hash=always`` mode +-------------------------------------------------- + +In this mode FDir reporting mode, FDir information is printed for every received packet. +Start the ``testpmd`` application as follows:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect --pkt-filter-report-hash=always + testpmd> set verbose 1 + testpmd> set fwd rxonly + testpmd> start + + +Send matched pkt0 packet with Scapy on the traffic generator and check the output (FDIR id=0x0):: + + packet: pkt0=Ether(dst="90:E2:BA:AC:99:FC")/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20) + testpmd> port 0/queue 0: received 1 packets + src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - FDIR matched hash=0x2f3 ID=0x0 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 + ol_flags: PKT_RX_FDIR PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + +Add flow filter rule, and send the matched pkt0 packet again. +This time, the filter ID is different, and the packet goes to queue 1 :: + + testpmd> 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 + testpmd> port 0/queue 1: received 1 packets + src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - FDIR matched hash=0x2f3 ID=0x1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x1 + ol_flags: PKT_RX_FDIR PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + testpmd> quit + Test case: IXGBE fdir for tunnel (vxlan and nvgre)(support by x540, x552, x550) =============================================================================== From patchwork Mon Oct 25 06:24:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 102733 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 9EF90A0C47; Mon, 25 Oct 2021 08:25:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9916240E3C; Mon, 25 Oct 2021 08:25:27 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id BEA904003E for ; Mon, 25 Oct 2021 08:25:25 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10147"; a="210356981" X-IronPort-AV: E=Sophos;i="5.87,179,1631602800"; d="scan'208";a="210356981" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2021 23:25:24 -0700 X-IronPort-AV: E=Sophos;i="5.87,179,1631602800"; d="scan'208";a="485535185" Received: from unknown (HELO localhost.localdomain) ([10.240.183.163]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Oct 2021 23:25:22 -0700 From: Yu Jiang To: dts@dpdk.org, yuan.peng@intel.com Cc: Yu Jiang Date: Mon, 25 Oct 2021 14:24:52 +0800 Message-Id: <1635143092-11970-4-git-send-email-yux.jiang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635143092-11970-1-git-send-email-yux.jiang@intel.com> References: <1635143092-11970-1-git-send-email-yux.jiang@intel.com> Subject: [dts] [PATCH V1 3/3] tests/generic_flow_api: add case:test_fdir_for_match_report 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" add case test_fdir_for_match_report Signed-off-by: Yu Jiang Tested-by: Yu Jiang Tested-by: Yu Jiang --- conf/test_case_supportlist.json | 15 +++++ tests/TestSuite_generic_flow_api.py | 107 +++++++++++++++++++++++++++++++++++- 2 files changed, 121 insertions(+), 1 deletion(-) diff --git a/conf/test_case_supportlist.json b/conf/test_case_supportlist.json index e3eefd4..4ad90b2 100644 --- a/conf/test_case_supportlist.json +++ b/conf/test_case_supportlist.json @@ -791,6 +791,21 @@ "Comments": "This case only support on twinville, sagepond and sageville" } ], + "fdir_for_match_report": [ + { + "OS": [ + "ALL" + ], + "NIC": [ + "niantic" + ], + "Target": [ + "ALL" + ], + "Bug ID": "", + "Comments": "This case only support on niantic" + } + ], "fdir_for_mac_vlan": [ { "OS": [ diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py index 2890acb..1dda83c 100644 --- a/tests/TestSuite_generic_flow_api.py +++ b/tests/TestSuite_generic_flow_api.py @@ -152,9 +152,10 @@ class TestGeneric_flow_api(TestCase): time.sleep(2) self.vf_flag = 0 - def verify_result(self, pf_vf, expect_rxpkts, expect_queue, verify_mac): + def verify_result(self, pf_vf, expect_rxpkts, expect_queue, verify_mac, check_fdir=''): """ verify the packet to the expected queue or be dropped + : check_fdir=[exist|non-exist] """ # self.tester.scapy_execute() # time.sleep(2) @@ -211,12 +212,40 @@ class TestGeneric_flow_api(TestCase): queue_index = len(m) - 1 curr_queue = int(m[queue_index][len("port 0/queue"):]) self.verify(int(expect_queue) == curr_queue, "the actual queue doesn't equal to the expected queue.") + if check_fdir == 'exist': + self.verify("PKT_RX_FDIR" in out_pf, 'FDIR information should be printed.') + elif check_fdir == 'non-exist': + self.verify("FDIR" not in out_pf, 'FDIR information should not be printed.') self.dut.send_expect("start", "testpmd> ") if self.vf_flag == 1: self.session_secondary.send_expect("start", "testpmd> ") self.session_third.send_expect("start", "testpmd> ") + return out_pf + + def launch_start_testpmd(self, queue='', pkt_filter_mode='', report_hash='', disable_rss=False, fwd='', + verbose=''): + """ + Launch and start testpmd + """ + param = '' + eal_param = '' + if queue: + param += '--rxq={} --txq={} '.format(queue, queue) + if pkt_filter_mode: + param += '--pkt-filter-mode={} '.format(pkt_filter_mode) + if disable_rss: + param += '--disable-rss ' + if report_hash: + param += '--pkt-filter-report-hash={} '.format(report_hash) + self.pmdout.start_testpmd("{}".format(self.cores), param=param, eal_param=eal_param) + if fwd: + self.pmdout.execute_cmd('set fwd rxonly', ) + if verbose: + self.pmdout.execute_cmd('set verbose 1') + self.pmdout.execute_cmd('start') + self.pmdout.execute_cmd('show port info all') def compare_memory_rules(self, expectedRules): """ @@ -720,6 +749,7 @@ class TestGeneric_flow_api(TestCase): self.result_table_add( [i, tmp_reta_line["RSS hash"], hash_index, tmp_reta_line["queue"]]) i = i + 1 + def test_syn_filter(self): """ Only supported by ixgbe and igb. @@ -2636,6 +2666,81 @@ class TestGeneric_flow_api(TestCase): self.tester.send_expect("ifconfig %s mtu %s" % (txItf, 1500), "# ") self.tester.send_expect("ifconfig %s mtu %s" % (rxItf, 1500), "# ") + def test_fdir_for_match_report(self): + """ + Test case: IXGBE fdir for Control levels of FDir match reporting + only supported by ixgbe + """ + fdir_scanner = re.compile("FDIR matched hash=(0x\w+) ID=(0x\w+)") + pkt0 = 'Ether(dst="{}")/IP(src="192.168.0.1", dst="192.168.0.2")/Raw("x" * 20)'.format(self.pf_mac) + pkt1 = 'Ether(dst="{}")/IP(src="192.168.1.1", dst="192.168.1.2")/Raw("x" * 20)'.format(self.pf_mac) + 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" + 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" + + self.logger.info("Sub-case1: ``--pkt-filter-report-hash=none`` mode") + pkt_filter_report_hash = "none" + self.launch_start_testpmd(queue=MAX_QUEUE + 1, pkt_filter_mode='perfect', report_hash=pkt_filter_report_hash, disable_rss=True, fwd='rxonly', verbose='1') + + # Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed + self.sendpkt(pktstr=pkt0) + self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac, check_fdir="non-exist") + + # Add flow filter rule, and send the matched packet again. + # No FDir information is printed, but it can be seen that the packet went to queue 1 + self.pmdout.execute_cmd(rule0) + self.sendpkt(pktstr=pkt0) + self.verify_result("pf", expect_rxpkts="1", expect_queue="1", verify_mac=self.pf_mac, check_fdir="non-exist") + self.pmdout.quit() + + self.logger.info("Sub-case2: ``--pkt-filter-report-hash=match`` mode") + pkt_filter_report_hash = "match" + self.launch_start_testpmd(queue=MAX_QUEUE + 1, pkt_filter_mode='perfect', report_hash=pkt_filter_report_hash, + disable_rss=True, fwd='rxonly', verbose='1') + + # Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed + self.sendpkt(pktstr=pkt0) + self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac, check_fdir="non-exist") + + # Add flow filter rule, and send the matched packet again. + # the match is indicated (``PKT_RX_FDIR``), and its details (hash, id) printed + self.pmdout.execute_cmd(rule0) + self.sendpkt(pktstr=pkt0) + self.verify_result("pf", expect_rxpkts="1", expect_queue="1", verify_mac=self.pf_mac, check_fdir="exist") + + # Add flow filter rule by using different scr,dst, and send the matched pkt1 packet again. + # the match is indicated (``PKT_RX_FDIR``), and its details (hash, id) printed + self.pmdout.execute_cmd(rule1) + self.sendpkt(pktstr=pkt1) + self.verify_result("pf", expect_rxpkts="1", expect_queue="2", verify_mac=self.pf_mac, check_fdir="exist") + + # Remove rule1 and send the matched pkt0 packet again. Check that no FDir information is printed + self.pmdout.execute_cmd('flow destroy 0 rule 0') + self.sendpkt(pktstr=pkt0) + self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac, check_fdir="non-exist") + + # Remove rule2, and send the match pkt1 packet again. Check that no FDir information is printed + self.pmdout.execute_cmd('flow destroy 0 rule 1') + self.sendpkt(pktstr=pkt1) + self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac, check_fdir="non-exist") + self.pmdout.quit() + + self.logger.info("Sub-case3: ``--pkt-filter-report-hash=always`` mode") + pkt_filter_report_hash = "always" + self.launch_start_testpmd(queue=MAX_QUEUE + 1, pkt_filter_mode='perfect', report_hash=pkt_filter_report_hash, disable_rss=True, fwd='rxonly', verbose='1') + + # Send matched pkt0 packet with Scapy on the traffic generator and check the output (FDIR id=0x0) + self.sendpkt(pktstr=pkt0) + out1 = self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac, check_fdir="exist") + + # Add flow filter rule, and send the matched pkt0 packet again. + # the filter ID is different, and the packet goes to queue 1Add flow filter rule, and send the matched packet again. + self.pmdout.execute_cmd(rule0) + self.sendpkt(pktstr=pkt0) + out2 = self.verify_result("pf", expect_rxpkts="1", expect_queue="1", verify_mac=self.pf_mac, check_fdir="exist") + + # check fdir id is different + self.verify(fdir_scanner.search(out1).group(0) != fdir_scanner.search(out2).group(0), 'Sub-case3.3: FDIR ID should be different' ) + def tear_down(self): """ Run after each test case.