ethdev: forbid the use of direction attr in transfer flows
Checks
Commit Message
As part of DPDK 21.11 release, it was announced that the
use of attributes 'ingress' and 'egress' in 'transfer'
rules was deprecated. The transition period is over.
Starting from DPDK 22.11, the use of direction attributes
with attribute 'transfer' is not allowed. To enforce that,
a generic check is added to flow rule validate API.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
doc/guides/prog_guide/rte_flow.rst | 9 ++-------
doc/guides/rel_notes/deprecation.rst | 4 ----
doc/guides/rel_notes/release_22_11.rst | 4 ++++
lib/ethdev/rte_flow.c | 7 +++++++
lib/ethdev/rte_flow.h | 18 ------------------
5 files changed, 13 insertions(+), 29 deletions(-)
Comments
Hi Ivan,
> -----Original Message-----
> From: Ivan Malov <ivan.malov@oktetlabs.ru>
> Sent: Friday, 30 September 2022 12:43
>
> As part of DPDK 21.11 release, it was announced that the
> use of attributes 'ingress' and 'egress' in 'transfer'
> rules was deprecated. The transition period is over.
>
> Starting from DPDK 22.11, the use of direction attributes
> with attribute 'transfer' is not allowed. To enforce that,
> a generic check is added to flow rule validate API.
>
> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
On 9/30/2022 11:42 AM, Ori Kam wrote:
>
> Hi Ivan,
>
>> -----Original Message-----
>> From: Ivan Malov <ivan.malov@oktetlabs.ru>
>> Sent: Friday, 30 September 2022 12:43
>>
>> As part of DPDK 21.11 release, it was announced that the
>> use of attributes 'ingress' and 'egress' in 'transfer'
>> rules was deprecated. The transition period is over.
>>
>> Starting from DPDK 22.11, the use of direction attributes
>> with attribute 'transfer' is not allowed. To enforce that,
>> a generic check is added to flow rule validate API.
>>
>> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
>> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>> ---
>
> Acked-by: Ori Kam <orika@nvidia.com>
Applied to dpdk-next-net/main, thanks.
@@ -204,13 +204,8 @@ 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.
-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`_.
+In "transfer" flows, the use of `Attribute: Traffic direction`_ in not allowed.
+One may use `Item: PORT_REPRESENTOR`_ and `Item: REPRESENTED_PORT`_ instead.
Pattern item
~~~~~~~~~~~~
@@ -101,10 +101,6 @@ 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.
-
* ethdev: Actions ``OF_SET_MPLS_TTL``, ``OF_DEC_MPLS_TTL``, ``OF_SET_NW_TTL``,
``OF_COPY_TTL_OUT``, ``OF_COPY_TTL_IN`` are deprecated as not supported by
any PMD, so they will be removed in DPDK 22.11.
@@ -223,6 +223,10 @@ API Changes
* raw/ifgpa: The function ``rte_pmd_ifpga_get_pci_bus`` has been removed.
+* ethdev: Banned the use of attributes ``ingress``/``egress`` in "transfer"
+ flows, as the final step of deprecation process that had been started
+ in DPDK 21.11. See items ``PORT_REPRESENTOR``, ``REPRESENTED_PORT``.
+
ABI Changes
-----------
@@ -355,6 +355,13 @@ rte_flow_validate(uint16_t port_id,
struct rte_eth_dev *dev = &rte_eth_devices[port_id];
int ret;
+ if (likely(!!attr) && attr->transfer &&
+ (attr->ingress || attr->egress)) {
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ATTR,
+ attr, "cannot use attr ingress/egress with attr transfer");
+ }
+
if (unlikely(!ops))
return -rte_errno;
if (likely(!!ops->validate)) {
@@ -88,28 +88,10 @@ struct rte_flow_attr {
uint32_t priority; /**< Rule priority level within group. */
/**
* 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;
/**