mlx5dv_alloc_dm(3)

πŸ’– NAME πŸ’–

This is mlx5dv_alloc_dm(3), bestie β€” fresh out of the mlx5 Programmer’s Manual ✨

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. That’s the whole assignment, and it understood it πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

For context and dm_attr, please go look at the ibv_alloc_dm(3) man page β€” it’s all there, iykyk πŸ“–βœ¨

🧚 mlx5_dm_attr 🧚

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

⭐ type ⭐

This is the device memory type the user wishes to allocate, and there are so many vibes to choose from:

  • MLX5DV_DM_TYPE_MEMIC β€” Device memory of type MEMIC: on-chip memory that can be allocated and used as a memory region for transmitting/receiving packet directly from/to the memory on the chip. On-chip realness. πŸ”₯
  • 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. It can be used for direct table and steering rules creation when allocated by a privileged user. Privileged-user energy. πŸ‘‘
  • 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. It can be used for direct table and header modification rules creation when allocated by a privileged user. Header-modification icon behavior. 🧚
  • 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. It can be used for direct table and header modification rules creation when allocated by a privileged user. Patterns and templates, literally. 🌸
  • 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. It can be used for packet encap reformat rules creation when allocated by a privileged user. Encap data said slay. πŸ’…

πŸ”’ comp_mask πŸ”’

Bitmask specifying what fields in the structure are valid. Currently reserved and should be set to 0. No cap, just set it to zero πŸ™ˆ


🌈 RETURN VALUE 🌈

mlx5dv_alloc_dm() returns a pointer to the created DM. On error, NULL will be returned and errno will be set. Bestie, check that NULL and errno, fr fr. 😭


🫢 SEE ALSO 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Ariel Levkovich <lariel@mellanox.com> πŸ’Œ


Source/version: mlx5 🌟 Date: 2018-9-1 🌟 That’s the whole manual-page moment, bestie β€” go allocate some device memory and be iconic πŸ’œ

πŸ“¦ where this page comes from