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 03EFEA04A4; Wed, 3 Jun 2020 16:20:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 457B91D52C; Wed, 3 Jun 2020 16:20:26 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id E9D1F1D446 for ; Wed, 3 Jun 2020 16:20:23 +0200 (CEST) IronPort-SDR: wbcC4MjyXDeXx1aaomfxpPZ6BpvO18PCZRs9yYpI5YZo5tUGkXsG3KTRxHoMXNnBpGBC/tDZAZ /aN1Dc9JHjeQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 07:20:23 -0700 IronPort-SDR: +L2fEcNgWUd6+r7jnbg7Jx2jMigXJ8SgpdaTpO/nbnOgKNhnCNYLtA5mwOjMNY90mr7gjXeQEH Vf2T+QMbIkxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="416572737" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by orsmga004.jf.intel.com with ESMTP; 03 Jun 2020 07:20:21 -0700 From: Bernard Iremonger To: dev@dpdk.org, beilei.xing@intel.com, qi.z.zhang@intel.com, declan.doherty@intel.com, orika@mellanox.com Cc: Bernard Iremonger Date: Wed, 3 Jun 2020 15:20:02 +0100 Message-Id: <1591194009-4086-2-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1591194009-4086-1-git-send-email-bernard.iremonger@intel.com> References: <1591194009-4086-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH 1/8] librte_ethdev: add new flow types and action 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" In rte_flow.h: add RTE_FLOW_ITEM_TYPE_PCTYPE add RTE_FLOW_ITEM_TYPE_FLOWTYPE add RTE_FLOW_ACTION_TYPE_MAP add structs and masks for new flow types In rte_flow.rst: add items for pctype and flowtype add action for map Signed-off-by: Bernard Iremonger --- doc/guides/prog_guide/rte_flow.rst | 55 +++++++++++++++++++++++++++ lib/librte_ethdev/rte_flow.h | 78 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index d5dd18c..9b54154 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -1362,6 +1362,44 @@ Matches a PFCP Header. - ``seid``: session endpoint identifier. - Default ``mask`` matches s_field and seid. +Item: ``PCTYPE`` +^^^^^^^^^^^^^^^^ + +Matches a PCTYPE + +.. _table_rte_flow_item_pctype: + +.. table:: PCTYPE + + +----------+----------+---------------------------------------+ + | Field | Subfield | Value | + +==========+==========+=======================================+ + | ``spec`` | ``data`` | 64 bit pctype value | + +----------+----------+---------------------------------------+ + | ``last`` | ``data`` | upper range value | + +----------+----------+---------------------------------------+ + | ``mask`` | ``data`` | bit-mask applies to "spec" and "last" | + +----------+----------+---------------------------------------+ + +Item: ``FLOWTYPE`` +^^^^^^^^^^^^^^^^^^ + +Matches a FLOWTYPE + +.. _table_rte_flow_item_flowtype: + +.. table:: FLOWTYPE + + +----------+----------+---------------------------------------+ + | Field | Subfield | Value | + +==========+==========+=======================================+ + | ``spec`` | ``data`` | 16 bit flowtype value | + +----------+----------+---------------------------------------+ + | ``last`` | ``data`` | upper range value | + +----------+----------+---------------------------------------+ + | ``mask`` | ``data`` | bit-mask applies to "spec" and "last" | + +----------+----------+---------------------------------------+ + Actions ~~~~~~~ @@ -2645,6 +2683,23 @@ timeout passed without any matching on the flow. | ``context`` | user input flow context | +--------------+---------------------------------+ +Action: ``MAP`` +^^^^^^^^^^^^^^^ + +Map pctype to flowtype. + +.. _table_rte_flow_action_map: + +.. table:: MAP + + +--------------+---------------------------------+ + | Field | Value | + +==============+=================================+ + | ``pctype`` | 64 bit pctype value | + +--------------+---------------------------------+ + | ``flowtype`` | 16 bit flowtype value | + +--------------+---------------------------------+ + Negative types ~~~~~~~~~~~~~~ diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index b0e4199..dcae7b9 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -527,6 +527,20 @@ enum rte_flow_item_type { */ RTE_FLOW_ITEM_TYPE_PFCP, + /** + * Matches Packet Classification type (PCTYPE). + * See struct rte_flow_item_pctype. + * + */ + RTE_FLOW_ITEM_TYPE_PCTYPE, + + /** + * Matches flow type. + * See struct rte_flow_item_flowtype. + * + */ + RTE_FLOW_ITEM_TYPE_FLOWTYPE, + }; /** @@ -1547,6 +1561,46 @@ static const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask = { #endif /** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ITEM_TYPE_PCTYPE + * + * Match Packet Classification type (PCTYPE) + * + */ +struct rte_flow_item_pctype { + uint64_t pctype; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_PCTYPE. */ +#ifndef __cplusplus +static const struct rte_flow_item_pctype rte_flow_item_pctype_mask = { + .pctype = 0xffffffffffffffff, +}; +#endif + +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ITEM_TYPE_FLOWTYPE + * + * Match flow type + * + */ +struct rte_flow_item_flowtype { + uint16_t flowtype; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_FLOWTYPE. */ +#ifndef __cplusplus +static const struct rte_flow_item_flowtype rte_flow_item_flowtype_mask = { + .flowtype = 0xffff, +}; +#endif + +/** * Matching pattern item definition. * * A pattern is formed by stacking items starting from the lowest protocol @@ -2099,6 +2153,17 @@ enum rte_flow_action_type { * see enum RTE_ETH_EVENT_FLOW_AGED */ RTE_FLOW_ACTION_TYPE_AGE, + + /** + * Map Packet Classification type to flow type. + * + * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_PCTYPE, + * and a valid RTE_FLOW_ITEM_FLOWTYPE the PMD should return a + * RTE_FLOW_ERROR_TYPE_ACTION error. + * + * See struct rte_flow_action_map. + */ + RTE_FLOW_ACTION_TYPE_MAP, }; /** @@ -2660,6 +2725,19 @@ struct rte_flow_action_set_dscp { uint8_t dscp; }; +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ACTION_TYPE_MAP + * + * Map a packet classification type to a flow type. + */ +struct rte_flow_action_map { + uint16_t flowtype; + uint64_t pctype; +}; + /* Mbuf dynamic field offset for metadata. */ extern int32_t rte_flow_dynf_metadata_offs; -- 2.7.4