Commit 74a9e905 authored by Kamal Heib's avatar Kamal Heib Committed by David S. Miller

net/mlx4_en: Fix the return value of mlx4_en_dcbnl_set_all()

mlx4_en_dcbnl_set_all() returns u8, so return value can't be negative in
case of failure.

Fixes: af7d5185 ("net/mlx4_en: Add DCB PFC support through CEE netlink commands")
Signed-off-by: default avatarKamal Heib <kamalh@mellanox.com>
Signed-off-by: default avatarRana Shahout <ranas@mellanox.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e1487888
...@@ -158,10 +158,9 @@ static u8 mlx4_en_dcbnl_set_all(struct net_device *netdev) ...@@ -158,10 +158,9 @@ static u8 mlx4_en_dcbnl_set_all(struct net_device *netdev)
struct mlx4_en_priv *priv = netdev_priv(netdev); struct mlx4_en_priv *priv = netdev_priv(netdev);
struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_en_dev *mdev = priv->mdev;
struct mlx4_en_cee_config *dcb_cfg = &priv->cee_params.dcb_cfg; struct mlx4_en_cee_config *dcb_cfg = &priv->cee_params.dcb_cfg;
int err = 0;
if (!(priv->cee_params.dcbx_cap & DCB_CAP_DCBX_VER_CEE)) if (!(priv->cee_params.dcbx_cap & DCB_CAP_DCBX_VER_CEE))
return -EINVAL; return 1;
if (dcb_cfg->pfc_state) { if (dcb_cfg->pfc_state) {
int tc; int tc;
...@@ -199,15 +198,17 @@ static u8 mlx4_en_dcbnl_set_all(struct net_device *netdev) ...@@ -199,15 +198,17 @@ static u8 mlx4_en_dcbnl_set_all(struct net_device *netdev)
en_dbg(DRV, priv, "Set pfc off\n"); en_dbg(DRV, priv, "Set pfc off\n");
} }
err = mlx4_SET_PORT_general(mdev->dev, priv->port, if (mlx4_SET_PORT_general(mdev->dev, priv->port,
priv->rx_skb_size + ETH_FCS_LEN, priv->rx_skb_size + ETH_FCS_LEN,
priv->prof->tx_pause, priv->prof->tx_pause,
priv->prof->tx_ppp, priv->prof->tx_ppp,
priv->prof->rx_pause, priv->prof->rx_pause,
priv->prof->rx_ppp); priv->prof->rx_ppp)) {
if (err)
en_err(priv, "Failed setting pause params\n"); en_err(priv, "Failed setting pause params\n");
return err; return 1;
}
return 0;
} }
static u8 mlx4_en_dcbnl_get_state(struct net_device *dev) static u8 mlx4_en_dcbnl_get_state(struct net_device *dev)
......
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