DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org, beilei.xing@intel.com, qi.z.zhang@intel.com,
	declan.doherty@intel.com, orika@mellanox.com
Cc: Bernard Iremonger <bernard.iremonger@intel.com>
Subject: [dpdk-dev] [PATCH 1/8] librte_ethdev: add new flow types and action
Date: Wed,  3 Jun 2020 15:20:02 +0100
Message-ID: <1591194009-4086-2-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <1591194009-4086-1-git-send-email-bernard.iremonger@intel.com>

In rte_flow.h:
add RTE_FLOW_ITEM_TYPE_PCTYPE
add RTE_FLOW_ITEM_TYPE_FLOWTYPE
add RTE_FLOW_ACTION_TYPE_MAP
add structs and masks for new flow types

In rte_flow.rst:
add items for pctype and flowtype
add action for map

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/prog_guide/rte_flow.rst | 55 +++++++++++++++++++++++++++
 lib/librte_ethdev/rte_flow.h       | 78 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 133 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index d5dd18c..9b54154 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1362,6 +1362,44 @@ Matches a PFCP Header.
 - ``seid``: session endpoint identifier.
 - Default ``mask`` matches s_field and seid.
 
+Item: ``PCTYPE``
+^^^^^^^^^^^^^^^^
+
+Matches a PCTYPE
+
+.. _table_rte_flow_item_pctype:
+
+.. table:: PCTYPE
+
+   +----------+----------+---------------------------------------+
+   | Field    | Subfield | Value                                 |
+   +==========+==========+=======================================+
+   | ``spec`` | ``data`` | 64 bit pctype value                   |
+   +----------+----------+---------------------------------------+
+   | ``last`` | ``data`` | upper range value                     |
+   +----------+----------+---------------------------------------+
+   | ``mask`` | ``data`` | bit-mask applies to "spec" and "last" |
+   +----------+----------+---------------------------------------+
+
+Item: ``FLOWTYPE``
+^^^^^^^^^^^^^^^^^^
+
+Matches a FLOWTYPE
+
+.. _table_rte_flow_item_flowtype:
+
+.. table:: FLOWTYPE
+
+   +----------+----------+---------------------------------------+
+   | Field    | Subfield | Value                                 |
+   +==========+==========+=======================================+
+   | ``spec`` | ``data`` | 16 bit flowtype value                 |
+   +----------+----------+---------------------------------------+
+   | ``last`` | ``data`` | upper range value                     |
+   +----------+----------+---------------------------------------+
+   | ``mask`` | ``data`` | bit-mask applies to "spec" and "last" |
+   +----------+----------+---------------------------------------+
+
 Actions
 ~~~~~~~
 
@@ -2645,6 +2683,23 @@ timeout passed without any matching on the flow.
    | ``context``  | user input flow context         |
    +--------------+---------------------------------+
 
+Action: ``MAP``
+^^^^^^^^^^^^^^^
+
+Map pctype to flowtype.
+
+.. _table_rte_flow_action_map:
+
+.. table:: MAP
+
+   +--------------+---------------------------------+
+   | Field        | Value                           |
+   +==============+=================================+
+   | ``pctype``   | 64 bit pctype value             |
+   +--------------+---------------------------------+
+   | ``flowtype`` | 16 bit flowtype value           |
+   +--------------+---------------------------------+
+
 Negative types
 ~~~~~~~~~~~~~~
 
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index b0e4199..dcae7b9 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -527,6 +527,20 @@ enum rte_flow_item_type {
 	 */
 	RTE_FLOW_ITEM_TYPE_PFCP,
 
+	/**
+	 * Matches Packet Classification type (PCTYPE).
+	 * See struct rte_flow_item_pctype.
+	 *
+	 */
+	RTE_FLOW_ITEM_TYPE_PCTYPE,
+
+	/**
+	 * Matches flow type.
+	 * See struct rte_flow_item_flowtype.
+	 *
+	 */
+	RTE_FLOW_ITEM_TYPE_FLOWTYPE,
+
 };
 
 /**
@@ -1547,6 +1561,46 @@ static const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask = {
 #endif
 
 /**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_PCTYPE
+ *
+ * Match Packet Classification type (PCTYPE)
+ *
+ */
+struct rte_flow_item_pctype {
+	uint64_t pctype;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_PCTYPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_pctype rte_flow_item_pctype_mask = {
+	.pctype = 0xffffffffffffffff,
+};
+#endif
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_FLOWTYPE
+ *
+ * Match flow type
+ *
+ */
+struct rte_flow_item_flowtype {
+	uint16_t flowtype;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_FLOWTYPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_flowtype rte_flow_item_flowtype_mask = {
+	.flowtype = 0xffff,
+};
+#endif
+
+/**
  * Matching pattern item definition.
  *
  * A pattern is formed by stacking items starting from the lowest protocol
@@ -2099,6 +2153,17 @@ enum rte_flow_action_type {
 	 * see enum RTE_ETH_EVENT_FLOW_AGED
 	 */
 	RTE_FLOW_ACTION_TYPE_AGE,
+
+	/**
+	 * Map Packet Classification type to flow type.
+	 *
+	 * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_PCTYPE,
+	 * and a valid RTE_FLOW_ITEM_FLOWTYPE the PMD should return a
+	 * RTE_FLOW_ERROR_TYPE_ACTION error.
+	 *
+	 * See struct rte_flow_action_map.
+	 */
+	RTE_FLOW_ACTION_TYPE_MAP,
 };
 
 /**
@@ -2660,6 +2725,19 @@ struct rte_flow_action_set_dscp {
 	uint8_t dscp;
 };
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_MAP
+ *
+ * Map a packet classification type to a flow type.
+ */
+struct rte_flow_action_map {
+	uint16_t flowtype;
+	uint64_t pctype;
+};
+
 /* Mbuf dynamic field offset for metadata. */
 extern int32_t rte_flow_dynf_metadata_offs;
 
-- 
2.7.4


  reply	other threads:[~2020-06-03 14:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 14:20 [dpdk-dev] [PATCH 0/8] add flow action map Bernard Iremonger
2020-06-03 14:20 ` Bernard Iremonger [this message]
2020-06-03 14:20 ` [dpdk-dev] [PATCH 2/8] librte_ethdev: add map filter type Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 3/8] librte_ethdev: add map action Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 4/8] app/testpmd: parse map actions Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 5/8] net/i40e: add map filter Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 6/8] net/i40e: add map functions Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 7/8] net/i40e: parse map pattern and action Bernard Iremonger
2020-06-03 14:20 ` [dpdk-dev] [PATCH 8/8] doc: release note Bernard Iremonger
2020-06-04  6:05 ` [dpdk-dev] [PATCH 0/8] add flow action map Ori Kam
2020-06-04 11:21   ` Iremonger, Bernard
2020-06-04 13:12     ` Thomas Monjalon

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=1591194009-4086-2-git-send-email-bernard.iremonger@intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=orika@mellanox.com \
    --cc=qi.z.zhang@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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git