aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuy Nguyen <huyn@mellanox.com>2018-08-08 18:48:08 -0400
committerDavid S. Miller <davem@davemloft.net>2018-08-08 22:07:37 -0400
commitf280c6a1e548cd3223a56bb480454ffb96050e87 (patch)
tree6f6c032a9a4767464307f2470001a43c5e70ca6e
parent816f670623692b5da2787f278cbfdb331ed29b8a (diff)
net/mlx5e: Cleanup of dcbnl related fields
Remove unused netdev_registered_init/remove in en.h Return ENOSUPPORT if the check MLX5_DSCP_SUPPORTED fails. Remove extra white space Fixes: 2a5e7a1344f4 ("net/mlx5e: Add dcbnl dscp to priority support") Signed-off-by: Huy Nguyen <huyn@mellanox.com> Cc: Yuval Shaia <yuval.shaia@oracle.com> Reviewed-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en.h2
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c30
2 files changed, 11 insertions, 21 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index eb9eb7aa953a..405236cf0b04 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -858,8 +858,6 @@ struct mlx5e_profile {
858 mlx5e_fp_handle_rx_cqe handle_rx_cqe; 858 mlx5e_fp_handle_rx_cqe handle_rx_cqe;
859 mlx5e_fp_handle_rx_cqe handle_rx_cqe_mpwqe; 859 mlx5e_fp_handle_rx_cqe handle_rx_cqe_mpwqe;
860 } rx_handlers; 860 } rx_handlers;
861 void (*netdev_registered_init)(struct mlx5e_priv *priv);
862 void (*netdev_registered_remove)(struct mlx5e_priv *priv);
863 int max_tc; 861 int max_tc;
864}; 862};
865 863
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
index e33afa8d2417..722998d68564 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
@@ -443,16 +443,12 @@ static int mlx5e_dcbnl_ieee_setapp(struct net_device *dev, struct dcb_app *app)
443 bool is_new; 443 bool is_new;
444 int err; 444 int err;
445 445
446 if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP) 446 if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
447 return -EINVAL; 447 !MLX5_DSCP_SUPPORTED(priv->mdev))
448 448 return -EOPNOTSUPP;
449 if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
450 return -EINVAL;
451
452 if (!MLX5_DSCP_SUPPORTED(priv->mdev))
453 return -EINVAL;
454 449
455 if (app->protocol >= MLX5E_MAX_DSCP) 450 if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
451 (app->protocol >= MLX5E_MAX_DSCP))
456 return -EINVAL; 452 return -EINVAL;
457 453
458 /* Save the old entry info */ 454 /* Save the old entry info */
@@ -500,16 +496,12 @@ static int mlx5e_dcbnl_ieee_delapp(struct net_device *dev, struct dcb_app *app)
500 struct mlx5e_priv *priv = netdev_priv(dev); 496 struct mlx5e_priv *priv = netdev_priv(dev);
501 int err; 497 int err;
502 498
503 if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP) 499 if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
504 return -EINVAL; 500 !MLX5_DSCP_SUPPORTED(priv->mdev))
505 501 return -EOPNOTSUPP;
506 if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
507 return -EINVAL;
508
509 if (!MLX5_DSCP_SUPPORTED(priv->mdev))
510 return -EINVAL;
511 502
512 if (app->protocol >= MLX5E_MAX_DSCP) 503 if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
504 (app->protocol >= MLX5E_MAX_DSCP))
513 return -EINVAL; 505 return -EINVAL;
514 506
515 /* Skip if no dscp app entry */ 507 /* Skip if no dscp app entry */
@@ -1146,7 +1138,7 @@ static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)
1146{ 1138{
1147 int err; 1139 int err;
1148 1140
1149 err = mlx5_set_trust_state(priv->mdev, trust_state); 1141 err = mlx5_set_trust_state(priv->mdev, trust_state);
1150 if (err) 1142 if (err)
1151 return err; 1143 return err;
1152 priv->dcbx_dp.trust_state = trust_state; 1144 priv->dcbx_dp.trust_state = trust_state;