From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 89EB1A04B5; Sun, 4 Oct 2020 00:07:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 605981BFE8; Sun, 4 Oct 2020 00:07:19 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id AD9861BFBB for ; Sun, 4 Oct 2020 00:07:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from andreyv@nvidia.com) with SMTP; 4 Oct 2020 01:07:13 +0300 Received: from nvidia.com (r-arch-host11.mtr.labs.mlnx [10.213.43.60]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 093M6YLf018436; Sun, 4 Oct 2020 01:07:13 +0300 From: Andrey Vesnovaty To: dev@dpdk.org Cc: jer@marvell.com, jerinjacobk@gmail.com, thomas@monjalon.net, ferruh.yigit@intel.com, stephen@networkplumber.org, bruce.richardson@intel.com, orika@nvidia.com, viacheslavo@nvidia.com, andrey.vesnovaty@gmail.com, mdr@ashroe.eu, nhorman@tuxdriver.com, ajit.khaparde@broadcom.com, samik.gupta@broadcom.com, Ori Kam , Andrew Rybchenko Date: Sun, 4 Oct 2020 01:06:11 +0300 Message-Id: <20201003220619.19231-3-andreyv@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201003220619.19231-1-andreyv@nvidia.com> References: <20201003220619.19231-1-andreyv@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 02/10] ethdev: add conf arg to shared action icreate API 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" Add configuration argument to shared action create interface. Currently there is only ingress & egress fields but more fields can be added later. Shared action configuration & implementation are PMD specific. Signed-off-by: Andrey Vesnovaty --- lib/librte_ethdev/rte_flow.c | 4 +++- lib/librte_ethdev/rte_flow.h | 17 +++++++++++++++-- lib/librte_ethdev/rte_flow_driver.h | 5 +++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c index ba3f01f7c7..9afa8905df 100644 --- a/lib/librte_ethdev/rte_flow.c +++ b/lib/librte_ethdev/rte_flow.c @@ -1255,6 +1255,7 @@ rte_flow_get_aged_flows(uint16_t port_id, void **contexts, struct rte_flow_shared_action * rte_flow_shared_action_create(uint16_t port_id, + const struct rte_flow_shared_action_conf *conf, const struct rte_flow_action *action, struct rte_flow_error *error) { @@ -1265,7 +1266,8 @@ rte_flow_shared_action_create(uint16_t port_id, if (unlikely(!ops)) return NULL; if (likely(!!ops->shared_action_create)) { - shared_action = ops->shared_action_create(dev, action, error); + shared_action = ops->shared_action_create(dev, conf, action, + error); if (shared_action == NULL) flow_err(port_id, -rte_errno, error); return shared_action; diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index 02391316cb..8a2db4f6da 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -3380,6 +3380,16 @@ int rte_flow_get_aged_flows(uint16_t port_id, void **contexts, uint32_t nb_contexts, struct rte_flow_error *error); +/** + * Specify shared action configuration + */ +struct rte_flow_shared_action_conf { + uint32_t ingress:1; + /**< Action valid for rules applied to ingress traffic. */ + uint32_t egress:1; + /**< Action valid for rules applied to egress traffic. */ +}; + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. @@ -3388,6 +3398,8 @@ rte_flow_get_aged_flows(uint16_t port_id, void **contexts, * * @param[in] port_id * The port identifier of the Ethernet device. + * @param[in] conf + * Shared action configuration. * @param[in] action * Action configuration for shared action creation. * @param[out] error @@ -3404,6 +3416,7 @@ rte_flow_get_aged_flows(uint16_t port_id, void **contexts, __rte_experimental struct rte_flow_shared_action * rte_flow_shared_action_create(uint16_t port_id, + const struct rte_flow_shared_action_conf *conf, const struct rte_flow_action *action, struct rte_flow_error *error); @@ -3432,8 +3445,8 @@ rte_flow_shared_action_create(uint16_t port_id, __rte_experimental int rte_flow_shared_action_destroy(uint16_t port_id, - struct rte_flow_shared_action *action, - struct rte_flow_error *error); + struct rte_flow_shared_action *action, + struct rte_flow_error *error); /** * @warning diff --git a/lib/librte_ethdev/rte_flow_driver.h b/lib/librte_ethdev/rte_flow_driver.h index 72bfc3b7a7..adaace47ea 100644 --- a/lib/librte_ethdev/rte_flow_driver.h +++ b/lib/librte_ethdev/rte_flow_driver.h @@ -111,8 +111,9 @@ struct rte_flow_ops { /** See rte_flow_shared_action_create() */ struct rte_flow_shared_action *(*shared_action_create) (struct rte_eth_dev *dev, - const struct rte_flow_action *action, - struct rte_flow_error *error); + const struct rte_flow_shared_action_conf *conf, + const struct rte_flow_action *action, + struct rte_flow_error *error); /** See rte_flow_shared_action_destroy() */ int (*shared_action_destroy) (struct rte_eth_dev *dev, -- 2.26.2