From patchwork Wed Oct 14 21:02:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Owen Hilyard X-Patchwork-Id: 80803 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9615EA04DB; Wed, 14 Oct 2020 23:02:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 85DAC1D631; Wed, 14 Oct 2020 23:02:48 +0200 (CEST) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) by dpdk.org (Postfix) with ESMTP id ABFC01BFE6 for ; Wed, 14 Oct 2020 23:02:46 +0200 (CEST) Received: by mail-qt1-f176.google.com with SMTP id h19so338591qtq.4 for ; Wed, 14 Oct 2020 14:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ewdmdbqSQJ7IzeLk7rlDtQziiH0TygP3M34fykRSA80=; b=UjjBrq2x3mDp2qxjB8fYwVXtjDiNjnctjTEokC6HwHfUtbelXFqJdZLxFB8MuHyS82 ZhCC7+zUFe2qUWSnh56h0JGY/viyR8Xjx7OD+Ahkctz4jrS8vCU2gj04h/3FQ+NAXpYl hZuws7QIzCyUR2WYArGVbeNorrDG31hHeDX8w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ewdmdbqSQJ7IzeLk7rlDtQziiH0TygP3M34fykRSA80=; b=gzoTBceq+SvsPKhZpAScwYcK2zFNEMxEl2nz/1UB1Iv366w7cVyJlBFRc5mSLFq1/A 36wfw7Sh6eUSbg3TfxnQQRemTSQfc9ZHMLcaigNUgIdQ3Gmq3CXjiyPGGcnUlwZ2d4id zbtwg+JNzlFaVACZ1USh3A3ESu8fTSkgZHZmE7v8FIHyej8KnOp9165jFYaRODKasC8X +mtNeiOLIabQx1vj+1sO3/7gMOoHwJwGXi0qR9vN6iR1E9VPRlopL27qhnNvoiQD+cwV R+KexYKjlAB7vQG3YyWDJ7naljlXMh7VJWNLjQpw0+c+M3H2gvn2MaHMgK6CNfmn0bLF wadw== X-Gm-Message-State: AOAM5312mLzLNyNQyayrDlNaDsA3K0B4ojxxqL3LGTrnFe+7MJI74WF1 Y3zUjj/ZKV4mp5A3PLk56zf+sUtDdCpjB5GGloEdUcVZhuyl6vje3BBgMgLaJMpLKTI+CPkxAzF 23/TpRvtt/Wmpars9NHGiOJNS3XsHCrw4gsTCyij7Pb28Y10HjS99T9Z1mw== X-Google-Smtp-Source: ABdhPJxOlWrLR0ZYuGLi94Coms1SCyYvvFddvP0eFGi1moApz3+lurs22GqCP5BZPX0595XXPxlb7w== X-Received: by 2002:ac8:c04:: with SMTP id k4mr1172906qti.66.1602709364674; Wed, 14 Oct 2020 14:02:44 -0700 (PDT) Received: from ohilyard-Alienware-m17.unh.edu (nt-238-90.w4.unh.edu. [132.177.238.90]) by smtp.googlemail.com with ESMTPSA id n2sm323375qtr.6.2020.10.14.14.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 14:02:44 -0700 (PDT) From: Owen Hilyard To: dts@dpdk.org, lihongx.ma@intel.com Cc: ohilyard@iol.unh.edu, lylavoie@iol.unh.edu, zhaoyan.chen@intel.com, yuan.peng@intel.com, lijuan.tu@intel.com, shall@iol.unh.edu Date: Wed, 14 Oct 2020 17:02:24 -0400 Message-Id: <20201014210225.16759-1-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201014205051.16205-1-ohilyard@iol.unh.edu> References: <20201014205051.16205-1-ohilyard@iol.unh.edu> MIME-Version: 1.0 Subject: [dts] [PATCH] rte flow: fixing checkpatch issues X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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" Apparently my linter didn't catch these issues. Signed-off-by: Owen Hilyard --- framework/flow/flow_action_items.py | 6 +-- framework/flow/flow_pattern_items.py | 58 ++++++++++++++-------------- tests/TestSuite_rte_flow.py | 8 ++-- 3 files changed, 35 insertions(+), 37 deletions(-) diff --git a/framework/flow/flow_action_items.py b/framework/flow/flow_action_items.py index 50201ee2..d856cd1d 100644 --- a/framework/flow/flow_action_items.py +++ b/framework/flow/flow_action_items.py @@ -72,7 +72,7 @@ class ActionFlowItem(FlowItem): class FlowActionVoid(ActionFlowItem): type = FlowActionType.VOID - + test_case = { 'test': ('ingress pattern eth / ipv4 src is 192.168.0.1 / udp / end actions void / end', frozenset({"Ether() / IP(src=\"192.168.0.1\") / UDP() / ('\\x00' * 64)"}), @@ -549,7 +549,7 @@ class FlowActionNvgre_encap(ActionFlowItem): # NVGRE PACKETS NOT SUPPORTED BY SCAPY. ''' test_case = { - 'test': ('ingress pattern eth / ipv4 src is 192.168.0.1 + 'test': ('ingress pattern eth / ipv4 src is 192.168.0.1 / udp / end actions nvgre_encap definition 0x112233 / end', frozenset({"Ether() / IP(src=\"192.168.0.1\") / UDP() / NVGRE() / ('\\x00' * 64)"}), frozenset({"Ether() / IP(src=\"192.168.0.2\") / UDP() / NVGRE() / ('\\x00' * 64)", @@ -900,7 +900,7 @@ class FlowActionSet_meta(ActionFlowItem): class FlowActionSet_ipv4_dscp(ActionFlowItem): type = FlowActionType.SET_IPV4_DSCP - + test_case = { 'test': ('ingress pattern eth / ipv4 src is 192.168.0.1 ' '/ udp / end actions set_ipv4_dscp dscp 2 / end', diff --git a/framework/flow/flow_pattern_items.py b/framework/flow/flow_pattern_items.py index 77e2de0d..25823cc8 100644 --- a/framework/flow/flow_pattern_items.py +++ b/framework/flow/flow_pattern_items.py @@ -93,7 +93,7 @@ class FlowItemArp_eth_ipv4(PatternFlowItem): valid_parent_items: List[FlowItemType] = [FlowItemType.IPV4] """ - ``hdr``: hardware type, normally 1. => hwtype - - ``pro``: protocol type, normally 0x0800. => ptype = 2048 + - ``pro``: protocol type, normally 0x0800. => ptype = 2048 - ``hln``: hardware address length, normally 6. => hwlen - ``pln``: protocol address length, normally 4. => plen - ``op``: opcode (1 for request, 2 for reply). => op @@ -276,7 +276,6 @@ class FlowItemIcmp(PatternFlowItem): This definition includes: icmp_type (8 bits; for IPv4 echo request it's "8") icmp_code (8 bits) - THE FOLLOWING ARE NOT SUPPORTED IN TESTPMD: icmp_cksum (16 bits) icmp_ident (16 bits) @@ -384,7 +383,7 @@ class FlowItemIpv4(PatternFlowItem): valid_parent_items: List[FlowItemType] = [FlowItemType.ETH, FlowItemType.GRE] """ Note: IPv4 options are handled by dedicated pattern items. - + - ``hdr``: IPv4 header definition (``rte_ip.h``). - Default ``mask`` matches source and destination addresses only. """ @@ -458,7 +457,7 @@ class FlowItemIpv6(PatternFlowItem): """ Note: IPv6 options are handled by dedicated pattern items, see `Item: IPV6_EXT`_. - + - ``hdr``: IPv6 header definition (``rte_ip.h``). - Default ``mask`` matches source and destination addresses only. """ @@ -547,9 +546,9 @@ class FlowItemSctp(PatternFlowItem): valid_next_items = list(ALWAYS_ALLOWED_ITEMS) valid_parent_items: List[FlowItemType] = [FlowItemType.IPV4, FlowItemType.IPV6] """ - + **chunks? - + - ``hdr``: SCTP header definition (``rte_sctp.h``). - Default ``mask`` matches source and destination ports only. """ @@ -603,26 +602,26 @@ class FlowItemTcp(PatternFlowItem): """ - ``hdr``: TCP header definition (``rte_tcp.h``). - Default ``mask`` matches source and destination ports only. - + #define RTE_TCP_CWR_FLAG 0x80 - + #define RTE_TCP_ECE_FLAG 0x40 - + #define RTE_TCP_URG_FLAG 0x20 - + #define RTE_TCP_ACK_FLAG 0x10 - + #define RTE_TCP_PSH_FLAG 0x08 - + #define RTE_TCP_RST_FLAG 0x04 - + #define RTE_TCP_SYN_FLAG 0x02 - + #define RTE_TCP_FIN_FLAG 0x01 - - Can we set multiple flags at once in testing (ex. SYN, ACK)? + + Can we set multiple flags at once in testing (ex. SYN, ACK)? Probably, and we can definitely test them if necessary. - + """ possible_properties = { # THE FOLLOWING PROPERTIES ARE UNSUPPORTED BY TESTPMD AT THE TIME OF WRITING. @@ -752,20 +751,19 @@ class FlowItemVlan(PatternFlowItem): preceding pattern item. If a ``VLAN`` item is present in the pattern, then only tagged packets will match the pattern. - + - ``tci``: tag control information. - ``inner_type``: inner EtherType or TPID. - Default ``mask`` matches the VID part of TCI only (lower 12 bits). - + tci in testpmd = pcp, dei, and vid, altogether. - + pcp in testpmd = prio in scapy - dei in testpmd = id in scapy? + dei in testpmd = id in scapy? vid in testpmd = vlan in scapy - + tpid in testpmd = type in scapy - - + """ possible_properties = { @@ -827,8 +825,8 @@ class FlowItemVxlan(PatternFlowItem): - ``vni``: VXLAN network identifier. - ``rsvd1``: reserved, normally 0x00. - Default ``mask`` matches VNI only. - - TESTPMD ONLY SUPPORTS VNI. + + TESTPMD ONLY SUPPORTS VNI. """ @@ -886,7 +884,7 @@ class FlowItemVxlan_gpe(PatternFlowItem): - ``vni``: VXLAN network identifier. - ``rsvd1``: reserved, normally 0x00. - Default ``mask`` matches VNI only. - + NOT CURRENTLY SUPPORTED BY TESTPMD. """ @@ -979,7 +977,7 @@ class FlowItemMeta(PatternFlowItem): type = FlowItemType.META """ Matches an application specific 32 bit metadata item. - + - Default ``mask`` matches the specified metadata value. """ @@ -989,9 +987,9 @@ class FlowItemTag(PatternFlowItem): """ Matches tag item set by other flows. Multiple tags are supported by specifying ``index``. - + - Default ``mask`` matches the specified tag value and index. - + +----------+----------+----------------------------------------+ | Field | Subfield | Value | +==========+===========+=======================================+ diff --git a/tests/TestSuite_rte_flow.py b/tests/TestSuite_rte_flow.py index 56277a18..0464a2df 100644 --- a/tests/TestSuite_rte_flow.py +++ b/tests/TestSuite_rte_flow.py @@ -97,7 +97,7 @@ class RteFlow(TestCase): for packet in packets: output = self.send_scapy_packet(0, packet) time.sleep(5) # Allow the packet to be processed - self.verify("Sent" in output, "Broken scapy packet definiton: " + packet) + self.verify("Sent" in output, "Broken scapy packet definition: " + packet) output = self.pmdout.get_output() self.verify(pass_fail_function(output), error_message + "\r\n" + output) @@ -151,8 +151,8 @@ class RteFlow(TestCase): """ Edge Cases - - These are tests which are designed to deal with edge cases. + + These are tests which are designed to deal with edge cases. """ def test_excessive_voids(self): @@ -185,7 +185,7 @@ class RteFlow(TestCase): """ Action Test Cases - + These are test cases built for testing various actions """