rte flow: fixing checkpatch issues
diff mbox series

Message ID 20201014210225.16759-1-ohilyard@iol.unh.edu
State New
Headers show
Series
  • rte flow: fixing checkpatch issues
Related show

Commit Message

Owen Hilyard Oct. 14, 2020, 9:02 p.m. UTC
Apparently my linter didn't catch these issues.

Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
---
 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(-)

Patch
diff mbox series

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
     """