enum mlx5dv_dr_domain_type { unused, };
struct mlx5dv_dr_domain;
struct mlx5dv_dr_action;
+#define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1
#endif
#ifndef HAVE_MLX5DV_DR_DEVX_PORT
(struct mlx5_flow_dv_modify_hdr_resource *)resource;
*action = mlx5_glue->dv_create_flow_action_modify_header
- (ctx, res->ft_type, domain, res->flags,
+ (ctx, res->ft_type, domain, res->root ?
+ MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL : 0,
actions_len, (uint64_t *)res->actions);
return (*action) ? 0 : -1;
}
void *action; /**< Modify header action object. */
/* Key area for hash list matching: */
uint8_t ft_type; /**< Flow table type, Rx or Tx. */
- uint32_t actions_num; /**< Number of modification actions. */
- uint64_t flags; /**< Flags for RDMA API. */
+ uint8_t actions_num; /**< Number of modification actions. */
+ bool root; /**< Whether action is in root table. */
struct mlx5_modification_cmd actions[];
/**< Modification actions. */
-};
+} __rte_packed;
/* Modify resource key of the hash organization. */
union mlx5_flow_modify_hdr_key {
*
* @param dev
* Pointer to rte_eth_dev structure.
- * @param flags
- * Flags bits to check if root level.
+ * @param root
+ * Whether action is on root table.
*
* @return
* Max number of modify header actions device can support.
*/
static inline unsigned int
flow_dv_modify_hdr_action_max(struct rte_eth_dev *dev __rte_unused,
- uint64_t flags)
+ bool root)
{
/*
* There's no way to directly query the max capacity from FW.
* The maximal value on root table should be assumed to be supported.
*/
- if (!(flags & MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL))
+ if (!root)
return MLX5_MAX_MODIFY_NUM;
else
return MLX5_ROOT_TBL_MODIFY_NUM;
};
uint64_t key64;
- resource->flags = dev_flow->dv.group ? 0 :
- MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL;
+ resource->root = !dev_flow->dv.group;
if (resource->actions_num > flow_dv_modify_hdr_action_max(dev,
- resource->flags))
+ resource->root))
return rte_flow_error_set(error, EOVERFLOW,
RTE_FLOW_ERROR_TYPE_ACTION, NULL,
"too many modify header items");