mlx5dv_cre...ow_matcher(3)

πŸ’… mlx5dv_create_flow_matcher(3) β€” your matcher-making bestie πŸ’…

Okay bestie, this is the mlx5dv_create_flow_matcher(3) page from the mlx5 Programmer’s Manual, and it’s literally about making a matcher (a mask) to go with mlx5dv_create_flow(3) πŸŽ€. Yes, that’s the whole main-character job. Let’s get into it ✨.

🌸 NAME 🌸

mlx5dv_create_flow_matcher β€” creates a matcher to be used with mlx5dv_create_flow(3) 🫢.

✨ 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) πŸ’–. That’s it β€” it’s the setup bestie for your flow, no cap.

πŸŽ€ ARGUMENTS πŸŽ€

Please see ibv_open_device(3) 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 the rule: 0: nothing or zero value means the 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) 🫢.
  • 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 🎯.

Back on attr, the rest of the fields go like this:

  • 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 😭. So vibe check that pointer, bestie.

🌈 SEE ALSO 🌈

πŸ“ AUTHOR πŸ“

Mark Bloch <markb@mellanox.com> πŸ’Œ.


Source/version: mlx5; date: 2018-9-19; page: mlx5dv_cre...ow_matcher(3) β€” love u, bye bestie πŸ’–βœ¨

πŸ“¦ where this page comes from