0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef _MLX5_FS_CMD_
0034 #define _MLX5_FS_CMD_
0035
0036 #include "fs_core.h"
0037
0038 struct mlx5_flow_cmds {
0039 int (*create_flow_table)(struct mlx5_flow_root_namespace *ns,
0040 struct mlx5_flow_table *ft,
0041 struct mlx5_flow_table_attr *ft_attr,
0042 struct mlx5_flow_table *next_ft);
0043 int (*destroy_flow_table)(struct mlx5_flow_root_namespace *ns,
0044 struct mlx5_flow_table *ft);
0045
0046 int (*modify_flow_table)(struct mlx5_flow_root_namespace *ns,
0047 struct mlx5_flow_table *ft,
0048 struct mlx5_flow_table *next_ft);
0049
0050 int (*create_flow_group)(struct mlx5_flow_root_namespace *ns,
0051 struct mlx5_flow_table *ft,
0052 u32 *in,
0053 struct mlx5_flow_group *fg);
0054
0055 int (*destroy_flow_group)(struct mlx5_flow_root_namespace *ns,
0056 struct mlx5_flow_table *ft,
0057 struct mlx5_flow_group *fg);
0058
0059 int (*create_fte)(struct mlx5_flow_root_namespace *ns,
0060 struct mlx5_flow_table *ft,
0061 struct mlx5_flow_group *fg,
0062 struct fs_fte *fte);
0063
0064 int (*update_fte)(struct mlx5_flow_root_namespace *ns,
0065 struct mlx5_flow_table *ft,
0066 struct mlx5_flow_group *fg,
0067 int modify_mask,
0068 struct fs_fte *fte);
0069
0070 int (*delete_fte)(struct mlx5_flow_root_namespace *ns,
0071 struct mlx5_flow_table *ft,
0072 struct fs_fte *fte);
0073
0074 int (*update_root_ft)(struct mlx5_flow_root_namespace *ns,
0075 struct mlx5_flow_table *ft,
0076 u32 underlay_qpn,
0077 bool disconnect);
0078
0079 int (*packet_reformat_alloc)(struct mlx5_flow_root_namespace *ns,
0080 struct mlx5_pkt_reformat_params *params,
0081 enum mlx5_flow_namespace_type namespace,
0082 struct mlx5_pkt_reformat *pkt_reformat);
0083
0084 void (*packet_reformat_dealloc)(struct mlx5_flow_root_namespace *ns,
0085 struct mlx5_pkt_reformat *pkt_reformat);
0086
0087 int (*modify_header_alloc)(struct mlx5_flow_root_namespace *ns,
0088 u8 namespace, u8 num_actions,
0089 void *modify_actions,
0090 struct mlx5_modify_hdr *modify_hdr);
0091
0092 void (*modify_header_dealloc)(struct mlx5_flow_root_namespace *ns,
0093 struct mlx5_modify_hdr *modify_hdr);
0094
0095 int (*set_peer)(struct mlx5_flow_root_namespace *ns,
0096 struct mlx5_flow_root_namespace *peer_ns);
0097
0098 int (*create_ns)(struct mlx5_flow_root_namespace *ns);
0099 int (*destroy_ns)(struct mlx5_flow_root_namespace *ns);
0100 int (*create_match_definer)(struct mlx5_flow_root_namespace *ns,
0101 u16 format_id, u32 *match_mask);
0102 int (*destroy_match_definer)(struct mlx5_flow_root_namespace *ns,
0103 int definer_id);
0104
0105 u32 (*get_capabilities)(struct mlx5_flow_root_namespace *ns,
0106 enum fs_flow_table_type ft_type);
0107 };
0108
0109 int mlx5_cmd_fc_alloc(struct mlx5_core_dev *dev, u32 *id);
0110 int mlx5_cmd_fc_bulk_alloc(struct mlx5_core_dev *dev,
0111 enum mlx5_fc_bulk_alloc_bitmask alloc_bitmask,
0112 u32 *id);
0113 int mlx5_cmd_fc_free(struct mlx5_core_dev *dev, u32 id);
0114 int mlx5_cmd_fc_query(struct mlx5_core_dev *dev, u32 id,
0115 u64 *packets, u64 *bytes);
0116
0117 int mlx5_cmd_fc_get_bulk_query_out_len(int bulk_len);
0118 int mlx5_cmd_fc_bulk_query(struct mlx5_core_dev *dev, u32 base_id, int bulk_len,
0119 u32 *out);
0120
0121 const struct mlx5_flow_cmds *mlx5_fs_cmd_get_default(enum fs_flow_table_type type);
0122 const struct mlx5_flow_cmds *mlx5_fs_cmd_get_fw_cmds(void);
0123
0124 #endif