test suite reviews and discussions
 help / color / mirror / Atom feed
From: Owen Hilyard <ohilyard@iol.unh.edu>
To: ohilyard@iol.unh.edu, dts@dpdk.org, lijuan.tu@intel.com
Cc: shall@iol.unh.edu, lihongx.ma@intel.com, lylavoie@iol.unh.edu,
	zhaoyan.chen@intel.com, yuan.peng@intel.com
Subject: [dts] [PATCH v2 2/7] rte flow: add supporting data structures
Date: Fri, 23 Oct 2020 19:28:57 -0400	[thread overview]
Message-ID: <20201023232903.37387-2-ohilyard@iol.unh.edu> (raw)
In-Reply-To: <20201023232903.37387-1-ohilyard@iol.unh.edu>

This contains the __init__ file for the module, which is empty since the module needs no setup, and the enums and the exceptions for the flow module.

Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
---
 framework/flow/__init__.py   |   0
 framework/flow/enums.py      | 122 +++++++++++++++++++++++++++++++++++
 framework/flow/exceptions.py |  44 +++++++++++++
 3 files changed, 166 insertions(+)
 create mode 100644 framework/flow/__init__.py
 create mode 100644 framework/flow/enums.py
 create mode 100644 framework/flow/exceptions.py

diff --git a/framework/flow/__init__.py b/framework/flow/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/framework/flow/enums.py b/framework/flow/enums.py
new file mode 100644
index 0000000..4e08ac2
--- /dev/null
+++ b/framework/flow/enums.py
@@ -0,0 +1,122 @@
+# BSD LICENSE
+#
+# Copyright(c) 2020 Intel Corporation. All rights reserved.
+# Copyright © 2018[, 2019] The University of New Hampshire. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from enum import Enum
+
+
+class FlowRuleType(Enum):
+    INGRESS = "ingress"
+    EGRESS = "egress"
+    BOTH = ""
+
+
+class FlowItemType(Enum):
+    UDP = "udp"
+    TCP = "tcp"
+    SCTP = "sctp"
+    IPV4 = "ipv4"
+    IPV6 = "ipv6"
+    END = "end"
+    VOID = "void"
+    INVERT = "invert"
+    ANY = "any"
+    RAW = "raw"
+    ETH = "eth"
+    VLAN = "vlan"
+    VXLAN = "vxlan"
+    GRE = "gre"
+    VXLAN_GPE = "vxlan_gpe"
+    ARP_ETH_IPV4 = "arp_eth_ipv4"
+    ICMP = "icmp"
+    ICMP6 = "icmp6"
+    MARK = "mark"
+    META = "meta"
+    TAG = "tag"
+    FUZZY = "fuzzy"
+
+
+class FlowActionType(Enum):
+    # "Simple" actions that don't need parameters
+    VOID = "void"
+    PASSTHRU = "passthru"
+    FLAG = "flag"
+    DROP = "drop"
+    COUNT = "count"
+    MAC_SWAP = "mac_swap"
+    DEC_TTL = "dec_ttl"
+
+    # Actions that do need parameters
+    JUMP = "jump"
+    MARK = "mark"
+    QUEUE = "queue"
+    RSS = "rss"
+    PF = "pf"
+    VF = "vf"
+    PHY_PORT = "phy_port"
+    PORT_ID = "port_id"
+    METER = "meter"
+    SECURITY = "security"
+    OF_SET_MPLS_TTL = "of_set_mpls_ttl"
+    OF_DEC_MPLS_TTL = "of_dec_mpls_ttl"
+    OF_SET_NW_TTL = "of_set_nw_ttl"
+    OF_DEC_NW_TTL = "of_dec_nw_ttl"
+    OF_COPY_TTL_OUT = "of_copy_ttl_out"
+    OF_COPY_TTL_IN = "of_copy_ttl_in"
+    OF_POP_VLAN = "of_pop_vlan"
+    OF_PUSH_VLAN = "of_push_vlan"
+    OF_SET_VLAN_VID = "of_set_vlan_vid"
+    OF_SET_VLAN_PCP = "of_set_vlan_pcp"
+    OF_POP_MPLS = "of_pop_mpls"
+    OF_PUSH_MPLS = "of_push_mpls"
+    VXLAN_ENCAP = "vxlan_encap"
+    VXLAN_DECAP = "vxlan_decap"
+    NVGRE_ENCAP = "nvgre_encap"
+    NVGRE_DECAP = "nvgre_decap"
+    RAW_ENCAP = "raw_encap"
+    RAW_DECAP = "raw_decap"
+    SET_IPV4_SRC = "set_ipv4_src"
+    SET_IPV4_DST = "set_ipv4_dst"
+    SET_IPV6_SRC = "set_ipv6_src"
+    SET_IPV6_DST = "set_ipv6_dst"
+    SET_TP_SRC = "set_tp_src"
+    SET_TP_DST = "set_tp_dst"
+    SET_TTL = "set_ttl"
+    SET_MAC_SRC = "set_mac_src"
+    SET_MAC_DST = "set_mac_dst"
+    INC_TCP_SEQ = "inc_tcp_seq"
+    DEC_TCP_SEQ = "dec_tcp_seq"
+    INC_TCP_ACK = "inc_tcp_ack"
+    DEC_TCP_ACK = "dec_tcp_ack"
+    SET_TAG = "set_tag"
+    SET_META = "set_meta"
+    SET_IPV4_DSCP = "set_ipv4_dscp"
+    SET_IPV6_DSCP = "set_ipv6_dscp"
+    AGE = "age"
diff --git a/framework/flow/exceptions.py b/framework/flow/exceptions.py
new file mode 100644
index 0000000..0cf999e
--- /dev/null
+++ b/framework/flow/exceptions.py
@@ -0,0 +1,44 @@
+# BSD LICENSE
+#
+# Copyright(c) 2020 Intel Corporation. All rights reserved.
+# Copyright © 2018[, 2019] The University of New Hampshire. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+class CompositionException(Exception):
+
+    def __init__(self):
+        self.message = "There was an unexpected error in composition"
+
+
+class InvalidFlowItemException(CompositionException):
+    def __init__(self, first_item, second_item, flow=None):
+        if flow is not None:
+            self.message = f'"{first_item}" was not able to accept "{second_item}" as the next item in flow {flow}.'
+        else:
+            self.message = f'"{first_item}" was not able to accept "{second_item}".'
-- 
2.25.1


  reply	other threads:[~2020-10-23 23:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 20:50 [dts] [PATCH] rte flow: added test suite and framework Owen Hilyard
2020-10-14 21:02 ` [dts] [PATCH] rte flow: fixing checkpatch issues Owen Hilyard
2020-10-22  8:53 ` [dts] [PATCH] rte flow: added test suite and framework Tu, Lijuan
2020-10-23 18:18   ` Owen Hilyard
2020-10-23 23:28     ` [dts] [PATCH v2 1/7] rte flow: add test plan and test suite Owen Hilyard
2020-10-23 23:28       ` Owen Hilyard [this message]
2020-10-23 23:28         ` [dts] [PATCH v2 3/7] rte flow: Add base flow type Owen Hilyard
2020-10-23 23:28           ` [dts] [PATCH v2 4/7] rte flow: add more specifc data structures Owen Hilyard
2020-10-23 23:29             ` [dts] [PATCH v2 5/7] rte flow: add action items Owen Hilyard
2020-10-23 23:29               ` [dts] [PATCH v2 6/7] rte flow: add pattern items Owen Hilyard
2020-10-23 23:29                 ` [dts] [PATCH v2 7/7] rte flow: add flow test generator Owen Hilyard
2020-10-23 23:29                   ` [dts] [PATCH v2] " Owen Hilyard
2020-10-23 23:30                     ` Owen Hilyard
2020-10-27  5:07       ` [dts] [PATCH v2 1/7] rte flow: add test plan and test suite Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201023232903.37387-2-ohilyard@iol.unh.edu \
    --to=ohilyard@iol.unh.edu \
    --cc=dts@dpdk.org \
    --cc=lihongx.ma@intel.com \
    --cc=lijuan.tu@intel.com \
    --cc=lylavoie@iol.unh.edu \
    --cc=shall@iol.unh.edu \
    --cc=yuan.peng@intel.com \
    --cc=zhaoyan.chen@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).