---
name: "mlx5dv_create_flow_matcher"
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_matcher"
---

# mlx5dv\_create\_flow\_matcher(3)

creates a matcher to be used with mlx5dv\_create\_flow(3)

## NAME

mlx5dv\_create\_flow\_matcher - creates a matcher to be used with *[mlx5dv\_create\_flow(3)](/mlx5dv_create_flow/3.md)*

## SYNOPSIS

-

  ```
  #include <infiniband/mlx5dv.h>
  struct mlx5dv_flow_matcher *
  mlx5dv_create_flow_matcher(struct ibv_context *context,
                 struct mlx5dv_flow_matcher_attr *attr)
  ```

## DESCRIPTION

**mlx5dv\_create\_flow\_matcher()** creates a flow matcher (mask) to be used with *[mlx5dv\_create\_flow(3)](/mlx5dv_create_flow/3.md)*.

## ARGUMENTS

Please see *[ibv\_open\_device(3)](/ibv_open_device/3.md)* for *context*.

### *attr*

-

  ```
  struct mlx5dv_flow_matcher_attr {
      enum ibv_flow_attr_type type;
      uint32_t flags; /* From enum ibv_flow_flags */
      uint16_t priority;
      uint8_t match_criteria_enable; /* Device spec format */
      struct mlx5dv_flow_match_parameters *match_mask;
      uint64_t comp_mask;
      enum mlx5dv_flow_table_type ft_type;
      uint32_t ib_port;
  };
  ```

- *type*

  Type of matcher to be created: IBV\_FLOW\_ATTR\_NORMAL: Normal rule according to specification.

- *flags*

  special flags to control rule: 0: Nothing or zero value means matcher will store ingress flow rules. IBV\_FLOW\_ATTR\_FLAGS\_EGRESS: Specified this matcher will store egress flow rules.

- *priority*

  See *[ibv\_create\_flow(3)](/ibv_create_flow/3.md)*.

- *match\_criteria\_enable*

  What match criteria is configured in *match\_mask*, passed in device spec format.

### *match\_mask*

-

  ```
  struct mlx5dv_flow_match_parameters {
      size_t match_sz;
      uint64_t match_buf[]; /* Device spec format */
  };
  ```

- *match\_sz*

  Size in bytes of *match\_buf*.

- *match\_buf*

  Set which mask to be used, passed in device spec format.

- *comp\_mask*

  MLX5DV\_FLOW\_MATCHER\_MASK\_FT\_TYPE for *ft\_type*

  MLX5DV\_FLOW\_MATCHER\_MASK\_IB\_PORT for *ib\_port*

### *ft\_type*

Specified in which flow table type, the matcher will store the flow rules: MLX5DV\_FLOW\_TABLE\_TYPE\_NIC\_RX: Specified this matcher will store ingress flow rules. MLX5DV\_FLOW\_TABLE\_TYPE\_NIC\_TX Specified this matcher will store egress flow rules. MLX5DV\_FLOW\_TABLE\_TYPE\_FDB : Specified this matcher will store FDB rules. MLX5DV\_FLOW\_TABLE\_TYPE\_RDMA\_RX: Specified this matcher will store ingress RDMA flow rules. MLX5DV\_FLOW\_TABLE\_TYPE\_RDMA\_TX: Specified this matcher will store egress RDMA flow rules. MLX5DV\_FLOW\_TABLE\_TYPE\_RDMA\_TRANSPORT\_RX: Specified this matcher will store RDMA transport domain flow rules. MLX5DV\_FLOW\_TABLE\_TYPE\_RDMA\_TRANSPORT\_TX: Specified this matcher will store RDMA transport domain flow rules.

### *ib\_port*

Specified to which vport attach the matcher, this is valid and required only when creating the steering RDMA transport domain flow table: MLX5DV\_FLOW\_TABLE\_TYPE\_RDMA\_TRANSPORT\_RX MLX5DV\_FLOW\_TABLE\_TYPE\_RDMA\_TRANSPORT\_TX

## RETURN VALUE

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

## SEE ALSO

*[ibv\_open\_device(3)](/ibv_open_device/3.md)*, *[ibv\_create\_flow(3)](/ibv_create_flow/3.md)*

## AUTHOR

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