DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] ethdev: forbid the use of direction attr in transfer flows
@ 2022-09-30  9:42 Ivan Malov
  2022-09-30 10:42 ` Ori Kam
  0 siblings, 1 reply; 3+ messages in thread
From: Ivan Malov @ 2022-09-30  9:42 UTC (permalink / raw)
  To: dev
  Cc: Andrew Rybchenko, Ori Kam, Ray Kinsella, Thomas Monjalon, Ferruh Yigit

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(-)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index cb102633c2..2415dd7226 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -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
 ~~~~~~~~~~~~
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index b718784ad1..dc1e652d99 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -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.
diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
index 6d3b43aed2..88e8c49984 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -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
 -----------
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index fd802f87a2..d81b5426d2 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -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)) {
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 4598ccceaf..6d6c736a1b 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -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;
 	/**
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] ethdev: forbid the use of direction attr in transfer flows
  2022-09-30  9:42 [PATCH] ethdev: forbid the use of direction attr in transfer flows Ivan Malov
@ 2022-09-30 10:42 ` Ori Kam
  2022-10-04  2:02   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Ori Kam @ 2022-09-30 10:42 UTC (permalink / raw)
  To: Ivan Malov, dev
  Cc: Andrew Rybchenko, Ray Kinsella,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ethdev: forbid the use of direction attr in transfer flows
  2022-09-30 10:42 ` Ori Kam
@ 2022-10-04  2:02   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2022-10-04  2:02 UTC (permalink / raw)
  To: Ori Kam, Ivan Malov, dev
  Cc: Andrew Rybchenko, Ray Kinsella, NBU-Contact-Thomas Monjalon (EXTERNAL)

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-04  2:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-30  9:42 [PATCH] ethdev: forbid the use of direction attr in transfer flows Ivan Malov
2022-09-30 10:42 ` Ori Kam
2022-10-04  2:02   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).