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 918E1A04B5; Sun, 4 Oct 2020 00:08:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC8521C191; Sun, 4 Oct 2020 00:07:48 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 3417D1C190 for ; Sun, 4 Oct 2020 00:07:48 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from andreyv@nvidia.com) with SMTP; 4 Oct 2020 01:07:42 +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 093M6YLj018436; Sun, 4 Oct 2020 01:07:42 +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, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Date: Sun, 4 Oct 2020 01:06:15 +0300 Message-Id: <20201003220619.19231-7-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 06/10] net/mlx5: shared action PMD create conf arg 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 support for configuration argument in shared action create API. Configuration structure forwarded to verbs/devx layer. Signed-off-by: Andrey Vesnovaty --- drivers/net/mlx5/mlx5_flow.c | 23 ++++++++++++++--------- drivers/net/mlx5/mlx5_flow.h | 9 ++++++--- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5757f146b4..5d1d504b21 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -222,6 +222,7 @@ static const struct rte_flow_expand_node mlx5_support_expansion[] = { static struct rte_flow_shared_action * mlx5_shared_action_create(struct rte_eth_dev *dev, + const struct rte_flow_shared_action_conf *conf, const struct rte_flow_action *action, struct rte_flow_error *error); static int mlx5_shared_action_destroy @@ -6544,23 +6545,26 @@ flow_drv_dv_ops_get(struct rte_eth_dev *dev, /* Wrapper for driver action_validate op callback */ static int flow_drv_action_validate(struct rte_eth_dev *dev, + const struct rte_flow_shared_action_conf *conf, const struct rte_flow_action *action, struct rte_flow_error *error) { const struct mlx5_flow_driver_ops *fops = flow_drv_dv_ops_get(dev, "action registration unsupported", error); - return (fops) ? fops->action_validate(dev, action, error) : -rte_errno; + return (fops) ? fops->action_validate(dev, conf, action, error) + : -rte_errno; } /* Wrapper for driver action_create op callback */ static struct rte_flow_shared_action * flow_drv_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) { const struct mlx5_flow_driver_ops *fops = flow_drv_dv_ops_get(dev, "action registration unsupported", error); - return (fops) ? fops->action_create(dev, action, error) : NULL; + return (fops) ? fops->action_create(dev, conf, action, error) : NULL; } /** @@ -6618,12 +6622,13 @@ flow_drv_action_update(struct rte_eth_dev *dev, */ static struct rte_flow_shared_action * mlx5_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) { - if (flow_drv_action_validate(dev, action, error)) + if (flow_drv_action_validate(dev, conf, action, error)) return NULL; - return flow_drv_action_create(dev, action, error); + return flow_drv_action_create(dev, conf, action, error); } /** @@ -6663,7 +6668,7 @@ mlx5_shared_action_update(struct rte_eth_dev *dev, NULL, "update action type invalid"); } - ret = flow_drv_action_validate(dev, action, error); + ret = flow_drv_action_validate(dev, NULL, action, error); if (ret) return ret; return flow_drv_action_update(dev, shared_action, action->conf, diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index e6ada24943..c7be77b961 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -955,11 +955,14 @@ typedef int (*mlx5_flow_get_aged_flows_t) void **context, uint32_t nb_contexts, struct rte_flow_error *error); -typedef int (*mlx5_flow_action_validate_t)(struct rte_eth_dev *dev, - const struct rte_flow_action *action, - struct rte_flow_error *error); +typedef int (*mlx5_flow_action_validate_t) + (struct rte_eth_dev *dev, + const struct rte_flow_shared_action_conf *conf, + const struct rte_flow_action *action, + struct rte_flow_error *error); typedef struct rte_flow_shared_action *(*mlx5_flow_action_create_t) (struct rte_eth_dev *dev, + const struct rte_flow_shared_action_conf *conf, const struct rte_flow_action *action, struct rte_flow_error *error); typedef int (*mlx5_flow_action_destroy_t) -- 2.26.2