mlx5dv_create_st..._steering_anchor(3)

okay bestie, welcome to the mlx5dv_create_st..._steering_anchor(3) manual page β€” this is the one about steering anchors, and yes we’re gonna make it make sense πŸ’…βœ¨

πŸ’– NAME πŸ’–

mlx5dv_create_steering_anchor β€” creates a steering anchor, no cap 🫢

mlx5dv_destroy_steering_anchor β€” destroys a steering anchor, periodt πŸ’€


✨ SYNOPSIS ✨

#include <infiniband/mlx5dv.h>

struct mlx5dv_steering_anchor *
mlx5dv_create_steering_anchor(struct ibv_context *context,
                              struct mlx5dv_steering_anchor_attr *attr);

int mlx5dv_destroy_steering_anchor(struct mlx5dv_steering_anchor *sa);

🌸 DESCRIPTION 🌸

So the vibe is: a user can take packets into a user-configured sandbox and do packet processing there. At the end of that little journey, a steering pipeline decision is made about what to do with the packet. Iconic, honestly 🌈

A steering anchor lets the user reinject the packet back into the kernel for additional processing. Like sending it back home for extra glow-up time 🧚

mlx5dv_create_steering_anchor() creates an anchor that will allow injecting the packet back into the kernel steering pipeline. Obsessed with the pipeline re-entry moment πŸ’«

mlx5dv_destroy_steering_anchor() destroys a steering anchor. Cleanup queen behavior πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

context

The device context to associate the steering anchor with. Basically: which device is this anchor gonna be linked to, bestie? πŸ¦‹

attr

Anchor attributes specify the priority and flow table type to which the anchor will point. It’s giving β€œtell me where this anchor should aim its main character energy” ✨

struct mlx5dv_steering_anchor_attr {
        enum mlx5dv_flow_table_type ft_type;
        uint16_t priority;
        uint64_t comp_mask;
};
  • ft_type β€” the flow table type to which the anchor will point. The destination type, iykyk πŸ’œ
  • priority β€” the priority inside ft_type to which the created anchor will point. Priorities matter, fr fr 🎯
  • comp_mask β€” reserved for future extension, must be 0 now.
🚨 bestie do not mess with comp_mask β€” it’s reserved for future extension and must be 0 now. No cap.

mlx5dv_steering_anchor

struct mlx5dv_steering_anchor {
    uint32_t id;
};
  • id β€” the flow table ID to use as the destination when creating the flow table entry. That’s the destination ID, periodt πŸ’…

⭐ RETURN VALUE ⭐

  • mlx5dv_create_steering_anchor() β€” returns a pointer to a new mlx5dv_steering_anchor on success. On error NULL is returned and errno is set. Sad girl error path 😭
  • mlx5dv_destroy_steering_anchor() β€” returns 0 on success and errno value on error. Very straightforward, very demure πŸŽ€

πŸ‘‘ AUTHORS πŸ‘‘

Mark Bloch <mbloch@nvidia.com> β€” author credit, legendary behavior 🌟


source/version + date check, bestie: the footer is literally mlx5dv_create_st..._steering_anchor(3), and the page doesn’t show a separate version or date beyond that β€” so that’s the whole paper trail, slay πŸ’–βœ¨

πŸ“¦ where this page comes from