DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rongwei Liu <rongweil@nvidia.com>
To: <dev@dpdk.org>, <matan@nvidia.com>, <viacheslavo@nvidia.com>,
	<orika@nvidia.com>, <suanmingm@nvidia.com>, <thomas@monjalon.net>
Cc: Ferruh Yigit <ferruh.yigit@amd.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [PATCH v1 1/2] ethdev: add IPv6 extension push remove action
Date: Wed, 24 May 2023 10:39:28 +0300	[thread overview]
Message-ID: <20230524073929.400623-2-rongweil@nvidia.com> (raw)
In-Reply-To: <20230524073929.400623-1-rongweil@nvidia.com>

Add new rte_actions to push and remove the specific
type of IPv6 extension to and from original packets.

A new extension to be pushed should be the last extension
due to the next header awareness.

Remove can support the IPv6 extension in any position.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
---
 doc/guides/prog_guide/rte_flow.rst     | 21 +++++++++++
 doc/guides/rel_notes/release_23_07.rst |  6 +++
 lib/ethdev/rte_flow.c                  |  2 +
 lib/ethdev/rte_flow.h                  | 52 ++++++++++++++++++++++++++
 4 files changed, 81 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 32fc45516a..2fe42e1cea 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -3300,6 +3300,27 @@ The ``quota`` value is reduced according to ``mode`` setting.
    | ``RTE_FLOW_QUOTA_MODE_L3``      | Count packet bytes starting from L3 |
    +------------------+----------------------------------------------------+
 
+Action: ``IPV6_EXT_PUSH``
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Add an IPv6 extension into IPv6 header and its template is provided in
+its data buffer with the specific type as defined in the
+``rte_flow_action_ipv6_ext_push`` definition.
+
+This action modifies the payload of matched flows. The data supplied must
+be a valid extension in the specified type, it should be added the last one
+if preceding extension existed. When applied to the original packet the
+resulting packet must be a valid packet.
+
+Action: ``IPV6_EXT_REMOVE``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Remove an IPv6 extension whose type is provided in its type as defined in
+the ``rte_flow_action_ipv6_ext_remove``.
+
+This action modifies the payload of matched flow and the packet should be
+valid after removing.
+
 Negative types
 ~~~~~~~~~~~~~~
 
diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst
index a9b1293689..4543cfde1f 100644
--- a/doc/guides/rel_notes/release_23_07.rst
+++ b/doc/guides/rel_notes/release_23_07.rst
@@ -27,6 +27,12 @@ New Features
 .. This section should contain new features added in this release.
    Sample format:
 
+   * **Added actions to push or remove the specific type of IPv6 extension.**
+
+     Added ``RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH`` and ``RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH``
+     to push or remove the specific IPv6 extension into or from the packets.
+     Push always put the new extension as the last one due to the next header awareness.
+
    * **Add a title in the past tense with a full stop.**
 
      Add a short 1-2 sentence description in the past tense.
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 69e6e749f7..af4b3f6da4 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -259,6 +259,8 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
 	MK_FLOW_ACTION(METER_MARK, sizeof(struct rte_flow_action_meter_mark)),
 	MK_FLOW_ACTION(SEND_TO_KERNEL, 0),
 	MK_FLOW_ACTION(QUOTA, sizeof(struct rte_flow_action_quota)),
