[dpdk-dev] [PATCH v3 06/10] net/mlx5: shared action PMD create conf arg
Andrey Vesnovaty
andreyv at nvidia.com
Sun Oct 4 00:06:15 CEST 2020
Add support for configuration argument in shared action create API.
Configuration structure forwarded to verbs/devx layer.
Signed-off-by: Andrey Vesnovaty <andreyv at nvidia.com>
---
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
More information about the dev
mailing list