From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 46450A04B1; Wed, 4 Nov 2020 14:18:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 61C83C92A; Wed, 4 Nov 2020 14:17:51 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 7878BC926 for ; Wed, 4 Nov 2020 14:17:50 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from orika@nvidia.com) with SMTP; 4 Nov 2020 15:17:45 +0200 Received: from MTL-ORIKA.mtl.com ([172.27.14.169]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0A4DHhw2025641; Wed, 4 Nov 2020 15:17:45 +0200 From: Ori Kam To: andreyv@nvidia.com, mdr@ashroe.eu Cc: alexr@nvidia.com, andrey.vesnovaty@gmail.com, arybchenko@solarflare.com, dev@dpdk.org, elibr@nvidia.com, ferruh.yigit@intel.com, orika@nvidia.com, ozsh@nvidia.com, roniba@nvidia.com, thomas@nvidia.net, viacheslavo@nvidia.com Date: Wed, 4 Nov 2020 15:17:36 +0200 Message-Id: <20201104131737.10006-2-orika@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201104131737.10006-1-orika@nvidia.com> References: <20200909203008.25563-1-andreyv@nvidia.com> <20201104131737.10006-1-orika@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC v3 1/2] ethdev: add item/action for SFT X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Andrey Vesnovaty 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 --- lib/librte_ethdev/rte_flow.h | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index da8bfa5489..7ca47cc87c 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -537,6 +537,14 @@ enum rte_flow_item_type { */ RTE_FLOW_ITEM_TYPE_ECPRI, + /** + * [META] + * + * Matches SFT context. + * + * See struct rte_flow_item_sft. + */ + RTE_FLOW_ITEM_TYPE_SFT, }; /** @@ -1579,6 +1587,48 @@ 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 that wasw created by 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), + * which sends the packet to the SFT module. + * + * 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. + */ +RTE_STD_C11 +struct rte_flow_item_sft { + union { + uint32_t fid; /**< SFT flow identifier. */ + uint32_t zone; /**< Zone assigned to flow. */ + }; + uint32_t fid_valid:1; /**< The fid member is valid. */ + uint32_t zone_valid:1; /**< The zone member is valid. */ + uint32_t reserved:30; /**< Reserved. */ + uint8_t state; /**< User defined flow state. */ + uint8_t user_data_size; /**< user_data buffer size. */ + uint8_t *user_data; /**< Arbitrary user data. */ +}; + /** * Matching pattern item definition. * @@ -2132,6 +2182,15 @@ enum rte_flow_action_type { * see enum RTE_ETH_EVENT_FLOW_AGED */ RTE_FLOW_ACTION_TYPE_AGE, + + /** + * RTE_FLOW_ACTION_TYPE_SFT + * + * Direct the packet to SFT module. + * + * See struct rte_flow_action_sft. + */ + RTE_FLOW_ACTION_TYPE_SFT, }; /** @@ -2721,6 +2780,22 @@ 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 + * + * Performs lookup by *zone* and 5-tuple in SFT. + * If entry is found the related SFT context will be attached otherwise, + * default SFT context will be attached. + * + * This action may result in termination of actions that following this action. + */ +struct rte_flow_action_sft { + uint32_t zone; /**< Zone for lookup in SFT */ +}; + /* * Definition of a single action. * -- 2.25.1