From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DFE97A0C55; Wed, 13 Oct 2021 18:43:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65DB341172; Wed, 13 Oct 2021 18:43:10 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 8A4CE410E8 for ; Wed, 13 Oct 2021 18:42:58 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.123.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 4CEE87F6FA; Wed, 13 Oct 2021 19:42:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 4CEE87F6FA DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1634143378; bh=g9fVePOWOYXDiJmAwzt611bNO3nkHSrzHEW3QBzDPvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DcSuiDcGyCRRqK1Ac8td3UbWzBPkOGpiNJTl+CpM5fJAOxpYQRl5I4uZgbCUel899 xbiNRuCTPGJ31ZDLBvXKuaONHZltWB40OXBCLb6teBzJzdNRwiLR94s1VZQXiPeNtE dNQogKGPdYmJPBezUxYVzF5YeELd3fn6tE4MrYsw= From: Ivan Malov To: dev@dpdk.org Cc: Ferruh Yigit , Thomas Monjalon , Ori Kam , Andrew Rybchenko , Ray Kinsella Date: Wed, 13 Oct 2021 19:42:37 +0300 Message-Id: <20211013164243.21264-7-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211013164243.21264-1-ivan.malov@oktetlabs.ru> References: <20211001134716.1608857-1-andrew.rybchenko@oktetlabs.ru> <20211013164243.21264-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 06/12] ethdev: deprecate direction attributes in transfer flows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Attributes "ingress" and "egress" can only apply unambiguosly to non-"transfer" flows. In "transfer" flows, the standpoint is effectively shifted to the embedded switch. There can be many different endpoints connected to the switch, so the use of "ingress" / "egress" does not shed light on which endpoints precisely can be considered as traffic sources. Add relevant deprecation notices and suggest the use of precise traffic source items (PORT_REPRESENTOR and REPRESENTED_PORT). Signed-off-by: Ivan Malov Acked-by: Ori Kam Acked-by: Andrew Rybchenko --- doc/guides/prog_guide/rte_flow.rst | 28 ++++++++---------- doc/guides/rel_notes/deprecation.rst | 9 +++--- doc/guides/rel_notes/release_21_11.rst | 3 ++ lib/ethdev/rte_flow.h | 41 ++++++++++++++++++++------ 4 files changed, 52 insertions(+), 29 deletions(-) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index d7185c49df..5957b8df4f 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -9,8 +9,8 @@ Overview -------- This API provides a generic means to configure hardware to match specific -ingress or egress traffic, alter its fate and query related counters -according to any number of user-defined rules. +traffic, alter its fate and query related counters according to any +number of user-defined rules. It is named *rte_flow* after the prefix used for all its symbols, and is defined in ``rte_flow.h``. @@ -146,13 +146,10 @@ Note that support for more than a single priority level is not guaranteed. Attribute: Traffic direction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Flow rule patterns apply to inbound and/or outbound traffic. - -In the context of this API, **ingress** and **egress** respectively stand -for **inbound** and **outbound** based on the standpoint of the application -creating a flow rule. - -There are no exceptions to this definition. +Unless `Attribute: Transfer`_ is specified, flow rule patterns apply +to inbound and / or outbound traffic. With this respect, ``ingress`` +and ``egress`` respectively stand for **inbound** and **outbound** +based on the standpoint of the application creating a flow rule. Several pattern items and actions are valid and can be used in both directions. At least one direction must be specified. @@ -171,12 +168,13 @@ When supported, this effectively enables an application to reroute traffic not necessarily intended for it (e.g. coming from or addressed to different physical ports, VFs or applications) at the device level. -It complements the behavior of some pattern items such as `Item: PHY_PORT`_ -and is meaningless without them. - -When transferring flow rules, **ingress** and **egress** attributes -(`Attribute: Traffic direction`_) keep their original meaning, as if -processing traffic emitted or received by the application. +In "transfer" flows, the use of `Attribute: Traffic direction`_ in the sense of +implicitly matching packets going to or going from the ethdev used to create +flow rules is **deprecated**. `Attribute: Transfer`_ shifts the viewpoint to +the embedded switch. In it, `Attribute: Traffic direction`_ is ambiguous as +the switch serves many different endpoints. The application should match +traffic originating from precise locations. To do so, it should +use `Item: PORT_REPRESENTOR`_ and `Item: REPRESENTED_PORT`_. Pattern item ~~~~~~~~~~~~ diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 25aec56bec..ef2e2c1141 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -113,11 +113,6 @@ Deprecation Notices to support modifying fields larger than 64 bits. In addition, documentation will be updated to clarify byte order. -* ethdev: Flow API documentation is unclear if ethdev port used to create - a flow rule adds any implicit match criteria in the case of transfer rules. - The semantics will be clarified in DPDK 21.11 and it will require fixes in - drivers and applications which interpret it in a different way. - * ethdev: The flow API matching pattern structures, ``struct rte_flow_item_*``, should start with relevant protocol header. Some matching pattern structures implements this by duplicating protocol header @@ -146,6 +141,10 @@ Deprecation Notices * ethdev: Items and actions ``PF``, ``VF``, ``PHY_PORT``, ``PORT_ID`` are deprecated as hard-to-use / ambiguous and will be removed in DPDK 22.11. +* ethdev: The use of attributes ``ingress`` / ``egress`` in "transfer" flows + is deprecated as ambiguous with respect to the embedded switch. The use of + these attributes will become invalid starting from DPDK 22.11. + * net: The structure ``rte_ipv4_hdr`` will have two unions. The first union is for existing ``version_ihl`` byte and new bitfield for version and IHL. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 75c4f6d018..45c019eb04 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -257,6 +257,9 @@ API Changes * ethdev: Deprecated items and actions ``PF``, ``VF``, ``PHY_PORT``, ``PORT_ID``. Suggested items and actions ``PORT_REPRESENTOR``, ``REPRESENTED_PORT`` instead. +* ethdev: Deprecated the use of attributes ``ingress`` / ``egress`` combined + with ``transfer``. See items ``PORT_REPRESENTOR``, ``REPRESENTED_PORT``. + ABI Changes ----------- diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 76653105a0..7e7b4bce5b 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -67,7 +67,10 @@ extern "C" { * Note that support for more than a single group and priority level is not * guaranteed. * - * Flow rules can apply to inbound and/or outbound traffic (ingress/egress). + * At vNIC / ethdev level, flow rules can apply to inbound and / or outbound + * traffic (ingress / egress), with respect to the vNIC / ethdev in question. + * At embedded switch level, flow rules apply to all traffic seen by it + * unless fitting meta items are used to set concrete traffic source(s). * * Several pattern items and actions are valid and can be used in both * directions. Those valid for only one direction are described as such. @@ -80,8 +83,32 @@ extern "C" { struct rte_flow_attr { uint32_t group; /**< Priority group. */ uint32_t priority; /**< Rule priority level within group. */ - uint32_t ingress:1; /**< Rule applies to ingress traffic. */ - uint32_t egress:1; /**< Rule applies to egress traffic. */ + /** + * The rule in question applies to ingress traffic (non-"transfer"). + * + * @deprecated + * It has been possible to combine this attribute with "transfer". + * Doing so has been assumed to restrict the scope of matching + * to traffic going from within the embedded switch toward the + * ethdev the flow rule being created through. This behaviour + * is deprecated. During the transition period, one may still + * rely on it, but PMDs and applications are encouraged to + * gradually move away from this approach. + */ + uint32_t ingress:1; + /** + * The rule in question applies to egress traffic (non-"transfer"). + * + * @deprecated + * It has been possible to combine this attribute with "transfer". + * Doing so has been assumed to restrict the scope of matching + * to traffic sent by the application by virtue of the ethdev + * the flow rule being created through. This behaviour is now + * deprecated. During the transition period, one may still + * rely on it, but PMDs and applications are encouraged to + * gradually move away from this approach. + */ + uint32_t egress:1; /** * Instead of simply matching the properties of traffic as it would * appear on a given DPDK port ID, enabling this attribute transfers @@ -93,12 +120,8 @@ struct rte_flow_attr { * from or addressed to different physical ports, VFs or * applications) at the device level. * - * It complements the behavior of some pattern items such as - * RTE_FLOW_ITEM_TYPE_PHY_PORT and is meaningless without them. - * - * When transferring flow rules, ingress and egress attributes keep - * their original meaning, as if processing traffic emitted or - * received by the application. + * The application should match traffic originating from precise + * locations. See items PORT_REPRESENTOR and REPRESENTED_PORT. */ uint32_t transfer:1; uint32_t reserved:29; /**< Reserved, must be zero. */ -- 2.20.1