Wrap glue call dr_create_flow_action_default_miss() with an OS API. This
commit is a follow up on [1].
[1]
commit
d4d85aa6f13a ("common/mlx5: add default miss action")
commit
b293fbf9672b ("net/mlx5: add OS specific flow actions operations")
Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
return (*action) ? 0 : -1;
}
+/**
+ * Create flow action: default miss.
+ *
+ * @param[out] action
+ * Pointer to a valid action on success, NULL otherwise.
+ *
+ * @return
+ * 0 on success, or -1 on failure and errno is set.
+ */
+static inline int
+mlx5_flow_os_create_flow_action_default_miss(void **action)
+{
+ *action = mlx5_glue->dr_create_flow_action_default_miss();
+ return (*action) ? 0 : -1;
+}
+
/**
* Destroy flow action.
*
"for sample");
goto error;
}
+ int ret;
+
cache_resource->normal_path_tbl = tbl;
if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB) {
- cache_resource->default_miss =
- mlx5_glue->dr_create_flow_action_default_miss();
- if (!cache_resource->default_miss) {
+ ret = mlx5_flow_os_create_flow_action_default_miss
+ (&cache_resource->default_miss);
+ if (!ret) {
rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL,