---
name: "mlx5dv_alloc_dm"
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_alloc_dm"
---

# mlx5dv\_alloc\_dm(3)

allocates device memory (DM)

## NAME

mlx5dv\_alloc\_dm - allocates device memory (DM)

## SYNOPSIS

-

  ```
  #include <infiniband/mlx5dv.h>
  struct ibv_dm *mlx5dv_alloc_dm(struct ibv_context *context,
                     struct ibv_alloc_dm_attr *dm_attr,
                     struct mlx5dv_alloc_dm_attr *mlx5_dm_attr)
  ```

## DESCRIPTION

**mlx5dv\_alloc\_dm()** allocates device memory (DM) with specific driver properties.

## ARGUMENTS

Please see *[ibv\_alloc\_dm(3)](/ibv_alloc_dm/3.md)* man page for *context* and *dm\_attr*.

### mlx5\_dm\_attr

-

  ```
  struct mlx5dv_alloc_dm_attr {
      enum mlx5dv_alloc_dm_type type;
      uint64_t comp_mask;
  };
  ```

- *type*

  The device memory type user wishes to allocate:

  MLX5DV\_DM\_TYPE\_MEMIC Device memory of type MEMIC - On-Chip memory that can be allocated and used as memory region for transmitting/receiving packet directly from/to the memory on the chip. MLX5DV\_DM\_TYPE\_STEERING\_SW\_ICM Device memory of type STEERING SW ICM - This memory is used by the device to store the packet steering tables and rules. Can be used for direct table and steering rules creation when allocated by a privileged user. MLX5DV\_DM\_TYPE\_HEADER\_MODIFY\_SW\_ICM Device memory of type HEADER MODIFY SW ICM - This memory is used by the device to store the packet header modification tables and rules. Can be used for direct table and header modification rules creation when allocated by a privileged user. MLX5DV\_DM\_TYPE\_HEADER\_MODIFY\_PATTERN\_SW\_ICM Device memory of type HEADER MODIFY PATTERN SW ICM - This memory is used by the device to store packet header modification patterns/templates. Can be used for direct table and header modification rules creation when allocated by a privileged user. MLX5DV\_DM\_TYPE\_ENCAP\_SW\_ICM Device memory of type PACKET ENCAP SW ICM - This memory is used by the device to store packet encap data. Can be used for packet encap reformat rules creation when allocated by a privileged user.

- *comp\_mask*

  Bitmask specifying what fields in the structure are valid: Currently reserved and should be set to 0.

## RETURN VALUE

**mlx5dv\_alloc\_dm()** returns a pointer to the created DM, on error NULL will be returned and errno will be set.

## SEE ALSO

[**ibv\_alloc\_dm**(3)](/ibv_alloc_dm/3.md),

## AUTHOR

Ariel Levkovich ⟨lariel@mellanox.com⟩\\c
