DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jack Min <jackmin@mellanox.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	"Xueming(Steven) Li" <xuemingl@mellanox.com>,
	Shahaf Shuler <shahafs@mellanox.com>
Subject: [dpdk-dev] [RFC] ethdev: add generic TTL rewrite actions
Date: Tue, 7 Aug 2018 14:20:53 +0000	[thread overview]
Message-ID: <DB6PR0501MB202314B2A175949F6C3D7670CC270@DB6PR0501MB2023.eurprd05.prod.outlook.com> (raw)

There is a need to rewrite TTL by decrease or just set it directly,
and it's not necessary to check if the final result is zero or not.

This is slightly different from the one defined by openflow and
make the actions more generic.




Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
---
 lib/librte_ethdev/rte_flow.h | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index f8ba71cdb..fbf88f9fd 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1505,6 +1505,26 @@ enum rte_flow_action_type {
         * error.
         */
        RTE_FLOW_ACTION_TYPE_NVGRE_DECAP,
+
+       /**
+        * Decrease TTL value directly
+        *
+        * If flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_IPV4, or
+        * RTE_FLOW_ITEM_TYPE_IPV6, the PMD should return a
+        * RTE_FLOW_ERROR_TYPE_ACTION error.
+        */
+       RTE_FLOW_ACTION_TYPE_DEC_TTL,
+
+       /**
+        * Set TTL value
+        *
+        * If flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_IPV4, or
+        * RTE_FLOW_ITEM_TYPE_IPV6, the PMD should return a
+        * RTE_FLOW_ERROR_TYPE_ACTION error.
+        *
+        * See struct rte_flow_action_set_ttl
+        */
+       RTE_FLOW_ACTION_TYPE_SET_TTL,
 };
 
 /**
@@ -1868,6 +1888,20 @@ struct rte_flow_action_nvgre_encap {
        struct rte_flow_item *definition;
 };
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_SET_TTL
+ *
+ * Set the TTL value directly for IPv4 or IPv6
+ * The RTE_FLOW_ITEM_TYPE_IPV4 or RTE_FLOW_ITEM_TYPE_IPV6
+ * must be present in pattern
+ */
+struct rte_flow_action_set_ttl {
+       uint8_t ttl_value;
+}
+
 /*
  * Definition of a single action.
  *
-- 
2.17.1

             reply	other threads:[~2018-08-07 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 14:20 Jack Min [this message]
2018-08-23 14:00 ` Ferruh Yigit
2018-08-24  7:17   ` Jack MIN
2018-08-24  8:48     ` 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=DB6PR0501MB202314B2A175949F6C3D7670CC270@DB6PR0501MB2023.eurprd05.prod.outlook.com \
    --to=jackmin@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=shahafs@mellanox.com \
    --cc=thomas@monjalon.net \
    --cc=xuemingl@mellanox.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).