Hi,

On 30/10/2020 18:49, Xueming(Steven) Li wrote:
Hi Ivan,

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ivan Malov
Sent: Thursday, October 29, 2020 7:47 PM
To: [email protected]
Cc: Ori Kam <[email protected]>; NBU-Contact-Thomas Monjalon
<[email protected]>; Ferruh Yigit <[email protected]>; Andrew
Rybchenko <[email protected]>
Subject: [dpdk-dev] [PATCH 1/2] ethdev: introduce transfer attribute to
shared action conf

In a flow rule, attribute "transfer" means operation level at which both traffic
is matched and actions are conducted.

Add the very same attribute to shared action configuration.
If a driver needs to prepare HW resources in two different ways, depending
on the operation level, in order to set up an action, then this new attribute
will indicate the level.
Also, when handling a flow rule insertion, the driver will be able to turn
down a shared action if its level is unfit.
Most actions apply to both level, rss and queue action applies on non-transfer 
level,
Port action applies to transfer level. Is there a particular scenario for this 
new attribute?

Most doesn't mean all, and you've already described some of the exceptions. And that's exactly the deal. Particular scenarios are don't cares given the fact that such an attribute is meant to be a generic solution. If an action happens to be supported on both levels, this doesn't necessarily mean that HW resources/objects that need to be prepared in the two cases are of the same type (or programmed to the NIC the same way). This is exactly what applies to flow rules (which do have attribute transfer) and what should be done to shared action conf, too.

If this still seems vague, please let me know.



Signed-off-by: Ivan Malov <[email protected]>
---
  lib/librte_ethdev/rte_flow.h | 7 +++++++
  1 file changed, 7 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index
a8eac4deb..0b993d8eb 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -3487,6 +3487,13 @@ struct rte_flow_shared_action_conf {
        /**< Action valid for rules applied to ingress traffic. */
        uint32_t egress:1;
        /**< Action valid for rules applied to egress traffic. */
+
+       /**
+        * This attribute matches that of the flow rules which
+        * are supposed to comprise the given shared action.
+        * See struct rte_flow_attr.
+        */
+       uint32_t transfer:1;
  };

  /**
--
2.20.1

--
Ivan M

Reply via email to