[v2] ethdev: support action with any config object type

Message ID 5bde45006c2891f9942e1545e8cecf226908a5e1.1562075933.git.dekelp@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] ethdev: support action with any config object type |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Dekel Peled July 2, 2019, 2:17 p.m. UTC
  In current implementation, an action which requires parameters
must accept them enclosed in a structure.
Some actions require a single, trivial type parameter, but it still
must be enclosed in a structure.
This obligation results in multiple, action-specific structures, each
containing a single trivial type parameter.

This patch introduces a new approach, allowing an action configuration
object of any type, trivial or a structure.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>

---
v2: Remove test-pmd code update from this patch.
---

---
 doc/guides/prog_guide/rte_flow.rst |  5 +++--
 lib/librte_ethdev/rte_flow.h       | 11 ++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)
  

Comments

Andrew Rybchenko July 2, 2019, 3:07 p.m. UTC | #1
On 02.07.2019 17:17, Dekel Peled wrote:
> In current implementation, an action which requires parameters
> must accept them enclosed in a structure.
> Some actions require a single, trivial type parameter, but it still
> must be enclosed in a structure.
> This obligation results in multiple, action-specific structures, each
> containing a single trivial type parameter.
>
> This patch introduces a new approach, allowing an action configuration
> object of any type, trivial or a structure.
>
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
  
Adrien Mazarguil July 2, 2019, 3:15 p.m. UTC | #2
On Tue, Jul 02, 2019 at 05:17:26PM +0300, Dekel Peled wrote:
> In current implementation, an action which requires parameters
> must accept them enclosed in a structure.
> Some actions require a single, trivial type parameter, but it still
> must be enclosed in a structure.
> This obligation results in multiple, action-specific structures, each
> containing a single trivial type parameter.
> 
> This patch introduces a new approach, allowing an action configuration
> object of any type, trivial or a structure.
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
  
Ferruh Yigit July 3, 2019, 5:45 p.m. UTC | #3
On 7/2/2019 4:15 PM, Adrien Mazarguil wrote:
> On Tue, Jul 02, 2019 at 05:17:26PM +0300, Dekel Peled wrote:
>> In current implementation, an action which requires parameters
>> must accept them enclosed in a structure.
>> Some actions require a single, trivial type parameter, but it still
>> must be enclosed in a structure.
>> This obligation results in multiple, action-specific structures, each
>> containing a single trivial type parameter.
>>
>> This patch introduces a new approach, allowing an action configuration
>> object of any type, trivial or a structure.
>>
>> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> 

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index a34d012..67deed7 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1213,8 +1213,9 @@  Matches an application specific 32 bit metadata item.
 Actions
 ~~~~~~~
 
-Each possible action is represented by a type. Some have associated
-configuration structures. Several actions combined in a list can be assigned
+Each possible action is represented by a type.
+An action can have an associated configuration object.
+Several actions combined in a list can be assigned
 to a flow rule and are performed in order.
 
 They fall in three categories:
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index f3a8fb1..2232856 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -1244,9 +1244,10 @@  struct rte_flow_item {
 /**
  * Action types.
  *
- * Each possible action is represented by a type. Some have associated
- * configuration structures. Several actions combined in a list can be
- * assigned to a flow rule and are performed in order.
+ * Each possible action is represented by a type.
+ * An action can have an associated configuration object.
+ * Several actions combined in a list can be assigned
+ * to a flow rule and are performed in order.
  *
  * They fall in three categories:
  *
@@ -2136,11 +2137,11 @@  struct rte_flow_action_set_mac {
  *
  * A list of actions is terminated by a END action.
  *
- * For simple actions without a configuration structure, conf remains NULL.
+ * For simple actions without a configuration object, conf remains NULL.
  */
 struct rte_flow_action {
 	enum rte_flow_action_type type; /**< Action type. */
-	const void *conf; /**< Pointer to action configuration structure. */
+	const void *conf; /**< Pointer to action configuration object. */
 };
 
 /**