+#define MLX5_ENCAP_MAX_LEN 132
+
+/* Encap/decap resource structure. */
+struct mlx5_flow_dv_encap_decap_resource {
+ LIST_ENTRY(mlx5_flow_dv_encap_decap_resource) next;
+ /* Pointer to next element. */
+ rte_atomic32_t refcnt; /**< Reference counter. */
+ void *verbs_action;
+ /**< Verbs encap/decap action object. */
+ uint8_t buf[MLX5_ENCAP_MAX_LEN];
+ size_t size;
+ uint8_t reformat_type;
+ uint8_t ft_type;
+ uint64_t flags; /**< Flags for RDMA API. */
+};
+
+/* Tag resource structure. */
+struct mlx5_flow_dv_tag_resource {
+ LIST_ENTRY(mlx5_flow_dv_tag_resource) next;
+ /* Pointer to next element. */
+ rte_atomic32_t refcnt; /**< Reference counter. */
+ void *action;
+ /**< Verbs tag action object. */
+ uint32_t tag; /**< the tag value. */
+};
+
+/*
+ * Number of modification commands.
+ * If extensive metadata registers are supported
+ * the maximal actions amount is 16 and 8 otherwise.
+ */
+#define MLX5_MODIFY_NUM 16
+#define MLX5_MODIFY_NUM_NO_MREG 8
+
+/* Modify resource structure */
+struct mlx5_flow_dv_modify_hdr_resource {
+ LIST_ENTRY(mlx5_flow_dv_modify_hdr_resource) next;
+ /* Pointer to next element. */
+ rte_atomic32_t refcnt; /**< Reference counter. */
+ struct ibv_flow_action *verbs_action;
+ /**< Verbs modify header action object. */
+ uint8_t ft_type; /**< Flow table type, Rx or Tx. */
+ uint32_t actions_num; /**< Number of modification actions. */
+ struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
+ /**< Modification actions. */
+ uint64_t flags; /**< Flags for RDMA API. */
+};
+
+/* Jump action resource structure. */
+struct mlx5_flow_dv_jump_tbl_resource {
+ LIST_ENTRY(mlx5_flow_dv_jump_tbl_resource) next;
+ /* Pointer to next element. */
+ rte_atomic32_t refcnt; /**< Reference counter. */
+ void *action; /**< Pointer to the rdma core action. */
+ uint8_t ft_type; /**< Flow table type, Rx or Tx. */
+ struct mlx5_flow_tbl_resource *tbl; /**< The target table. */
+};
+
+/* Port ID resource structure. */
+struct mlx5_flow_dv_port_id_action_resource {
+ LIST_ENTRY(mlx5_flow_dv_port_id_action_resource) next;
+ /* Pointer to next element. */
+ rte_atomic32_t refcnt; /**< Reference counter. */
+ void *action;
+ /**< Verbs tag action object. */
+ uint32_t port_id; /**< Port ID value. */
+};
+
+/* Push VLAN action resource structure */
+struct mlx5_flow_dv_push_vlan_action_resource {
+ LIST_ENTRY(mlx5_flow_dv_push_vlan_action_resource) next;
+ /* Pointer to next element. */
+ rte_atomic32_t refcnt; /**< Reference counter. */
+ void *action; /**< Direct verbs action object. */
+ uint8_t ft_type; /**< Flow table type, Rx, Tx or FDB. */
+ rte_be32_t vlan_tag; /**< VLAN tag value. */
+};
+
+/* Metadata register copy table entry. */
+struct mlx5_flow_mreg_copy_resource {
+ /*
+ * Hash list entry for copy table.
+ * - Key is 32/64-bit MARK action ID.
+ * - MUST be the first entry.
+ */
+ struct mlx5_hlist_entry hlist_ent;
+ LIST_ENTRY(mlx5_flow_mreg_copy_resource) next;
+ /* List entry for device flows. */
+ uint32_t refcnt; /* Reference counter. */
+ uint32_t appcnt; /* Apply/Remove counter. */
+ struct rte_flow *flow; /* Built flow for copy. */
+};
+
+/*
+ * Max number of actions per DV flow.
+ * See CREATE_FLOW_MAX_FLOW_ACTIONS_SUPPORTED
+ * In rdma-core file providers/mlx5/verbs.c
+ */
+#define MLX5_DV_MAX_NUMBER_OF_ACTIONS 8
+