ethdev: forbid direction attribute in transfer flow rules

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>
This commit is contained in:
Ivan Malov 2022-09-30 12:42:48 +03:00 committed by Ferruh Yigit
parent 8ff9bb8aff
commit bd2a4d4b2e
5 changed files with 13 additions and 29 deletions

View File

@ -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
~~~~~~~~~~~~

View File

@ -97,10 +97,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_DEC_NW_TTL``, ``SET_IPV4_SRC``, ``SET_IPV4_DST``,
``SET_IPV6_SRC``, ``SET_IPV6_DST``, ``SET_TP_SRC``, ``SET_TP_DST``,
``DEC_TTL``, ``SET_TTL``, ``SET_MAC_SRC``, ``SET_MAC_DST``, ``INC_TCP_SEQ``,

View File

@ -283,6 +283,10 @@ API Changes
* ethdev: Promoted ``rte_flow_pick_transfer_proxy()``
from experimental to stable.
* 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``.
* cryptodev: The structure ``rte_cryptodev_sym_session`` was made internal.
The API ``rte_cryptodev_sym_session_init`` and ``rte_cryptodev_sym_session_clear``
were removed and user would only need to call ``rte_cryptodev_sym_session_create``

View File

@ -348,6 +348,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)) {

View File

@ -89,28 +89,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;
/**