@@ -202,6 +202,9 @@ enum {
202202 MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY = 0x936 ,
203203 MLX5_CMD_OP_QUERY_FLOW_TABLE_ENTRY = 0x937 ,
204204 MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY = 0x938 ,
205+ MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939 ,
206+ MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a ,
207+ MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b ,
205208 MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c
206209};
207210
@@ -265,7 +268,8 @@ struct mlx5_ifc_flow_table_fields_supported_bits {
265268
266269struct mlx5_ifc_flow_table_prop_layout_bits {
267270 u8 ft_support [0x1 ];
268- u8 reserved_at_1 [0x2 ];
271+ u8 reserved_at_1 [0x1 ];
272+ u8 flow_counter [0x1 ];
269273 u8 flow_modify_en [0x1 ];
270274 u8 modify_root [0x1 ];
271275 u8 identified_miss_table_mode [0x1 ];
@@ -941,6 +945,19 @@ struct mlx5_ifc_dest_format_struct_bits {
941945 u8 reserved_at_20 [0x20 ];
942946};
943947
948+ struct mlx5_ifc_flow_counter_list_bits {
949+ u8 reserved_at_0 [0x10 ];
950+ u8 flow_counter_id [0x10 ];
951+
952+ u8 reserved_at_20 [0x20 ];
953+ };
954+
955+ union mlx5_ifc_dest_format_struct_flow_counter_list_auto_bits {
956+ struct mlx5_ifc_dest_format_struct_bits dest_format_struct ;
957+ struct mlx5_ifc_flow_counter_list_bits flow_counter_list ;
958+ u8 reserved_at_0 [0x40 ];
959+ };
960+
944961struct mlx5_ifc_fte_match_param_bits {
945962 struct mlx5_ifc_fte_match_set_lyr_2_4_bits outer_headers ;
946963
@@ -2006,6 +2023,7 @@ enum {
20062023 MLX5_FLOW_CONTEXT_ACTION_ALLOW = 0x1 ,
20072024 MLX5_FLOW_CONTEXT_ACTION_DROP = 0x2 ,
20082025 MLX5_FLOW_CONTEXT_ACTION_FWD_DEST = 0x4 ,
2026+ MLX5_FLOW_CONTEXT_ACTION_COUNT = 0x8 ,
20092027};
20102028
20112029struct mlx5_ifc_flow_context_bits {
@@ -2022,13 +2040,16 @@ struct mlx5_ifc_flow_context_bits {
20222040 u8 reserved_at_80 [0x8 ];
20232041 u8 destination_list_size [0x18 ];
20242042
2025- u8 reserved_at_a0 [0x160 ];
2043+ u8 reserved_at_a0 [0x8 ];
2044+ u8 flow_counter_list_size [0x18 ];
2045+
2046+ u8 reserved_at_c0 [0x140 ];
20262047
20272048 struct mlx5_ifc_fte_match_param_bits match_value ;
20282049
20292050 u8 reserved_at_1200 [0x600 ];
20302051
2031- struct mlx5_ifc_dest_format_struct_bits destination [0 ];
2052+ union mlx5_ifc_dest_format_struct_flow_counter_list_auto_bits destination [0 ];
20322053};
20332054
20342055enum {
@@ -3937,6 +3958,34 @@ struct mlx5_ifc_query_flow_group_in_bits {
39373958 u8 reserved_at_e0 [0x120 ];
39383959};
39393960
3961+ struct mlx5_ifc_query_flow_counter_out_bits {
3962+ u8 status [0x8 ];
3963+ u8 reserved_at_8 [0x18 ];
3964+
3965+ u8 syndrome [0x20 ];
3966+
3967+ u8 reserved_at_40 [0x40 ];
3968+
3969+ struct mlx5_ifc_traffic_counter_bits flow_statistics [0 ];
3970+ };
3971+
3972+ struct mlx5_ifc_query_flow_counter_in_bits {
3973+ u8 opcode [0x10 ];
3974+ u8 reserved_at_10 [0x10 ];
3975+
3976+ u8 reserved_at_20 [0x10 ];
3977+ u8 op_mod [0x10 ];
3978+
3979+ u8 reserved_at_40 [0x80 ];
3980+
3981+ u8 clear [0x1 ];
3982+ u8 reserved_at_c1 [0xf ];
3983+ u8 num_of_counters [0x10 ];
3984+
3985+ u8 reserved_at_e0 [0x10 ];
3986+ u8 flow_counter_id [0x10 ];
3987+ };
3988+
39403989struct mlx5_ifc_query_esw_vport_context_out_bits {
39413990 u8 status [0x8 ];
39423991 u8 reserved_at_8 [0x18 ];
@@ -5510,6 +5559,28 @@ struct mlx5_ifc_dealloc_pd_in_bits {
55105559 u8 reserved_at_60 [0x20 ];
55115560};
55125561
5562+ struct mlx5_ifc_dealloc_flow_counter_out_bits {
5563+ u8 status [0x8 ];
5564+ u8 reserved_at_8 [0x18 ];
5565+
5566+ u8 syndrome [0x20 ];
5567+
5568+ u8 reserved_at_40 [0x40 ];
5569+ };
5570+
5571+ struct mlx5_ifc_dealloc_flow_counter_in_bits {
5572+ u8 opcode [0x10 ];
5573+ u8 reserved_at_10 [0x10 ];
5574+
5575+ u8 reserved_at_20 [0x10 ];
5576+ u8 op_mod [0x10 ];
5577+
5578+ u8 reserved_at_40 [0x10 ];
5579+ u8 flow_counter_id [0x10 ];
5580+
5581+ u8 reserved_at_60 [0x20 ];
5582+ };
5583+
55135584struct mlx5_ifc_create_xrc_srq_out_bits {
55145585 u8 status [0x8 ];
55155586 u8 reserved_at_8 [0x18 ];
@@ -6237,6 +6308,28 @@ struct mlx5_ifc_alloc_pd_in_bits {
62376308 u8 reserved_at_40 [0x40 ];
62386309};
62396310
6311+ struct mlx5_ifc_alloc_flow_counter_out_bits {
6312+ u8 status [0x8 ];
6313+ u8 reserved_at_8 [0x18 ];
6314+
6315+ u8 syndrome [0x20 ];
6316+
6317+ u8 reserved_at_40 [0x10 ];
6318+ u8 flow_counter_id [0x10 ];
6319+
6320+ u8 reserved_at_60 [0x20 ];
6321+ };
6322+
6323+ struct mlx5_ifc_alloc_flow_counter_in_bits {
6324+ u8 opcode [0x10 ];
6325+ u8 reserved_at_10 [0x10 ];
6326+
6327+ u8 reserved_at_20 [0x10 ];
6328+ u8 op_mod [0x10 ];
6329+
6330+ u8 reserved_at_40 [0x40 ];
6331+ };
6332+
62406333struct mlx5_ifc_add_vxlan_udp_dport_out_bits {
62416334 u8 status [0x8 ];
62426335 u8 reserved_at_8 [0x18 ];
0 commit comments