net/mlx5_core: Connect flow tables
[cascardo/linux.git] / drivers / net / ethernet / mellanox / mlx5 / core / fs_cmd.c
index 2b55625..a9894d2 100644 (file)
@@ -58,7 +58,8 @@ int mlx5_cmd_update_root_ft(struct mlx5_core_dev *dev,
 
 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)
+                              unsigned int log_size, struct mlx5_flow_table
+                              *next_ft, unsigned int *table_id)
 {
        u32 out[MLX5_ST_SZ_DW(create_flow_table_out)];
        u32 in[MLX5_ST_SZ_DW(create_flow_table_in)];
@@ -69,6 +70,10 @@ int mlx5_cmd_create_flow_table(struct mlx5_core_dev *dev,
        MLX5_SET(create_flow_table_in, in, opcode,
                 MLX5_CMD_OP_CREATE_FLOW_TABLE);
 
+       if (next_ft) {
+               MLX5_SET(create_flow_table_in, in, table_miss_mode, 1);
+               MLX5_SET(create_flow_table_in, in, table_miss_id, next_ft->id);
+       }
        MLX5_SET(create_flow_table_in, in, table_type, type);
        MLX5_SET(create_flow_table_in, in, level, level);
        MLX5_SET(create_flow_table_in, in, log_size, log_size);