Skip to content

Commit ae2ee3b

Browse files
Paul BlakeySaeed Mahameed
authored andcommitted
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: Paul Blakey <[email protected]> Reviewed-by: Maor Dickman <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 1aec859 commit ae2ee3b

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "en_tc.h"
55
#include "post_act.h"
66
#include "mlx5_core.h"
7+
#include "fs_core.h"
78

89
struct mlx5e_post_act {
910
enum mlx5_flow_namespace_type ns_type;
@@ -28,16 +29,14 @@ struct mlx5e_post_act *
2829
mlx5e_tc_post_act_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
2930
enum mlx5_flow_namespace_type ns_type)
3031
{
32+
enum fs_flow_table_type table_type = ns_type == MLX5_FLOW_NAMESPACE_FDB ?
33+
FS_FT_FDB : FS_FT_NIC_RX;
3134
struct mlx5e_post_act *post_act;
3235
int err;
3336

34-
if (ns_type == MLX5_FLOW_NAMESPACE_FDB &&
35-
!MLX5_CAP_ESW_FLOWTABLE_FDB(priv->mdev, ignore_flow_level)) {
36-
mlx5_core_warn(priv->mdev, "firmware level support is missing\n");
37-
err = -EOPNOTSUPP;
38-
goto err_check;
39-
} else if (!MLX5_CAP_FLOWTABLE_NIC_RX(priv->mdev, ignore_flow_level)) {
40-
mlx5_core_warn(priv->mdev, "firmware level support is missing\n");
37+
if (!MLX5_CAP_FLOWTABLE_TYPE(priv->mdev, ignore_flow_level, table_type)) {
38+
if (priv->mdev->coredev_type != MLX5_COREDEV_VF)
39+
mlx5_core_warn(priv->mdev, "firmware level support is missing\n");
4140
err = -EOPNOTSUPP;
4241
goto err_check;
4342
}

drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,25 +2039,36 @@ mlx5_tc_ct_init_check_esw_support(struct mlx5_eswitch *esw,
20392039
static int
20402040
mlx5_tc_ct_init_check_support(struct mlx5e_priv *priv,
20412041
enum mlx5_flow_namespace_type ns_type,
2042-
struct mlx5e_post_act *post_act,
2043-
const char **err_msg)
2042+
struct mlx5e_post_act *post_act)
20442043
{
20452044
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
2045+
const char *err_msg = NULL;
2046+
int err = 0;
20462047

20472048
#if !IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
20482049
/* cannot restore chain ID on HW miss */
20492050

2050-
*err_msg = "tc skb extension missing";
2051-
return -EOPNOTSUPP;
2051+
err_msg = "tc skb extension missing";
2052+
err = -EOPNOTSUPP;
2053+
goto out_err;
20522054
#endif
20532055
if (IS_ERR_OR_NULL(post_act)) {
2054-
*err_msg = "tc ct offload not supported, post action is missing";
2055-
return -EOPNOTSUPP;
2056+
/* Ignore_flow_level support isn't supported by default for VFs and so post_act
2057+
* won't be supported. Skip showing error msg.
2058+
*/
2059+
if (priv->mdev->coredev_type != MLX5_COREDEV_VF)
2060+
err_msg = "post action is missing";
2061+
err = -EOPNOTSUPP;
2062+
goto out_err;
20562063
}
20572064

20582065
if (ns_type == MLX5_FLOW_NAMESPACE_FDB)
2059-
return mlx5_tc_ct_init_check_esw_support(esw, err_msg);
2060-
return 0;
2066+
err = mlx5_tc_ct_init_check_esw_support(esw, &err_msg);
2067+
2068+
out_err:
2069+
if (err && err_msg)
2070+
netdev_dbg(priv->netdev, "tc ct offload not supported, %s\n", err_msg);
2071+
return err;
20612072
}
20622073

20632074
#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,
20702081
{
20712082
struct mlx5_tc_ct_priv *ct_priv;
20722083
struct mlx5_core_dev *dev;
2073-
const char *msg;
20742084
u64 mapping_id;
20752085
int err;
20762086

20772087
dev = priv->mdev;
2078-
err = mlx5_tc_ct_init_check_support(priv, ns_type, post_act, &msg);
2079-
if (err) {
2080-
mlx5_core_warn(dev, "tc ct offload not supported, %s\n", msg);
2088+
err = mlx5_tc_ct_init_check_support(priv, ns_type, post_act);
2089+
if (err)
20812090
goto err_support;
2082-
}
20832091

20842092
ct_priv = kzalloc(sizeof(*ct_priv), GFP_KERNEL);
20852093
if (!ct_priv)

0 commit comments

Comments
 (0)