---
name: "mlx5dv_create_flow"
section: "3"
platform: "linux"
package: "rdma-core"
version: "65.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mlx5dv_create_flow"
---

# mlx5dv\_create\_flow(3)

creates a steering flow rule

## NAME

mlx5dv\_create\_flow - creates a steering flow rule

## SYNOPSIS

-

  ```
  #include <infiniband/mlx5dv.h>
  struct ibv_flow *
  mlx5dv_create_flow(struct mlx5dv_flow_matcher *flow_matcher,
             struct mlx5dv_flow_match_parameters *match_value,
             size_t num_actions,
             struct mlx5dv_flow_action_attr actions_attr[])
  ```

## DESCRIPTION

**mlx5dv\_create\_flow()** creates a steering flow rule with the ability to specify specific driver properties.

## ARGUMENTS

Please see *[mlx5dv\_create\_flow\_matcher(3)](/mlx5dv_create_flow_matcher/3.md)* for *flow\_matcher* and *match\_value*.

- *num\_actions*

  Specifies how many actions are passed in *actions\_attr*

### *actions\_attr*

-

  ```
  struct mlx5dv_flow_action_attr {
      enum mlx5dv_flow_action_type type;
      union {
          struct ibv_qp *qp;
          struct ibv_counters *counter;
          struct ibv_flow_action *action;
          uint32_t tag_value;
          struct mlx5dv_devx_obj *obj;
          struct {
              struct mlx5dv_devx_obj *obj;
              uint32_t offset;
          } bulk_obj;
      };
  };
  ```

- *type*

  MLX5DV\_FLOW\_ACTION\_DEST\_IBV\_QP The QP passed will receive the matched packets. MLX5DV\_FLOW\_ACTION\_IBV\_FLOW\_ACTION The flow action to be applied. MLX5DV\_FLOW\_ACTION\_TAG Flow tag to be provided in work completion. MLX5DV\_FLOW\_ACTION\_DEST\_DEVX The DEVX destination object for the matched packets. MLX5DV\_FLOW\_ACTION\_COUNTERS\_DEVX The DEVX counter object for the matched packets. MLX5DV\_FLOW\_ACTION\_DEFAULT\_MISS Steer the packet to the default miss destination. MLX5DV\_FLOW\_ACTION\_DROP Action is dropping the matched packet. MLX5DV\_FLOW\_ACTION\_COUNTERS\_DEVX\_WITH\_OFFSET The DEVX bulk counter object and its counter offset for the matched packets.

- *qp*

  QP passed, to be used with *type* *MLX5DV\_FLOW\_ACTION\_DEST\_IBV\_QP*.

- *action*

  Flow action, to be used with *type* *MLX5DV\_FLOW\_ACTION\_IBV\_FLOW\_ACTION* see *[mlx5dv\_create\_flow\_action\_modify\_header(3)](/mlx5dv_create_flow_action_modify_header/3.md)* and *[mlx5dv\_create\_flow\_action\_packet\_reformat(3)](/mlx5dv_create_flow_action_packet_reformat/3.md)*.

- *tag\_value*

  tag value to be passed in the work completion, to be used with *type* *MLX5DV\_FLOW\_ACTION\_TAG* see *[ibv\_create\_cq\_ex(3)](/ibv_create_cq_ex/3.md)*.

- *obj*

  DEVX object, to be used with *type* *MLX5DV\_FLOW\_ACTION\_DEST\_DEVX* or by *MLX5DV\_FLOW\_ACTION\_COUNTERS\_DEVX* or by *MLX5DV\_FLOW\_ACTION\_COUNTERS\_DEVX\_WITH\_OFFSET*.

- *offset*

  offset to the target counter within a bulk DEVX object, to be used with *type* *MLX5DV\_FLOW\_ACTION\_COUNTERS\_DEVX\_WITH\_OFFSET*

## RETURN VALUE

**mlx5dv\_create\_flow** returns a pointer to the created flow rule, on error NULL will be returned and errno will be set.

## SEE ALSO

*[mlx5dv\_create\_flow\_action\_modify\_header(3)](/mlx5dv_create_flow_action_modify_header/3.md)*, *[mlx5dv\_create\_flow\_action\_packet\_reformat(3)](/mlx5dv_create_flow_action_packet_reformat/3.md)*, *[mlx5dv\_create\_flow\_matcher(3)](/mlx5dv_create_flow_matcher/3.md)*, *[mlx5dv\_create\_qp(3)](/mlx5dv_create_qp/3.md)*, *[ibv\_create\_qp\_ex(3)](/ibv_create_qp_ex/3.md)* *[ibv\_create\_cq\_ex(3)](/ibv_create_cq_ex/3.md)* *[ibv\_create\_counters(3)](/ibv_create_counters/3.md)*

## AUTHOR

Mark Bloch ⟨marb@mellanox.com⟩\\c
