From: Dekel Peled Date: Tue, 2 Jul 2019 14:17:26 +0000 (+0300) Subject: ethdev: allow action with any config object type X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f10409b766f9607ae45b5d3bad857c98e5e45a9d;p=dpdk.git ethdev: allow action with any config object type 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 Acked-by: Andrew Rybchenko Acked-by: Adrien Mazarguil --- diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index a68121dc68..bbe32db3f5 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 7fc04d22b0..bc41023e10 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: * @@ -2192,11 +2193,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. */ }; /**