net/mlx5_core: Managing root flow table
[cascardo/linux.git] / drivers / net / ethernet / mellanox / mlx5 / core / fs_cmd.c
index 5096f4f..d8b1195 100644 (file)
 #include "fs_cmd.h"
 #include "mlx5_core.h"
 
+int mlx5_cmd_update_root_ft(struct mlx5_core_dev *dev,
+                           struct mlx5_flow_table *ft)
+{
+       u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)];
+       u32 out[MLX5_ST_SZ_DW(set_flow_table_root_out)];
+
+       memset(in, 0, sizeof(in));
+
+       MLX5_SET(set_flow_table_root_in, in, opcode,
+                MLX5_CMD_OP_SET_FLOW_TABLE_ROOT);
+       MLX5_SET(set_flow_table_root_in, in, table_type, ft->type);
+       MLX5_SET(set_flow_table_root_in, in, table_id, ft->id);
+
+       memset(out, 0, sizeof(out));
+       return mlx5_cmd_exec_check_status(dev, in, sizeof(in), out,
+                                         sizeof(out));
+}
+
 int mlx5_cmd_create_flow_table(struct mlx5_core_dev *dev,
                               enum fs_flow_table_type type, unsigned int level,
                               unsigned int log_size, unsigned int *table_id)