@@ -153,11 +153,53 @@ static int mlx5_cmd_hws_update_root_ft(struct mlx5_flow_root_namespace *ns,
153
153
disconnect );
154
154
}
155
155
156
+ static int mlx5_cmd_hws_create_flow_group (struct mlx5_flow_root_namespace * ns ,
157
+ struct mlx5_flow_table * ft , u32 * in ,
158
+ struct mlx5_flow_group * fg )
159
+ {
160
+ struct mlx5hws_match_parameters mask ;
161
+ struct mlx5hws_bwc_matcher * matcher ;
162
+ u8 match_criteria_enable ;
163
+ u32 priority ;
164
+
165
+ if (mlx5_fs_cmd_is_fw_term_table (ft ))
166
+ return mlx5_fs_cmd_get_fw_cmds ()-> create_flow_group (ns , ft , in , fg );
167
+
168
+ mask .match_buf = MLX5_ADDR_OF (create_flow_group_in , in , match_criteria );
169
+ mask .match_sz = sizeof (fg -> mask .match_criteria );
170
+
171
+ match_criteria_enable = MLX5_GET (create_flow_group_in , in ,
172
+ match_criteria_enable );
173
+ priority = MLX5_GET (create_flow_group_in , in , start_flow_index );
174
+ matcher = mlx5hws_bwc_matcher_create (ft -> fs_hws_table .hws_table ,
175
+ priority , match_criteria_enable ,
176
+ & mask );
177
+ if (!matcher ) {
178
+ mlx5_core_err (ns -> dev , "Failed creating matcher\n" );
179
+ return - EINVAL ;
180
+ }
181
+
182
+ fg -> fs_hws_matcher .matcher = matcher ;
183
+ return 0 ;
184
+ }
185
+
186
+ static int mlx5_cmd_hws_destroy_flow_group (struct mlx5_flow_root_namespace * ns ,
187
+ struct mlx5_flow_table * ft ,
188
+ struct mlx5_flow_group * fg )
189
+ {
190
+ if (mlx5_fs_cmd_is_fw_term_table (ft ))
191
+ return mlx5_fs_cmd_get_fw_cmds ()-> destroy_flow_group (ns , ft , fg );
192
+
193
+ return mlx5hws_bwc_matcher_destroy (fg -> fs_hws_matcher .matcher );
194
+ }
195
+
156
196
static const struct mlx5_flow_cmds mlx5_flow_cmds_hws = {
157
197
.create_flow_table = mlx5_cmd_hws_create_flow_table ,
158
198
.destroy_flow_table = mlx5_cmd_hws_destroy_flow_table ,
159
199
.modify_flow_table = mlx5_cmd_hws_modify_flow_table ,
160
200
.update_root_ft = mlx5_cmd_hws_update_root_ft ,
201
+ .create_flow_group = mlx5_cmd_hws_create_flow_group ,
202
+ .destroy_flow_group = mlx5_cmd_hws_destroy_flow_group ,
161
203
.create_ns = mlx5_cmd_hws_create_ns ,
162
204
.destroy_ns = mlx5_cmd_hws_destroy_ns ,
163
205
.set_peer = mlx5_cmd_hws_set_peer ,
0 commit comments