* Pointer to the rte_eth_dev structure.
* @param[in] action_flags
* Holds the actions detected until now.
+ * @param[in] action
+ * Pointer to the action structure.
+ * @param[in] item_flags
+ * Holds the items detected.
* @param[in] attr
* Pointer to flow attributes
* @param[out] error
static int
flow_dv_validate_action_decap(struct rte_eth_dev *dev,
uint64_t action_flags,
+ const struct rte_flow_action *action,
+ const uint64_t item_flags,
const struct rte_flow_attr *attr,
struct rte_flow_error *error)
{
RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"decap action for VF representor "
"not supported on NIC table");
+ if (action->type == RTE_FLOW_ACTION_TYPE_VXLAN_DECAP &&
+ !(item_flags & MLX5_FLOW_LAYER_VXLAN))
+ return rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+ "VXLAN item should be present for VXLAN decap");
return 0;
}
* Holds the actions detected until now.
* @param[out] actions_n
* pointer to the number of actions counter.
+ * @param[in] action
+ * Pointer to the action structure.
+ * @param[in] item_flags
+ * Holds the items detected.
* @param[out] error
* Pointer to error structure.
*
const struct rte_flow_action_raw_decap *decap,
const struct rte_flow_action_raw_encap *encap,
const struct rte_flow_attr *attr, uint64_t *action_flags,
- int *actions_n, struct rte_flow_error *error)
+ int *actions_n, const struct rte_flow_action *action,
+ uint64_t item_flags, struct rte_flow_error *error)
{
const struct mlx5_priv *priv = dev->data->dev_private;
int ret;
"encap combination");
}
if (decap) {
- ret = flow_dv_validate_action_decap(dev, *action_flags, attr,
- error);
+ ret = flow_dv_validate_action_decap(dev, *action_flags, action,
+ item_flags, attr, error);
if (ret < 0)
return ret;
*action_flags |= MLX5_FLOW_ACTION_DECAP;
* Pointer to the Ethernet device structure.
* @param[in] attr
* Attributes of flow that includes this action.
+ * @param[in] item_flags
+ * Holds the items detected.
* @param[out] error
* Pointer to error structure.
*
const struct rte_flow_action *action,
struct rte_eth_dev *dev,
const struct rte_flow_attr *attr,
+ const uint64_t item_flags,
struct rte_flow_error *error)
{
struct mlx5_priv *priv = dev->data->dev_private;
case RTE_FLOW_ACTION_TYPE_RAW_ENCAP:
ret = flow_dv_validate_action_raw_encap_decap
(dev, NULL, act->conf, attr, &sub_action_flags,
- &actions_n, error);
+ &actions_n, action, item_flags, error);
if (ret < 0)
return ret;
++actions_n;
case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:
case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP:
ret = flow_dv_validate_action_decap(dev, action_flags,
+ actions, item_flags,
attr, error);
if (ret < 0)
return ret;
case RTE_FLOW_ACTION_TYPE_RAW_ENCAP:
ret = flow_dv_validate_action_raw_encap_decap
(dev, NULL, actions->conf, attr, &action_flags,
- &actions_n, error);
+ &actions_n, actions, item_flags, error);
if (ret < 0)
return ret;
break;
(dev,
decap ? decap : &empty_decap, encap,
attr, &action_flags, &actions_n,
- error);
+ actions, item_flags, error);
if (ret < 0)
return ret;
break;
case RTE_FLOW_ACTION_TYPE_SAMPLE:
ret = flow_dv_validate_action_sample(action_flags,
actions, dev,
- attr, error);
+ attr, item_flags,
+ error);
if (ret < 0)
return ret;
action_flags |= MLX5_FLOW_ACTION_SAMPLE;
sampler_attr.sample_actions = (struct mlx5dv_dr_action **)
&sample_dv_actions[0];
sampler_attr.action = cache_resource->set_action;
- cache_resource->verbs_action =
- mlx5_glue->dr_create_flow_action_sampler(&sampler_attr);
- if (!cache_resource->verbs_action) {
+ if (mlx5_os_flow_dr_create_flow_action_sampler
+ (&sampler_attr, &cache_resource->verbs_action)) {
rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, "cannot create sample action");
error:
if (cache_resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB &&
cache_resource->default_miss)
- claim_zero(mlx5_glue->destroy_flow_action
+ claim_zero(mlx5_flow_os_destroy_flow_action
(cache_resource->default_miss));
else
flow_dv_sample_sub_actions_release(dev,
struct mlx5dv_dr_domain *domain;
uint32_t idx = 0, res_idx = 0;
struct rte_flow_error *error = ctx->error;
+ int ret;
/* Register new destination array resource. */
cache_resource = mlx5_ipool_zmalloc(sh->ipool[MLX5_IPOOL_DEST_ARRAY],
}
}
/* create a dest array actioin */
- cache_resource->action = mlx5_glue->dr_create_flow_action_dest_array
+ ret = mlx5_os_flow_dr_create_flow_action_dest_array
(domain,
cache_resource->num_of_dest,
- dest_attr);
- if (!cache_resource->action) {
+ dest_attr,
+ &cache_resource->action);
+ if (ret) {
rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL,