From patchwork Tue Jul 2 14:17:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dekel Peled X-Patchwork-Id: 55882 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CFE671B9C0; Tue, 2 Jul 2019 16:18:27 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 24C8A1B9BF for ; Tue, 2 Jul 2019 16:18:26 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from dekelp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 2 Jul 2019 17:18:25 +0300 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.128.130.87]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x62EIOlB021525; Tue, 2 Jul 2019 17:18:24 +0300 From: Dekel Peled To: adrien.mazarguil@6wind.com, wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com, yskoh@mellanox.com, shahafs@mellanox.com, viacheslavo@mellanox.com, arybchenko@solarflare.com Cc: dev@dpdk.org, orika@mellanox.com Date: Tue, 2 Jul 2019 17:17:26 +0300 Message-Id: <5bde45006c2891f9942e1545e8cecf226908a5e1.1562075933.git.dekelp@mellanox.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1389143e204e85c90b4fc124f9e561f43f78175e.1561989889.git.dekelp@mellanox.com> References: <1389143e204e85c90b4fc124f9e561f43f78175e.1561989889.git.dekelp@mellanox.com> Subject: [dpdk-dev] [PATCH v2] ethdev: support action with any config object type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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(-) 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. */ }; /**