net/mlx5e: Introduce flow steering API
[sfrench/cifs-2.6.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_rep.c
index 0c66774a1720cc6117e55cefeb888de76d2aedca..8ef4ad0a6ce9025bc5375f55978b97624cb7a57e 100644 (file)
@@ -745,8 +745,9 @@ static int mlx5e_create_rep_ttc_table(struct mlx5e_priv *priv)
        struct ttc_params ttc_params = {};
        int err;
 
-       priv->fs->ns = mlx5_get_flow_namespace(priv->mdev,
-                                              MLX5_FLOW_NAMESPACE_KERNEL);
+       mlx5e_fs_set_ns(priv->fs,
+                       mlx5_get_flow_namespace(priv->mdev,
+                                               MLX5_FLOW_NAMESPACE_KERNEL), false);
 
        /* The inner_ttc in the ttc params is intentionally not set */
        mlx5e_set_ttc_params(priv, &ttc_params, false);
@@ -755,9 +756,9 @@ static int mlx5e_create_rep_ttc_table(struct mlx5e_priv *priv)
                /* To give uplik rep TTC a lower level for chaining from root ft */
                ttc_params.ft_attr.level = MLX5E_TTC_FT_LEVEL + 1;
 
-       priv->fs->ttc = mlx5_create_ttc_table(priv->mdev, &ttc_params);
-       if (IS_ERR(priv->fs->ttc)) {
-               err = PTR_ERR(priv->fs->ttc);
+       mlx5e_fs_set_ttc(priv->fs, mlx5_create_ttc_table(priv->mdev, &ttc_params), false);
+       if (IS_ERR(mlx5e_fs_get_ttc(priv->fs, false))) {
+               err = PTR_ERR(mlx5e_fs_get_ttc(priv->fs, false));
                netdev_err(priv->netdev, "Failed to create rep ttc table, err=%d\n",
                           err);
                return err;
@@ -777,7 +778,7 @@ static int mlx5e_create_rep_root_ft(struct mlx5e_priv *priv)
                /* non uplik reps will skip any bypass tables and go directly to
                 * their own ttc
                 */
-               rpriv->root_ft = mlx5_get_ttc_flow_table(priv->fs->ttc);
+               rpriv->root_ft = mlx5_get_ttc_flow_table(mlx5e_fs_get_ttc(priv->fs, false));
                return 0;
        }
 
@@ -892,7 +893,7 @@ static int mlx5e_init_rep_rx(struct mlx5e_priv *priv)
 err_destroy_root_ft:
        mlx5e_destroy_rep_root_ft(priv);
 err_destroy_ttc_table:
-       mlx5_destroy_ttc_table(priv->fs->ttc);
+       mlx5_destroy_ttc_table(mlx5e_fs_get_ttc(priv->fs, false));
 err_destroy_rx_res:
        mlx5e_rx_res_destroy(priv->rx_res);
 err_close_drop_rq:
@@ -909,7 +910,7 @@ static void mlx5e_cleanup_rep_rx(struct mlx5e_priv *priv)
        mlx5e_ethtool_cleanup_steering(priv);
        rep_vport_rx_rule_destroy(priv);
        mlx5e_destroy_rep_root_ft(priv);
-       mlx5_destroy_ttc_table(priv->fs->ttc);
+       mlx5_destroy_ttc_table(mlx5e_fs_get_ttc(priv->fs, false));
        mlx5e_rx_res_destroy(priv->rx_res);
        mlx5e_close_drop_rq(&priv->drop_rq);
        mlx5e_rx_res_free(priv->rx_res);