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 B3E3AA04B5; Sun, 4 Oct 2020 00:09:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 843B41C197; Sun, 4 Oct 2020 00:07:50 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 534D81C193 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:45 +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 093M6YLl018436; Sun, 4 Oct 2020 01:07:45 +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:17 +0300 Message-Id: <20201003220619.19231-9-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 08/10] net/mlx5: shared action create conf drv support 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 validate/create API. Currently the inly shared action implemented is RSS. For shared RSS action configuration argument ignpred but it can be utilized by other types of shared actions. Signed-off-by: Andrey Vesnovaty --- drivers/net/mlx5/mlx5_flow_dv.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 13effc0af0..2c39b061bb 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -9669,6 +9669,8 @@ __flow_dv_action_rss_setup(struct rte_eth_dev *dev, * * @param[in] dev * Pointer to the Ethernet device structure. + * @param[in] conf + * Shared action configuration. * @param[in] rss * RSS action specification used to create shared action. * @param[out] error @@ -9681,8 +9683,9 @@ __flow_dv_action_rss_setup(struct rte_eth_dev *dev, */ static struct rte_flow_shared_action * __flow_dv_action_rss_create(struct rte_eth_dev *dev, - const struct rte_flow_action_rss *rss, - struct rte_flow_error *error) + const struct rte_flow_shared_action_conf *conf, + const struct rte_flow_action_rss *rss, + struct rte_flow_error *error) { struct rte_flow_shared_action *shared_action = NULL; void *queue = NULL; @@ -9691,6 +9694,7 @@ __flow_dv_action_rss_create(struct rte_eth_dev *dev, struct rte_flow_action_rss *origin; const uint8_t *rss_key; + (void)conf; queue_size = RTE_ALIGN_CEIL(rss->queue_num * sizeof(uint16_t), sizeof(void *)); queue = rte_calloc(__func__, 1, queue_size, 0); @@ -9774,6 +9778,8 @@ __flow_dv_action_rss_release(struct rte_eth_dev *dev, * * @param[in] dev * Pointer to the Ethernet device structure. + * @param[in] conf + * Shared action configuration. * @param[in] action * Action specification used to create shared action. * @param[out] error @@ -9786,6 +9792,7 @@ __flow_dv_action_rss_release(struct rte_eth_dev *dev, */ static struct rte_flow_shared_action * __flow_dv_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) { @@ -9794,7 +9801,8 @@ __flow_dv_action_create(struct rte_eth_dev *dev, switch (action->type) { case RTE_FLOW_ACTION_TYPE_RSS: - shared_action = __flow_dv_action_rss_create(dev, action->conf, + shared_action = __flow_dv_action_rss_create(dev, conf, + action->conf, error); break; default: @@ -10647,6 +10655,8 @@ flow_dv_counter_free(struct rte_eth_dev *dev, uint32_t cnt) * * @param[in] dev * Pointer to the Ethernet device structure. + * @param[in] conf + * Shared action configuration. * @param[in] action * The shared action object to validate. * @param[out] error @@ -10658,9 +10668,11 @@ flow_dv_counter_free(struct rte_eth_dev *dev, uint32_t cnt) */ static int flow_dv_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) { + (void)conf; switch (action->type) { case RTE_FLOW_ACTION_TYPE_RSS: return mlx5_validate_action_rss(dev, action, error); @@ -10677,13 +10689,14 @@ flow_dv_action_validate(struct rte_eth_dev *dev, */ static struct rte_flow_shared_action * flow_dv_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) { struct rte_flow_shared_action *shared_action = NULL; flow_dv_shared_lock(dev); - shared_action = __flow_dv_action_create(dev, action, error); + shared_action = __flow_dv_action_create(dev, conf, action, error); flow_dv_shared_unlock(dev); return shared_action; } -- 2.26.2