Commit ae2ee3be authored by Paul Blakey's avatar Paul Blakey Committed by Saeed Mahameed

net/mlx5: CT: Remove warning of ignore_flow_level support for VFs

ignore_flow_level isn't supported for VFs, and so it causes
post_act and ct to warn about it.

Instead of disabling CT for VFs, and a driver update will be need
to enable CT again once firmware support this, remove this warning
specifically for VFs. This way, it could be automatically enabled on
future firmwares where VFs support ignore_flow_level capability.
Signed-off-by: default avatarPaul Blakey <paulb@nvidia.com>
Reviewed-by: default avatarMaor Dickman <maord@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 1aec8597
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "en_tc.h" #include "en_tc.h"
#include "post_act.h" #include "post_act.h"
#include "mlx5_core.h" #include "mlx5_core.h"
#include "fs_core.h"
struct mlx5e_post_act { struct mlx5e_post_act {
enum mlx5_flow_namespace_type ns_type; enum mlx5_flow_namespace_type ns_type;
...@@ -28,16 +29,14 @@ struct mlx5e_post_act * ...@@ -28,16 +29,14 @@ struct mlx5e_post_act *
mlx5e_tc_post_act_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, mlx5e_tc_post_act_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
enum mlx5_flow_namespace_type ns_type) enum mlx5_flow_namespace_type ns_type)
{ {
enum fs_flow_table_type table_type = ns_type == MLX5_FLOW_NAMESPACE_FDB ?
FS_FT_FDB : FS_FT_NIC_RX;
struct mlx5e_post_act *post_act; struct mlx5e_post_act *post_act;
int err; int err;
if (ns_type == MLX5_FLOW_NAMESPACE_FDB && if (!MLX5_CAP_FLOWTABLE_TYPE(priv->mdev, ignore_flow_level, table_type)) {
!MLX5_CAP_ESW_FLOWTABLE_FDB(priv->mdev, ignore_flow_level)) { if (priv->mdev->coredev_type != MLX5_COREDEV_VF)
mlx5_core_warn(priv->mdev, "firmware level support is missing\n"); mlx5_core_warn(priv->mdev, "firmware level support is missing\n");
err = -EOPNOTSUPP;
goto err_check;
} else if (!MLX5_CAP_FLOWTABLE_NIC_RX(priv->mdev, ignore_flow_level)) {
mlx5_core_warn(priv->mdev, "firmware level support is missing\n");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto err_check; goto err_check;
} }
......
...@@ -2039,25 +2039,36 @@ mlx5_tc_ct_init_check_esw_support(struct mlx5_eswitch *esw, ...@@ -2039,25 +2039,36 @@ mlx5_tc_ct_init_check_esw_support(struct mlx5_eswitch *esw,
static int static int
mlx5_tc_ct_init_check_support(struct mlx5e_priv *priv, mlx5_tc_ct_init_check_support(struct mlx5e_priv *priv,
enum mlx5_flow_namespace_type ns_type, enum mlx5_flow_namespace_type ns_type,
struct mlx5e_post_act *post_act, struct mlx5e_post_act *post_act)
const char **err_msg)
{ {
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
const char *err_msg = NULL;
int err = 0;
#if !IS_ENABLED(CONFIG_NET_TC_SKB_EXT) #if !IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
/* cannot restore chain ID on HW miss */ /* cannot restore chain ID on HW miss */
*err_msg = "tc skb extension missing"; err_msg = "tc skb extension missing";
return -EOPNOTSUPP; err = -EOPNOTSUPP;
goto out_err;
#endif #endif
if (IS_ERR_OR_NULL(post_act)) { if (IS_ERR_OR_NULL(post_act)) {
*err_msg = "tc ct offload not supported, post action is missing"; /* Ignore_flow_level support isn't supported by default for VFs and so post_act
return -EOPNOTSUPP; * won't be supported. Skip showing error msg.
*/
if (priv->mdev->coredev_type != MLX5_COREDEV_VF)
err_msg = "post action is missing";
err = -EOPNOTSUPP;
goto out_err;
} }
if (ns_type == MLX5_FLOW_NAMESPACE_FDB) if (ns_type == MLX5_FLOW_NAMESPACE_FDB)
return mlx5_tc_ct_init_check_esw_support(esw, err_msg); err = mlx5_tc_ct_init_check_esw_support(esw, &err_msg);
return 0;
out_err:
if (err && err_msg)
netdev_dbg(priv->netdev, "tc ct offload not supported, %s\n", err_msg);
return err;
} }
#define INIT_ERR_PREFIX "tc ct offload init failed" #define INIT_ERR_PREFIX "tc ct offload init failed"
...@@ -2070,16 +2081,13 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains, ...@@ -2070,16 +2081,13 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
{ {
struct mlx5_tc_ct_priv *ct_priv; struct mlx5_tc_ct_priv *ct_priv;
struct mlx5_core_dev *dev; struct mlx5_core_dev *dev;
const char *msg;
u64 mapping_id; u64 mapping_id;
int err; int err;
dev = priv->mdev; dev = priv->mdev;
err = mlx5_tc_ct_init_check_support(priv, ns_type, post_act, &msg); err = mlx5_tc_ct_init_check_support(priv, ns_type, post_act);
if (err) { if (err)
mlx5_core_warn(dev, "tc ct offload not supported, %s\n", msg);
goto err_support; goto err_support;
}
ct_priv = kzalloc(sizeof(*ct_priv), GFP_KERNEL); ct_priv = kzalloc(sizeof(*ct_priv), GFP_KERNEL);
if (!ct_priv) if (!ct_priv)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment