From: Ori Kam <orika@nvidia.com> To: Andrey Vesnovaty <andreyv@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org> Cc: "thomas@nvidia.net" <thomas@nvidia.net>, Slava Ovsiienko <viacheslavo@nvidia.com>, "andrey.vesnovaty@gmail.com" <andrey.vesnovaty@gmail.com>, Oz Shlomo <ozsh@nvidia.com>, Eli Britstein <elibr@nvidia.com>, Alex Rosenbaum <alexr@nvidia.com>, Roni Bar Yanai <roniba@nvidia.com>, Ori Kam <orika@mellanox.com>, "NBU-Contact-Thomas Monjalon" <thomas@monjalon.net>, Ferruh Yigit <ferruh.yigit@intel.com>, Andrew Rybchenko <arybchenko@solarflare.com> Subject: Re: [dpdk-dev] [RFC 1/3] ethdev: add item/action for SFT Date: Wed, 16 Sep 2020 15:46:53 +0000 Message-ID: <MN2PR12MB4286438E2AA70E2ED95F12E4D6210@MN2PR12MB4286.namprd12.prod.outlook.com> (raw) In-Reply-To: <20200909203008.25563-2-andreyv@nvidia.com> Hi Andrey, PSB > -----Original Message----- > From: Andrey Vesnovaty <andreyv@nvidia.com> > Sent: Wednesday, September 9, 2020 11:30 PM > > Attach SFT flow context to packet with SFT action. > Match on SFT flow context (attached to packet), > with SFT item. > > Signed-off-by: Andrey Vesnovaty <andreyv@nvidia.com> > --- > lib/librte_ethdev/rte_flow.h | 84 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 84 insertions(+) > > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index da8bfa5489..24390e6ab4 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -537,6 +537,12 @@ enum rte_flow_item_type { > */ > RTE_FLOW_ITEM_TYPE_ECPRI, > > + /** You are missing the Meta, tag not relevant for RFC but please notice for the patch. > + * Matches SFT context (see fields of struct rte_flow_item_sft). > + * > + * See struct rte_flow_item_sft. > + */ > + RTE_FLOW_ITEM_TYPE_SFT, > }; > > /** > @@ -1579,6 +1585,54 @@ static const struct rte_flow_item_ecpri > rte_flow_item_ecpri_mask = { > }; > #endif > > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > + * RTE_FLOW_ITEM_TYPE_SFT > + * > + * Matches context of flow in SFT table. > + * > + * 5-tuple: src/dest IP + src/dest port + IP protocol. > + * zone: application defined value cupled with 5-tuple to identify flow, > + * example - VxLAN, VLAN. > + * SFT: Statfull flow table > + * SFT in scope of ethernet device (port) is HW offloaded lookup table > + * where key is zone + 5-tuple & value is statefull flow context. > + * Contents of the SFT maintained by SFT PMD (see SFT PMD API in rte_sft). > + * > + * The structure describes SFT flow context. > + * All the fields of the structure, except @p fid, should be considered as > + * user defined. > + * The @p fid assigned by RTE SFT & used as unique flow identifier. > + * SFT context attached to packet by action ``SFT`` (see > RTE_FLOW_ACTION_SFT). > + * > + * SFT default context defined as context attached to packet when there is no > + * entry for the flow in SFT. The @p state has application reserved value > + * meaning that SFT context for the packet undefined since entry wasn't found > + * in SFT. If state 'undefined' then @p zone should be valid othervice @p fid > + * should be valid. > + * > + * Context considered virtual since the method of storing this info on packet > + * is PMD/implementation specific & may involve mapping methods if there is > + * 'not enough bits' to store entire contents of struct rte_flow_item_sft. > + * > + * Maximal value/size of each field depends on HW capabilities and > considered > + * as implementation specific. > + */ > +struct rte_flow_item_sft { > + union { > + uint32_t fid; /**< SFT flow identifier. */ > + uint32_t zone; /**< Zone assigned to flow. */ > + }; > + uint8_t state; /**< User defined flow state. */ > + uint8_t fid_valid:1; /**< fid field validity bit. */ > + uint8_t zone_valid:1; /**< zone fieald validity bit. */ > + uint8_t state_valid:1; /**< state fieald validity bit. */ > + uint8_t user_data_size; /**< user_data buffer size. */ > + uint8_t *user_data; /**< Arbitrary user data. */ > +}; > + This object is only used to match and not set so why do we need the union? I understand that later when reporting to the SFT in the application layer sometimes you will get zone while other time you will get fid. From rte flow you are matching on given object which is 32 bit. What are the matchable fields? (fid / zone / user_data / fid_valid ... ) Do you think that some of the times the match will be on he fid other on the zone? If so they should not be union. I think zone is the responsibility of the application to save and to match. So I don't see why it is needed here. > /** > * Matching pattern item definition. > * > @@ -2132,6 +2186,15 @@ enum rte_flow_action_type { > * see enum RTE_ETH_EVENT_FLOW_AGED > */ > RTE_FLOW_ACTION_TYPE_AGE, > + > + /** > + * RTE_FLOW_ACTION_TYPE_SFT > + * > + * Set SFT context and redirect to continue processing. > + * > + * See struct rte_flow_action_sft. > + */ > + RTE_FLOW_ACTION_TYPE_SFT, > }; > > /** > @@ -2721,6 +2784,27 @@ rte_flow_dynf_metadata_set(struct rte_mbuf *m, > uint32_t v) > *RTE_FLOW_DYNF_METADATA(m) = v; > } > > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > + * RTE_FLOW_ACTION_TYPE_SFT > + * > + * Attaches an SFT context (see struct rte_flow_item_sft) to packet. > + * > + * Performs lookup by *zone* and 5-tuple in SFT; if entry found the related SFT > + * context will be attached othervise default SFT context attached (see > + * 'SFT default context' in struct rte_flow_item_sft description). > + * Adding action of type ``SFT`` to the list of rule actions may impose > + * limitations on other rule actions added to the list, depending on specific > + * PMD implementation. > + * > + * For 5-tuple, zone & SFT definitions see `struct rte_flow_item_sft`. > + */ > +struct rte_flow_action_sft { > + uint32_t zone; /**< Zone for lookup in SFT */ > +}; > + > /* > * Definition of a single action. > * > -- > 2.26.2 Thanks, Ori
next prev parent reply other threads:[~2020-09-16 15:47 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-09 20:30 [dpdk-dev] [RFC 0/3] introduce Stateful Flow Table Andrey Vesnovaty 2020-09-09 20:30 ` [dpdk-dev] [RFC 1/3] ethdev: add item/action for SFT Andrey Vesnovaty 2020-09-16 15:46 ` Ori Kam [this message] 2020-09-18 7:04 ` Andrew Rybchenko 2020-09-09 20:30 ` [dpdk-dev] [RFC 2/3] ethdev: support SFT APIs Andrey Vesnovaty 2020-09-09 20:30 ` [dpdk-dev] [RFC 3/3] sft: introduce API Andrey Vesnovaty 2020-09-16 18:33 ` Ori Kam 2020-09-18 7:43 ` Andrew Rybchenko 2020-11-02 10:49 ` Andrey Vesnovaty 2020-09-18 13:34 ` Kinsella, Ray 2020-09-15 11:59 ` [dpdk-dev] [RFC 0/3] introduce Stateful Flow Table Andrey Vesnovaty 2020-11-04 12:59 ` [dpdk-dev] [PATCH v2 0/2] introduce stateful flow table Ori Kam 2020-11-04 12:59 ` [dpdk-dev] [PATCH v2 1/2] ethdev: add item/action for SFT Ori Kam 2020-11-04 12:59 ` [dpdk-dev] [PATCH v2 2/2] ethdev: introduce sft lib Ori Kam 2020-11-04 13:17 ` [dpdk-dev] [RFC v3 0/2] introduce stateful flow table Ori Kam 2020-11-04 13:17 ` [dpdk-dev] [RFC v3 1/2] ethdev: add item/action for SFT Ori Kam 2020-11-04 13:17 ` [dpdk-dev] [RFC v3 2/2] ethdev: introduce sft lib Ori Kam
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=MN2PR12MB4286438E2AA70E2ED95F12E4D6210@MN2PR12MB4286.namprd12.prod.outlook.com \ --to=orika@nvidia.com \ --cc=alexr@nvidia.com \ --cc=andrey.vesnovaty@gmail.com \ --cc=andreyv@nvidia.com \ --cc=arybchenko@solarflare.com \ --cc=dev@dpdk.org \ --cc=elibr@nvidia.com \ --cc=ferruh.yigit@intel.com \ --cc=orika@mellanox.com \ --cc=ozsh@nvidia.com \ --cc=roniba@nvidia.com \ --cc=thomas@monjalon.net \ --cc=thomas@nvidia.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
DPDK patches and discussions This inbox may be cloned and mirrored by anyone: git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \ dev@dpdk.org public-inbox-index dev Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.dev AGPL code for this site: git clone https://public-inbox.org/public-inbox.git