From: Suanming Mou <suanmingm@nvidia.com>
To: <thomas@monjalon.net>, <ferruh.yigit@amd.com>,
Ori Kam <orika@nvidia.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Cc: <dev@dpdk.org>
Subject: [PATCH v7 2/4] ethdev: move flow field data structures
Date: Tue, 6 Feb 2024 10:06:23 +0800 [thread overview]
Message-ID: <20240206020626.545946-3-suanmingm@nvidia.com> (raw)
In-Reply-To: <20240206020626.545946-1-suanmingm@nvidia.com>
As flow field relevant data structures will be used by both actions and
items, this commit moves the relevant data structures up to item parts.
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
---
lib/ethdev/rte_flow.h | 290 +++++++++++++++++++++---------------------
1 file changed, 145 insertions(+), 145 deletions(-)
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index eb46cfe09e..958eb01a80 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2365,6 +2365,151 @@ static const struct rte_flow_item_ptype rte_flow_item_ptype_mask = {
};
#endif
+/**
+ * Packet header field IDs, used by RTE_FLOW_ACTION_TYPE_MODIFY_FIELD.
+ */
+enum rte_flow_field_id {
+ RTE_FLOW_FIELD_START = 0, /**< Start of a packet. */
+ RTE_FLOW_FIELD_MAC_DST, /**< Destination MAC Address. */
+ RTE_FLOW_FIELD_MAC_SRC, /**< Source MAC Address. */
+ RTE_FLOW_FIELD_VLAN_TYPE, /**< VLAN Tag Identifier. */
+ RTE_FLOW_FIELD_VLAN_ID, /**< VLAN Identifier. */
+ RTE_FLOW_FIELD_MAC_TYPE, /**< EtherType. */
+ RTE_FLOW_FIELD_IPV4_DSCP, /**< IPv4 DSCP. */
+ RTE_FLOW_FIELD_IPV4_TTL, /**< IPv4 Time To Live. */
+ RTE_FLOW_FIELD_IPV4_SRC, /**< IPv4 Source Address. */
+ RTE_FLOW_FIELD_IPV4_DST, /**< IPv4 Destination Address. */
+ RTE_FLOW_FIELD_IPV6_DSCP, /**< IPv6 DSCP. */
+ RTE_FLOW_FIELD_IPV6_HOPLIMIT, /**< IPv6 Hop Limit. */
+ RTE_FLOW_FIELD_IPV6_SRC, /**< IPv6 Source Address. */
+ RTE_FLOW_FIELD_IPV6_DST, /**< IPv6 Destination Address. */
+ RTE_FLOW_FIELD_TCP_PORT_SRC, /**< TCP Source Port Number. */
+ RTE_FLOW_FIELD_TCP_PORT_DST, /**< TCP Destination Port Number. */
+ RTE_FLOW_FIELD_TCP_SEQ_NUM, /**< TCP Sequence Number. */
+ RTE_FLOW_FIELD_TCP_ACK_NUM, /**< TCP Acknowledgment Number. */
+ RTE_FLOW_FIELD_TCP_FLAGS, /**< TCP Flags. */
+ RTE_FLOW_FIELD_UDP_PORT_SRC, /**< UDP Source Port Number. */
+ RTE_FLOW_FIELD_UDP_PORT_DST, /**< UDP Destination Port Number. */
+ RTE_FLOW_FIELD_VXLAN_VNI, /**< VXLAN Network Identifier. */
+ RTE_FLOW_FIELD_GENEVE_VNI, /**< GENEVE Network Identifier. */
+ RTE_FLOW_FIELD_GTP_TEID, /**< GTP Tunnel Endpoint Identifier. */
+ RTE_FLOW_FIELD_TAG, /**< Tag value. */
+ RTE_FLOW_FIELD_MARK, /**< Mark value. */
+ RTE_FLOW_FIELD_META, /**< Metadata value. */
+ RTE_FLOW_FIELD_POINTER, /**< Memory pointer. */
+ RTE_FLOW_FIELD_VALUE, /**< Immediate value. */
+ RTE_FLOW_FIELD_IPV4_ECN, /**< IPv4 ECN. */
+ RTE_FLOW_FIELD_IPV6_ECN, /**< IPv6 ECN. */
+ RTE_FLOW_FIELD_GTP_PSC_QFI, /**< GTP QFI. */
+ RTE_FLOW_FIELD_METER_COLOR, /**< Meter color marker. */
+ RTE_FLOW_FIELD_IPV6_PROTO, /**< IPv6 next header. */
+ RTE_FLOW_FIELD_FLEX_ITEM, /**< Flex item. */
+ RTE_FLOW_FIELD_HASH_RESULT, /**< Hash result. */
+ RTE_FLOW_FIELD_GENEVE_OPT_TYPE, /**< GENEVE option type. */
+ RTE_FLOW_FIELD_GENEVE_OPT_CLASS,/**< GENEVE option class. */
+ RTE_FLOW_FIELD_GENEVE_OPT_DATA, /**< GENEVE option data. */
+ RTE_FLOW_FIELD_MPLS, /**< MPLS header. */
+ RTE_FLOW_FIELD_TCP_DATA_OFFSET, /**< TCP data offset. */
+ RTE_FLOW_FIELD_IPV4_IHL, /**< IPv4 IHL. */
+ RTE_FLOW_FIELD_IPV4_TOTAL_LEN, /**< IPv4 total length. */
+ RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN,/**< IPv6 payload length. */
+ RTE_FLOW_FIELD_RANDOM /**< Random value. */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * Packet header field descriptions, used by RTE_FLOW_ACTION_TYPE_MODIFY_FIELD.
+ */
+struct rte_flow_field_data {
+ enum rte_flow_field_id field; /**< Field or memory type ID. */
+ union {
+ struct {
+ /** Encapsulation level and tag index or flex item handle. */
+ union {
+ struct {
+ /**
+ * Packet encapsulation level containing
+ * the field to modify.
+ *
+ * - @p 0 requests the default behavior.
+ * Depending on the packet type, it
+ * can mean outermost, innermost or
+ * anything in between.
+ *
+ * It basically stands for the
+ * innermost encapsulation level.
+ * Modification can be performed
+ * according to PMD and device
+ * capabilities.
+ *
+ * - @p 1 requests modification to be
+ * performed on the outermost packet
+ * encapsulation level.
+ *
+ * - @p 2 and subsequent values request
+ * modification to be performed on
+ * the specified inner packet
+ * encapsulation level, from
+ * outermost to innermost (lower to
+ * higher values).
+ *
+ * Values other than @p 0 are not
+ * necessarily supported.
+ *
+ * @note that for MPLS field,
+ * encapsulation level also include
+ * tunnel since MPLS may appear in
+ * outer, inner or tunnel.
+ */
+ uint8_t level;
+ union {
+ /**
+ * Tag index array inside
+ * encapsulation level.
+ * Used for VLAN, MPLS or TAG types.
+ */
+ uint8_t tag_index;
+ /**
+ * Geneve option identifier.
+ * Relevant only for
+ * RTE_FLOW_FIELD_GENEVE_OPT_XXXX
+ * modification type.
+ */
+ struct {
+ /**
+ * Geneve option type.
+ */
+ uint8_t type;
+ /**
+ * Geneve option class.
+ */
+ rte_be16_t class_id;
+ };
+ };
+ };
+ struct rte_flow_item_flex_handle *flex_handle;
+ };
+ /** Number of bits to skip from a field. */
+ uint32_t offset;
+ };
+ /**
+ * Immediate value for RTE_FLOW_FIELD_VALUE, presented in the
+ * same byte order and length as in relevant rte_flow_item_xxx.
+ * The immediate source bitfield offset is inherited from
+ * the destination's one.
+ */
+ uint8_t value[16];
+ /**
+ * Memory address for RTE_FLOW_FIELD_POINTER, memory layout
+ * should be the same as for relevant field in the
+ * rte_flow_item_xxx structure.
+ */
+ void *pvalue;
+ };
+};
+
/**
* Action types.
*
@@ -3892,151 +4037,6 @@ struct rte_flow_action_ethdev {
uint16_t port_id; /**< ethdev port ID */
};
-/**
- * Packet header field IDs, used by RTE_FLOW_ACTION_TYPE_MODIFY_FIELD.
- */
-enum rte_flow_field_id {
- RTE_FLOW_FIELD_START = 0, /**< Start of a packet. */
- RTE_FLOW_FIELD_MAC_DST, /**< Destination MAC Address. */
- RTE_FLOW_FIELD_MAC_SRC, /**< Source MAC Address. */
- RTE_FLOW_FIELD_VLAN_TYPE, /**< VLAN Tag Identifier. */
- RTE_FLOW_FIELD_VLAN_ID, /**< VLAN Identifier. */
- RTE_FLOW_FIELD_MAC_TYPE, /**< EtherType. */
- RTE_FLOW_FIELD_IPV4_DSCP, /**< IPv4 DSCP. */
- RTE_FLOW_FIELD_IPV4_TTL, /**< IPv4 Time To Live. */
- RTE_FLOW_FIELD_IPV4_SRC, /**< IPv4 Source Address. */
- RTE_FLOW_FIELD_IPV4_DST, /**< IPv4 Destination Address. */
- RTE_FLOW_FIELD_IPV6_DSCP, /**< IPv6 DSCP. */
- RTE_FLOW_FIELD_IPV6_HOPLIMIT, /**< IPv6 Hop Limit. */
- RTE_FLOW_FIELD_IPV6_SRC, /**< IPv6 Source Address. */
- RTE_FLOW_FIELD_IPV6_DST, /**< IPv6 Destination Address. */
- RTE_FLOW_FIELD_TCP_PORT_SRC, /**< TCP Source Port Number. */
- RTE_FLOW_FIELD_TCP_PORT_DST, /**< TCP Destination Port Number. */
- RTE_FLOW_FIELD_TCP_SEQ_NUM, /**< TCP Sequence Number. */
- RTE_FLOW_FIELD_TCP_ACK_NUM, /**< TCP Acknowledgment Number. */
- RTE_FLOW_FIELD_TCP_FLAGS, /**< TCP Flags. */
- RTE_FLOW_FIELD_UDP_PORT_SRC, /**< UDP Source Port Number. */
- RTE_FLOW_FIELD_UDP_PORT_DST, /**< UDP Destination Port Number. */
- RTE_FLOW_FIELD_VXLAN_VNI, /**< VXLAN Network Identifier. */
- RTE_FLOW_FIELD_GENEVE_VNI, /**< GENEVE Network Identifier. */
- RTE_FLOW_FIELD_GTP_TEID, /**< GTP Tunnel Endpoint Identifier. */
- RTE_FLOW_FIELD_TAG, /**< Tag value. */
- RTE_FLOW_FIELD_MARK, /**< Mark value. */
- RTE_FLOW_FIELD_META, /**< Metadata value. */
- RTE_FLOW_FIELD_POINTER, /**< Memory pointer. */
- RTE_FLOW_FIELD_VALUE, /**< Immediate value. */
- RTE_FLOW_FIELD_IPV4_ECN, /**< IPv4 ECN. */
- RTE_FLOW_FIELD_IPV6_ECN, /**< IPv6 ECN. */
- RTE_FLOW_FIELD_GTP_PSC_QFI, /**< GTP QFI. */
- RTE_FLOW_FIELD_METER_COLOR, /**< Meter color marker. */
- RTE_FLOW_FIELD_IPV6_PROTO, /**< IPv6 next header. */
- RTE_FLOW_FIELD_FLEX_ITEM, /**< Flex item. */
- RTE_FLOW_FIELD_HASH_RESULT, /**< Hash result. */
- RTE_FLOW_FIELD_GENEVE_OPT_TYPE, /**< GENEVE option type. */
- RTE_FLOW_FIELD_GENEVE_OPT_CLASS,/**< GENEVE option class. */
- RTE_FLOW_FIELD_GENEVE_OPT_DATA, /**< GENEVE option data. */
- RTE_FLOW_FIELD_MPLS, /**< MPLS header. */
- RTE_FLOW_FIELD_TCP_DATA_OFFSET, /**< TCP data offset. */
- RTE_FLOW_FIELD_IPV4_IHL, /**< IPv4 IHL. */
- RTE_FLOW_FIELD_IPV4_TOTAL_LEN, /**< IPv4 total length. */
- RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN,/**< IPv6 payload length. */
- RTE_FLOW_FIELD_RANDOM /**< Random value. */
-};
-
-/**
- * @warning
- * @b EXPERIMENTAL: this structure may change without prior notice
- *
- * Packet header field descriptions, used by RTE_FLOW_ACTION_TYPE_MODIFY_FIELD.
- */
-struct rte_flow_field_data {
- enum rte_flow_field_id field; /**< Field or memory type ID. */
- union {
- struct {
- /** Encapsulation level and tag index or flex item handle. */
- union {
- struct {
- /**
- * Packet encapsulation level containing
- * the field to modify.
- *
- * - @p 0 requests the default behavior.
- * Depending on the packet type, it
- * can mean outermost, innermost or
- * anything in between.
- *
- * It basically stands for the
- * innermost encapsulation level.
- * Modification can be performed
- * according to PMD and device
- * capabilities.
- *
- * - @p 1 requests modification to be
- * performed on the outermost packet
- * encapsulation level.
- *
- * - @p 2 and subsequent values request
- * modification to be performed on
- * the specified inner packet
- * encapsulation level, from
- * outermost to innermost (lower to
- * higher values).
- *
- * Values other than @p 0 are not
- * necessarily supported.
- *
- * @note that for MPLS field,
- * encapsulation level also include
- * tunnel since MPLS may appear in
- * outer, inner or tunnel.
- */
- uint8_t level;
- union {
- /**
- * Tag index array inside
- * encapsulation level.
- * Used for VLAN, MPLS or TAG types.
- */
- uint8_t tag_index;
- /**
- * Geneve option identifier.
- * Relevant only for
- * RTE_FLOW_FIELD_GENEVE_OPT_XXXX
- * modification type.
- */
- struct {
- /**
- * Geneve option type.
- */
- uint8_t type;
- /**
- * Geneve option class.
- */
- rte_be16_t class_id;
- };
- };
- };
- struct rte_flow_item_flex_handle *flex_handle;
- };
- /** Number of bits to skip from a field. */
- uint32_t offset;
- };
- /**
- * Immediate value for RTE_FLOW_FIELD_VALUE, presented in the
- * same byte order and length as in relevant rte_flow_item_xxx.
- * The immediate source bitfield offset is inherited from
- * the destination's one.
- */
- uint8_t value[16];
- /**
- * Memory address for RTE_FLOW_FIELD_POINTER, memory layout
- * should be the same as for relevant field in the
- * rte_flow_item_xxx structure.
- */
- void *pvalue;
- };
-};
-
/**
* Operation types for MODIFY_FIELD action.
*/
--
2.34.1
next prev parent reply other threads:[~2024-02-06 2:07 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 3:12 [PATCH 0/2] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE Suanming Mou
2023-12-14 3:12 ` [PATCH 1/2] " Suanming Mou
2023-12-14 3:12 ` [PATCH 2/2] net/mlx5: add compare item support Suanming Mou
2023-12-19 1:33 ` [PATCH v2 0/3] [PATCH 0/2] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE Suanming Mou
2023-12-19 1:33 ` [PATCH v2 1/3] ethdev: rename action modify field data structure Suanming Mou
2024-01-09 14:07 ` Ori Kam
2024-01-12 8:03 ` Andrew Rybchenko
2023-12-19 1:33 ` [PATCH v2 2/3] ethdev: add compare item Suanming Mou
2024-01-09 14:26 ` Ori Kam
2024-01-12 8:11 ` Andrew Rybchenko
2024-01-15 8:14 ` Suanming Mou
2023-12-19 1:33 ` [PATCH v2 3/3] net/mlx5: add compare item support Suanming Mou
2024-01-09 14:28 ` Ori Kam
2024-01-15 9:13 ` [PATCH v3 0/3] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE Suanming Mou
2024-01-15 9:13 ` [PATCH v3 1/3] ethdev: rename action modify field data structure Suanming Mou
2024-01-30 17:19 ` Ferruh Yigit
2024-01-31 2:57 ` Suanming Mou
2024-02-01 10:56 ` Ferruh Yigit
2024-02-01 11:09 ` Suanming Mou
2024-02-01 11:20 ` Ferruh Yigit
2024-02-01 11:39 ` Suanming Mou
2024-01-15 9:13 ` [PATCH v3 2/3] ethdev: add compare item Suanming Mou
2024-01-30 17:33 ` Ferruh Yigit
2024-01-31 2:47 ` Suanming Mou
2024-01-31 15:56 ` Ori Kam
2024-01-31 16:46 ` Ferruh Yigit
2024-01-31 17:43 ` Ori Kam
2024-01-31 17:54 ` Ferruh Yigit
2024-02-01 6:51 ` Ori Kam
2024-02-01 0:31 ` Suanming Mou
2024-01-15 9:13 ` [PATCH v3 3/3] net/mlx5: add compare item support Suanming Mou
2024-02-01 2:30 ` [PATCH v4 0/3] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE Suanming Mou
2024-02-01 2:30 ` [PATCH v4 1/3] ethdev: rename action modify field data structure Suanming Mou
2024-02-01 2:30 ` [PATCH v4 2/3] ethdev: add compare item Suanming Mou
2024-02-01 2:30 ` [PATCH v4 3/3] net/mlx5: add compare item support Suanming Mou
2024-02-01 12:29 ` [PATCH v5 0/3] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE Suanming Mou
2024-02-01 12:29 ` [PATCH v5 1/3] ethdev: rename action modify field data structure Suanming Mou
2024-02-01 18:57 ` Ferruh Yigit
2024-02-01 12:29 ` [PATCH v5 2/3] ethdev: add compare item Suanming Mou
2024-02-01 18:57 ` Ferruh Yigit
2024-02-01 12:29 ` [PATCH v5 3/3] net/mlx5: add compare item support Suanming Mou
2024-02-01 18:57 ` Ferruh Yigit
2024-02-01 18:56 ` [PATCH v5 0/3] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE Ferruh Yigit
2024-02-02 0:32 ` Suanming Mou
2024-02-02 0:42 ` [PATCH v6 " Suanming Mou
2024-02-02 0:42 ` [PATCH v6 1/3] ethdev: rename action modify field data structure Suanming Mou
2024-02-05 11:23 ` Thomas Monjalon
2024-02-05 11:49 ` Suanming Mou
2024-02-05 12:39 ` Thomas Monjalon
2024-02-05 12:53 ` Suanming Mou
2024-02-02 0:42 ` [PATCH v6 2/3] ethdev: add compare item Suanming Mou
2024-02-05 13:00 ` Thomas Monjalon
2024-02-05 13:28 ` Suanming Mou
2024-02-05 14:09 ` Thomas Monjalon
2024-02-06 1:26 ` Suanming Mou
2024-02-02 0:42 ` [PATCH v6 3/3] net/mlx5: add compare item support Suanming Mou
2024-02-06 2:06 ` [PATCH v7 0/4] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE Suanming Mou
2024-02-06 2:06 ` [PATCH v7 1/4] ethdev: rename action modify field data structure Suanming Mou
2024-02-06 21:23 ` Ferruh Yigit
2024-02-06 2:06 ` Suanming Mou [this message]
2024-02-06 21:23 ` [PATCH v7 2/4] ethdev: move flow field data structures Ferruh Yigit
2024-02-06 2:06 ` [PATCH v7 3/4] ethdev: add compare item Suanming Mou
2024-02-06 21:24 ` Ferruh Yigit
2024-02-06 2:06 ` [PATCH v7 4/4] net/mlx5: add compare item support Suanming Mou
2024-02-06 21:23 ` Ferruh Yigit
2024-02-06 21:24 ` [PATCH v7 0/4] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE Ferruh Yigit
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=20240206020626.545946-3-suanmingm@nvidia.com \
--to=suanmingm@nvidia.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=orika@nvidia.com \
--cc=thomas@monjalon.net \
/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).