DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jack Min <jackmin@mellanox.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	 "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v5 1/3] ethdev: add generic TTL rewrite actions
Date: Tue, 16 Oct 2018 02:03:35 +0000	[thread overview]
Message-ID: <20181016020318.2efwbgg2ghgawa3e@MTBC-JACKMIN.mtl.com> (raw)
In-Reply-To: <ef0d8364-39ce-8227-493e-8f3f29109093@solarflare.com>

On 18-10-14 10:35:30, Andrew Rybchenko wrote:
> On 13.10.2018 06:24, Jack Min wrote:
> > rewrite TTL by decrease or just set it directly
> > 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 more generic
> > 
> > Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> > Acked-by: Yongseok Koh <yskoh@mellanox.com>
> > ---
> 
> [...]
> 
> > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> > index 68bbf57d0..f102e6939 100644
> > --- a/lib/librte_ethdev/rte_flow.h
> > +++ b/lib/librte_ethdev/rte_flow.h
> > @@ -1579,6 +1579,26 @@ enum rte_flow_action_type {
> >   	 * No associated configuration structure.
> >   	 */
> >   	RTE_FLOW_ACTION_TYPE_MAC_SWAP,
> > +
> > +	/**
> > +	 * 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,
> >   };
> >   /**
> 
> As I understand it is one more case where the following note from Adrien
> is applicable [1]:
> 
> <begin quote>
> 
> Another problem is that you must not require actions to rely on specific
> pattern content:
> 
>  [...]
>  *
>  * Decapsulate outer most tunnel from matched flow.
>  *
>  * The flow pattern must have a valid tunnel header
>  */
>  RTE_FLOW_ACTION_TYPE_TUNNEL_DECAP,
> 
> For maximum flexibility, all actions should be usable on their own on empty
> pattern. On the other hand, you can document undefined behavior when
> performing some action on traffic that doesn't contain something.
> 
> Reason is that invalid traffic may have already been removed by other flow
> rules (or whatever happens) before such a rule is reached; it's a user's
> responsibility to provide such guarantee.
> 
> When parsing an action, a PMD is not supposed to look at the pattern. Action
> list should contain all the needed info, otherwise it means the API is badly
> defined.
> 
> I'm aware the above makes it tough to implement something like
> RTE_FLOW_ACTION_TYPE_TUNNEL_DECAP as defined in this series, but that's
> unfortunately why I think it must not be defined like that.
> 
> <end quote>
> 
> [1] https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmails.dpdk.org%2Farchives%2Fdev%2F2018-October%2F115267.html&amp;data=02%7C01%7Cjackmin%40mellanox.com%7C8297d07c910e4aa6b4f508d631a7ab8e%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636750993538615097&amp;sdata=q0ywvMqqtRr%2BHp%2FBHLGtMF3x84kwPooZ7eYfdxmHtUs%3D&amp;reserved=0
> 
Alright, I'will document this as PMD's limitation not API's.

-Jack

  reply	other threads:[~2018-10-16  2:03 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 13:47 [dpdk-dev] [PATCH 0/3] " Xiaoyu Min
2018-09-25 13:47 ` [dpdk-dev] [PATCH 1/3] " Xiaoyu Min
2018-09-25 13:47 ` [dpdk-dev] [PATCH 2/3] app/testpmd: add commands of modify TTL Xiaoyu Min
2018-09-25 13:47 ` [dpdk-dev] [PATCH 3/3] net/mlx5: eswitch-modify TTL actions Xiaoyu Min
2018-10-03 20:07   ` Yongseok Koh
2018-10-08  6:57     ` Xiaoyu Min
2018-09-25 14:37 ` [dpdk-dev] [PATCH v2 0/3] ethdev: add generic TTL rewrite actions Xiaoyu Min
2018-09-25 14:37   ` [dpdk-dev] [PATCH v2 1/3] " Xiaoyu Min
2018-10-03 19:50     ` Yongseok Koh
2018-09-25 14:37   ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: add commands of modify TTL Xiaoyu Min
2018-10-03 19:51     ` Yongseok Koh
2018-09-25 14:37   ` [dpdk-dev] [PATCH v2 3/3] net/mlx5: eswitch-modify TTL actions Xiaoyu Min
2018-10-05 12:48     ` Ferruh Yigit
2018-10-05 18:17       ` Yongseok Koh
2018-10-03 20:35   ` [dpdk-dev] [PATCH v2 0/3] ethdev: add generic TTL rewrite actions Thomas Monjalon
2018-10-05 12:52   ` Ferruh Yigit
2018-10-08  2:30     ` Xiaoyu Min
2018-10-10 13:05   ` [dpdk-dev] [PATCH v3 " Jack Min
2018-10-10 13:05     ` [dpdk-dev] [PATCH v3 1/3] " Jack Min
2018-10-10 13:05     ` [dpdk-dev] [PATCH v3 2/3] app/testpmd: add commands of modify TTL Jack Min
2018-10-10 13:06     ` [dpdk-dev] [PATCH v3 3/3] net/mlx5: rewrite TTL by E-Switch Jack Min
2018-10-11  5:47       ` Yongseok Koh
2018-10-11 13:27     ` [dpdk-dev] [PATCH v4 0/3] ethdev: add generic TTL rewrite actions Jack Min
2018-10-11 13:27       ` [dpdk-dev] [PATCH v4 1/3] " Jack Min
2018-10-12 14:12         ` Ferruh Yigit
2018-10-13  2:16           ` Jack Min
2018-10-11 13:27       ` [dpdk-dev] [PATCH v4 2/3] app/testpmd: add commands of modify TTL Jack Min
2018-10-11 13:27       ` [dpdk-dev] [PATCH v4 3/3] net/mlx5: rewrite TTL by E-Switch Jack Min
2018-10-13  3:24       ` [dpdk-dev] [PATCH v5 0/3] ethdev: add generic TTL rewrite actions Jack Min
2018-10-13  3:24         ` [dpdk-dev] [PATCH v5 1/3] " Jack Min
2018-10-14  7:35           ` Andrew Rybchenko
2018-10-16  2:03             ` Jack Min [this message]
2018-10-13  3:24         ` [dpdk-dev] [PATCH v5 2/3] app/testpmd: add commands of modify TTL Jack Min
2018-10-13  3:24         ` [dpdk-dev] [PATCH v5 3/3] net/mlx5: rewrite TTL by E-Switch Jack Min
2018-10-16  8:14         ` [dpdk-dev] [PATCH v6 0/3] ethdev: add generic TTL rewrite actions Jack Min
2018-10-16  8:14           ` [dpdk-dev] [PATCH v6 1/3] " Jack Min
2018-10-16  8:25             ` Andrew Rybchenko
2018-10-16  8:48               ` Ferruh Yigit
2018-10-16  8:14           ` [dpdk-dev] [PATCH v6 2/3] app/testpmd: add commands of modify TTL Jack Min
2018-10-16  8:14           ` [dpdk-dev] [PATCH v6 3/3] net/mlx5: rewrite TTL by E-Switch Jack Min

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=20181016020318.2efwbgg2ghgawa3e@MTBC-JACKMIN.mtl.com \
    --to=jackmin@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.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).