DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC] ethdev: add generic TTL rewrite actions
@ 2018-08-07 14:20 Jack Min
  2018-08-23 14:00 ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Jack Min @ 2018-08-07 14:20 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon, Adrien Mazarguil, Xueming(Steven) Li, Shahaf Shuler

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [RFC] ethdev: add generic TTL rewrite actions
  2018-08-07 14:20 [dpdk-dev] [RFC] ethdev: add generic TTL rewrite actions Jack Min
@ 2018-08-23 14:00 ` Ferruh Yigit
  2018-08-24  7:17   ` Jack MIN
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2018-08-23 14:00 UTC (permalink / raw)
  To: Jack Min, dev
  Cc: Thomas Monjalon, Adrien Mazarguil, Xueming(Steven) Li,
	Shahaf Shuler, Andrew Rybchenko

On 8/7/2018 3:20 PM, Jack Min wrote:
> 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>

Looks good to me.

Can we use existing testpmd commands to test these new actions?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [RFC] ethdev: add generic TTL rewrite actions
  2018-08-23 14:00 ` Ferruh Yigit
@ 2018-08-24  7:17   ` Jack MIN
  2018-08-24  8:48     ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Jack MIN @ 2018-08-24  7:17 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: dev, Thomas Monjalon, Adrien Mazarguil, Xueming(Steven) Li,
	Shahaf Shuler, Andrew Rybchenko

On Thu, Aug 23, 2018 at 03:00:53PM +0100, Ferruh Yigit wrote:
> On 8/7/2018 3:20 PM, Jack Min wrote:
> > 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>
> 
> Looks good to me.
> 
> Can we use existing testpmd commands to test these new actions?
No, I don't think so.
The current TTL related testpmd commands are all for OpenFlow variety

-Jack

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [RFC] ethdev: add generic TTL rewrite actions
  2018-08-24  7:17   ` Jack MIN
@ 2018-08-24  8:48     ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-08-24  8:48 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Adrien Mazarguil, Xueming(Steven) Li,
	Shahaf Shuler, Andrew Rybchenko

On 8/24/2018 8:17 AM, Jack MIN wrote:
> On Thu, Aug 23, 2018 at 03:00:53PM +0100, Ferruh Yigit wrote:
>> On 8/7/2018 3:20 PM, Jack Min wrote:
>>> 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>
>>
>> Looks good to me.
>>
>> Can we use existing testpmd commands to test these new actions?
> No, I don't think so.

Can you please update testpmd counterpart of new actions so that they can be tested?

> The current TTL related testpmd commands are all for OpenFlow variety
> 
> -Jack
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-24  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-07 14:20 [dpdk-dev] [RFC] ethdev: add generic TTL rewrite actions Jack Min
2018-08-23 14:00 ` Ferruh Yigit
2018-08-24  7:17   ` Jack MIN
2018-08-24  8:48     ` Ferruh Yigit

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).