+	MK_FLOW_ACTION(IPV6_EXT_PUSH, sizeof(struct rte_flow_action_ipv6_ext_push)),
+	MK_FLOW_ACTION(IPV6_EXT_REMOVE, sizeof(struct rte_flow_action_ipv6_ext_remove)),
 };
 
 int
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 713ba8b65c..369ecbc6ba 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2912,6 +2912,25 @@ enum rte_flow_action_type {
 	 * applied to the given ethdev Rx queue.
 	 */
 	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
+
+	/**
+	 * RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH
+	 *
+	 * Push IPv6 extension into IPv6 packet.
+	 *
+	 * @see struct rte_flow_action_ipv6_ext_push.
+	 */
+	RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH,
+
+	/**
+	 * RTE_FLOW_ACTION_TYPE_IPV6_EXT_REMOVE
+	 *
+	 * Remove IPv6 extension from IPv6 packet whose type
+	 * is provided in its configuration buffer.
+	 *
+	 * @see struct rte_flow_action_ipv6_ext_remove.
+	 */
+	RTE_FLOW_ACTION_TYPE_IPV6_EXT_REMOVE,
 };
 
 /**
@@ -3352,6 +3371,39 @@ struct rte_flow_action_vxlan_encap {
 	struct rte_flow_item *definition;
 };
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH
+ *
+ * Valid flow definition for RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH include:
+ *
+ * - IPV6_EXT TYPE / IPV6_EXT_HEADER_IN_TYPE / END
+ *
+ * size holds the number of bytes in @p data.
+ * The data must be added as the last IPv6 extension.
+ */
+struct rte_flow_action_ipv6_ext_push {
+	uint8_t *data; /**< IPv6 extension header data. */
+	size_t size; /**< Size of @p data. */
+	uint8_t type; /**< Type of IPv6 extension. */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_IPV6_EXT_REMOVE
+ *
+ * Valid flow definition for RTE_FLOW_ACTION_TYPE_IPV6_EXT_REMOVE include:
+ *
+ * - IPV6_EXT TYPE / END
+ */
+struct rte_flow_action_ipv6_ext_remove {
+	uint8_t type; /**< Type of IPv6 extension. */
+};
+
 /**
  * @warning
  * @b EXPERIMENTAL: this structure may change without prior notice
-- 
2.27.0


  reply	other threads:[~2023-05-24  7:40 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17  9:25 [PATCH v1 0/8] add IPv6 extension push remove Rongwei Liu
2023-04-17  9:25 ` [PATCH v1 1/8] ethdev: add IPv6 extension push remove action Rongwei Liu
2023-05-24  6:55   ` Ori Kam
2023-05-24  7:39     ` [PATCH v1 0/2] add IPv6 extension push remove Rongwei Liu
2023-05-24  7:39       ` Rongwei Liu [this message]
2023-05-24 10:30         ` [PATCH v1 1/2] ethdev: add IPv6 extension push remove action Ori Kam
2023-05-24  7:39       ` [PATCH v1 2/2] app/testpmd: add IPv6 extension push remove cli Rongwei Liu
2023-06-02 14:39       ` [PATCH v1 0/2] add IPv6 extension push remove Ferruh Yigit
2023-07-10  2:32         ` Rongwei Liu
2023-07-10  8:55           ` Ferruh Yigit
2023-07-10 14:41             ` Stephen Hemminger
2023-07-11  6:16               ` Thomas Monjalon
2023-09-19  8:12                 ` [PATCH v3] net/mlx5: add test for live migration Rongwei Liu
2023-10-16  8:19                   ` Thomas Monjalon
2023-10-16  8:25                     ` Rongwei Liu
2023-10-16  9:26                       ` Rongwei Liu
2023-10-16  9:26                       ` Thomas Monjalon
2023-10-16  9:29                         ` Rongwei Liu
2023-10-25  9:07                           ` Rongwei Liu
2023-10-16  9:22                     ` [PATCH v4] " Rongwei Liu
2023-10-25  9:36                       ` [PATCH v5] " Rongwei Liu
2023-10-25  9:41                         ` Thomas Monjalon
2023-10-25  9:45                           ` [PATCH v6] " Rongwei Liu
2023-10-25  9:48                           ` [PATCH v5] " Rongwei Liu
2023-10-25  9:50                           ` [PATCH v7] " Rongwei Liu
2023-10-25 13:10                             ` Thomas Monjalon
2023-10-26  8:15                             ` Raslan Darawsheh
2023-04-17  9:25 ` [PATCH v1 2/8] app/testpmd: add IPv6 extension push remove cli Rongwei Liu
2023-05-24  7:06   ` Ori Kam
2023-04-17  9:25 ` [PATCH v1 3/8] net/mlx5/hws: add no reparse support Rongwei Liu
2023-04-17  9:25 ` [PATCH v1 4/8] net/mlx5: sample the srv6 last segment Rongwei Liu
2023-10-31  9:42   ` [PATCH v2 0/6] support IPv6 extension push remove Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 1/6] net/mlx5: sample the srv6 last segment Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 2/6] net/mlx5/hws: fix potential wrong errno value Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 3/6] net/mlx5/hws: add IPv6 routing extension push remove actions Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 4/6] net/mlx5/hws: add setter for IPv6 routing push remove Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 5/6] net/mlx5: implement " Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 6/6] net/mlx5/hws: add stc reparse support for srv6 push pop Rongwei Liu
2023-10-31 10:51     ` [PATCH v3 0/6] support IPv6 extension push remove Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 1/6] net/mlx5: sample the srv6 last segment Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 2/6] net/mlx5/hws: fix potential wrong errno value Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 3/6] net/mlx5/hws: add IPv6 routing extension push remove actions Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 4/6] net/mlx5/hws: add setter for IPv6 routing push remove Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 5/6] net/mlx5: implement " Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 6/6] net/mlx5/hws: add stc reparse support for srv6 push pop Rongwei Liu
2023-11-01  4:44       ` [PATCH v4 00/13] support IPv6 push remove action Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 01/13] net/mlx5/hws: support insert header action Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 02/13] net/mlx5/hws: support remove " Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 03/13] net/mlx5/hws: allow jump to TIR over FDB Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 04/13] net/mlx5/hws: support dynamic re-parse Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 05/13] net/mlx5/hws: dynamic re-parse for modify header Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 06/13] net/mlx5/hws: fix incorrect re-parse on complex rules Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 07/13] net/mlx5: sample the srv6 last segment Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 08/13] net/mlx5/hws: fix potential wrong rte_errno value Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 09/13] net/mlx5/hws: add IPv6 routing extension push remove actions Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 10/13] net/mlx5/hws: add setter for IPv6 routing push remove Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 11/13] net/mlx5: implement " Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 12/13] net/mlx5/hws: fix srv6 push compilation failure Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 13/13] net/mlx5/hws: add stc reparse support for srv6 push pop Rongwei Liu
2023-11-02 13:44         ` [PATCH v4 00/13] support IPv6 push remove action Raslan Darawsheh
2023-04-17  9:25 ` [PATCH v1 5/8] net/mlx5: generate srv6 modify header resource Rongwei Liu
2023-04-17  9:25 ` [PATCH v1 6/8] net/mlx5/hws: add IPv6 routing extension push pop actions Rongwei Liu
2023-04-17  9:25 ` [PATCH v1 7/8] net/mlx5/hws: add setter for IPv6 routing push pop Rongwei Liu
2023-04-17  9:25 ` [PATCH v1 8/8] net/mlx5: implement " Rongwei Liu

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=20230524073929.400623-2-rongweil@nvidia.com \
    --to=rongweil@nvidia.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.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).