* [PATCH net 0/2] Mellanox, mlx5e fixes 2018-08-07
@ 2018-08-08 22:48 Saeed Mahameed
2018-08-08 22:48 ` [PATCH net 1/2] net/mlx5e: Properly check if hairpin is possible between two functions Saeed Mahameed
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Saeed Mahameed @ 2018-08-08 22:48 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Saeed Mahameed
Hi Dave,
I know it is late into 4.18 release, and this is why I am submitting
only two mlx5e ethernet fixes.
The first one from Or, is needed for -stable and it fixes hairpin
for "same device" check.
The second fix is a non risk fix from Huy which cleans up and improves
error return value reporting for dcbnl_ieee_setapp.
For -stable v4.16
- net/mlx5e: Properly check if hairpin is possible between two functions
Thanks,
Saeed.
---
Huy Nguyen (1):
net/mlx5e: Cleanup of dcbnl related fields
Or Gerlitz (1):
net/mlx5e: Properly check if hairpin is possible between two functions
drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 --
.../ethernet/mellanox/mlx5/core/en_dcbnl.c | 30 +++++++------------
.../net/ethernet/mellanox/mlx5/core/en_tc.c | 8 ++---
3 files changed, 15 insertions(+), 25 deletions(-)
--
2.17.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net 1/2] net/mlx5e: Properly check if hairpin is possible between two functions
2018-08-08 22:48 [PATCH net 0/2] Mellanox, mlx5e fixes 2018-08-07 Saeed Mahameed
@ 2018-08-08 22:48 ` Saeed Mahameed
2018-08-08 22:48 ` [PATCH net 2/2] net/mlx5e: Cleanup of dcbnl related fields Saeed Mahameed
2018-08-09 2:10 ` [PATCH net 0/2] Mellanox, mlx5e fixes 2018-08-07 David Miller
2 siblings, 0 replies; 7+ messages in thread
From: Saeed Mahameed @ 2018-08-08 22:48 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Saeed Mahameed
From: Or Gerlitz <ogerlitz@mellanox.com>
The current check relies on function BDF addresses and can get
us wrong e.g when two VFs are assigned into a VM and the PCI
v-address is set by the hypervisor.
Fixes: 5c65c564c962 ('net/mlx5e: Support offloading TC NIC hairpin flows')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Alaa Hleihel <alaa@mellanox.com>
Tested-by: Alaa Hleihel <alaa@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 3a2c4e548226..dfbcda0d0e08 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1970,15 +1970,15 @@ static bool actions_match_supported(struct mlx5e_priv *priv,
static bool same_hw_devs(struct mlx5e_priv *priv, struct mlx5e_priv *peer_priv)
{
struct mlx5_core_dev *fmdev, *pmdev;
- u16 func_id, peer_id;
+ u64 fsystem_guid, psystem_guid;
fmdev = priv->mdev;
pmdev = peer_priv->mdev;
- func_id = (u16)((fmdev->pdev->bus->number << 8) | PCI_SLOT(fmdev->pdev->devfn));
- peer_id = (u16)((pmdev->pdev->bus->number << 8) | PCI_SLOT(pmdev->pdev->devfn));
+ mlx5_query_nic_vport_system_image_guid(fmdev, &fsystem_guid);
+ mlx5_query_nic_vport_system_image_guid(pmdev, &psystem_guid);
- return (func_id == peer_id);
+ return (fsystem_guid == psystem_guid);
}
static int parse_tc_nic_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
--
2.17.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net 2/2] net/mlx5e: Cleanup of dcbnl related fields
2018-08-08 22:48 [PATCH net 0/2] Mellanox, mlx5e fixes 2018-08-07 Saeed Mahameed
2018-08-08 22:48 ` [PATCH net 1/2] net/mlx5e: Properly check if hairpin is possible between two functions Saeed Mahameed
@ 2018-08-08 22:48 ` Saeed Mahameed
2018-08-13 12:32 ` Yuval Shaia
2018-08-14 9:01 ` Yuval Shaia
2018-08-09 2:10 ` [PATCH net 0/2] Mellanox, mlx5e fixes 2018-08-07 David Miller
2 siblings, 2 replies; 7+ messages in thread
From: Saeed Mahameed @ 2018-08-08 22:48 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Huy Nguyen, Yuval Shaia, Saeed Mahameed
From: Huy Nguyen <huyn@mellanox.com>
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>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 --
.../ethernet/mellanox/mlx5/core/en_dcbnl.c | 30 +++++++------------
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 {
mlx5e_fp_handle_rx_cqe handle_rx_cqe;
mlx5e_fp_handle_rx_cqe handle_rx_cqe_mpwqe;
} rx_handlers;
- void (*netdev_registered_init)(struct mlx5e_priv *priv);
- void (*netdev_registered_remove)(struct mlx5e_priv *priv);
int max_tc;
};
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)
bool is_new;
int err;
- if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
- return -EINVAL;
-
- if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
- return -EINVAL;
-
- if (!MLX5_DSCP_SUPPORTED(priv->mdev))
- return -EINVAL;
+ if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
+ !MLX5_DSCP_SUPPORTED(priv->mdev))
+ return -EOPNOTSUPP;
- if (app->protocol >= MLX5E_MAX_DSCP)
+ if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
+ (app->protocol >= MLX5E_MAX_DSCP))
return -EINVAL;
/* Save the old entry info */
@@ -500,16 +496,12 @@ static int mlx5e_dcbnl_ieee_delapp(struct net_device *dev, struct dcb_app *app)
struct mlx5e_priv *priv = netdev_priv(dev);
int err;
- if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
- return -EINVAL;
-
- if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
- return -EINVAL;
-
- if (!MLX5_DSCP_SUPPORTED(priv->mdev))
- return -EINVAL;
+ if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
+ !MLX5_DSCP_SUPPORTED(priv->mdev))
+ return -EOPNOTSUPP;
- if (app->protocol >= MLX5E_MAX_DSCP)
+ if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
+ (app->protocol >= MLX5E_MAX_DSCP))
return -EINVAL;
/* Skip if no dscp app entry */
@@ -1146,7 +1138,7 @@ static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)
{
int err;
- err = mlx5_set_trust_state(priv->mdev, trust_state);
+ err = mlx5_set_trust_state(priv->mdev, trust_state);
if (err)
return err;
priv->dcbx_dp.trust_state = trust_state;
--
2.17.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net 0/2] Mellanox, mlx5e fixes 2018-08-07
2018-08-08 22:48 [PATCH net 0/2] Mellanox, mlx5e fixes 2018-08-07 Saeed Mahameed
2018-08-08 22:48 ` [PATCH net 1/2] net/mlx5e: Properly check if hairpin is possible between two functions Saeed Mahameed
2018-08-08 22:48 ` [PATCH net 2/2] net/mlx5e: Cleanup of dcbnl related fields Saeed Mahameed
@ 2018-08-09 2:10 ` David Miller
2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2018-08-09 2:10 UTC (permalink / raw)
To: saeedm; +Cc: netdev
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Wed, 8 Aug 2018 15:48:06 -0700
> I know it is late into 4.18 release, and this is why I am submitting
> only two mlx5e ethernet fixes.
>
> The first one from Or, is needed for -stable and it fixes hairpin
> for "same device" check.
>
> The second fix is a non risk fix from Huy which cleans up and improves
> error return value reporting for dcbnl_ieee_setapp.
Series applied.
> For -stable v4.16
> - net/mlx5e: Properly check if hairpin is possible between two functions
Queued up.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net 2/2] net/mlx5e: Cleanup of dcbnl related fields
2018-08-08 22:48 ` [PATCH net 2/2] net/mlx5e: Cleanup of dcbnl related fields Saeed Mahameed
@ 2018-08-13 12:32 ` Yuval Shaia
2018-08-14 9:01 ` Yuval Shaia
1 sibling, 0 replies; 7+ messages in thread
From: Yuval Shaia @ 2018-08-13 12:32 UTC (permalink / raw)
To: Saeed Mahameed; +Cc: David S. Miller, netdev, Huy Nguyen
On Wed, Aug 08, 2018 at 03:48:08PM -0700, Saeed Mahameed wrote:
> From: Huy Nguyen <huyn@mellanox.com>
>
> 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>
FWIW:
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Tested-by: Yuval Shaia <yuval.shaia@oracle.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 --
> .../ethernet/mellanox/mlx5/core/en_dcbnl.c | 30 +++++++------------
> 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 {
> mlx5e_fp_handle_rx_cqe handle_rx_cqe;
> mlx5e_fp_handle_rx_cqe handle_rx_cqe_mpwqe;
> } rx_handlers;
> - void (*netdev_registered_init)(struct mlx5e_priv *priv);
> - void (*netdev_registered_remove)(struct mlx5e_priv *priv);
> int max_tc;
> };
>
> 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)
> bool is_new;
> int err;
>
> - if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
> - return -EINVAL;
> -
> - if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
> - return -EINVAL;
> -
> - if (!MLX5_DSCP_SUPPORTED(priv->mdev))
> - return -EINVAL;
> + if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
> + !MLX5_DSCP_SUPPORTED(priv->mdev))
> + return -EOPNOTSUPP;
>
> - if (app->protocol >= MLX5E_MAX_DSCP)
> + if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
> + (app->protocol >= MLX5E_MAX_DSCP))
> return -EINVAL;
>
> /* Save the old entry info */
> @@ -500,16 +496,12 @@ static int mlx5e_dcbnl_ieee_delapp(struct net_device *dev, struct dcb_app *app)
> struct mlx5e_priv *priv = netdev_priv(dev);
> int err;
>
> - if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
> - return -EINVAL;
> -
> - if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
> - return -EINVAL;
> -
> - if (!MLX5_DSCP_SUPPORTED(priv->mdev))
> - return -EINVAL;
> + if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
> + !MLX5_DSCP_SUPPORTED(priv->mdev))
> + return -EOPNOTSUPP;
>
> - if (app->protocol >= MLX5E_MAX_DSCP)
> + if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
> + (app->protocol >= MLX5E_MAX_DSCP))
> return -EINVAL;
>
> /* Skip if no dscp app entry */
> @@ -1146,7 +1138,7 @@ static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)
> {
> int err;
>
> - err = mlx5_set_trust_state(priv->mdev, trust_state);
> + err = mlx5_set_trust_state(priv->mdev, trust_state);
> if (err)
> return err;
> priv->dcbx_dp.trust_state = trust_state;
> --
> 2.17.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net 2/2] net/mlx5e: Cleanup of dcbnl related fields
2018-08-08 22:48 ` [PATCH net 2/2] net/mlx5e: Cleanup of dcbnl related fields Saeed Mahameed
2018-08-13 12:32 ` Yuval Shaia
@ 2018-08-14 9:01 ` Yuval Shaia
2018-08-14 10:52 ` Håkon Bugge
1 sibling, 1 reply; 7+ messages in thread
From: Yuval Shaia @ 2018-08-14 9:01 UTC (permalink / raw)
To: Saeed Mahameed, Haakon Bugge
Cc: David S. Miller, netdev, Huy Nguyen, yuval.shaia
On Wed, Aug 08, 2018 at 03:48:08PM -0700, Saeed Mahameed wrote:
> From: Huy Nguyen <huyn@mellanox.com>
>
> Remove unused netdev_registered_init/remove in en.h
> Return ENOSUPPORT if the check MLX5_DSCP_SUPPORTED fails.
s/ENOSUPPORT/EOPNOTSUPP
(noted by Haakon)
> 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>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 --
> .../ethernet/mellanox/mlx5/core/en_dcbnl.c | 30 +++++++------------
> 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 {
> mlx5e_fp_handle_rx_cqe handle_rx_cqe;
> mlx5e_fp_handle_rx_cqe handle_rx_cqe_mpwqe;
> } rx_handlers;
> - void (*netdev_registered_init)(struct mlx5e_priv *priv);
> - void (*netdev_registered_remove)(struct mlx5e_priv *priv);
> int max_tc;
> };
>
> 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)
> bool is_new;
> int err;
>
> - if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
> - return -EINVAL;
> -
> - if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
> - return -EINVAL;
> -
> - if (!MLX5_DSCP_SUPPORTED(priv->mdev))
> - return -EINVAL;
> + if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
> + !MLX5_DSCP_SUPPORTED(priv->mdev))
> + return -EOPNOTSUPP;
>
> - if (app->protocol >= MLX5E_MAX_DSCP)
> + if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
> + (app->protocol >= MLX5E_MAX_DSCP))
> return -EINVAL;
>
> /* Save the old entry info */
> @@ -500,16 +496,12 @@ static int mlx5e_dcbnl_ieee_delapp(struct net_device *dev, struct dcb_app *app)
> struct mlx5e_priv *priv = netdev_priv(dev);
> int err;
>
> - if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
> - return -EINVAL;
> -
> - if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
> - return -EINVAL;
> -
> - if (!MLX5_DSCP_SUPPORTED(priv->mdev))
> - return -EINVAL;
> + if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
> + !MLX5_DSCP_SUPPORTED(priv->mdev))
> + return -EOPNOTSUPP;
>
> - if (app->protocol >= MLX5E_MAX_DSCP)
> + if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
> + (app->protocol >= MLX5E_MAX_DSCP))
> return -EINVAL;
>
> /* Skip if no dscp app entry */
> @@ -1146,7 +1138,7 @@ static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)
> {
> int err;
>
> - err = mlx5_set_trust_state(priv->mdev, trust_state);
> + err = mlx5_set_trust_state(priv->mdev, trust_state);
> if (err)
> return err;
> priv->dcbx_dp.trust_state = trust_state;
> --
> 2.17.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net 2/2] net/mlx5e: Cleanup of dcbnl related fields
2018-08-14 9:01 ` Yuval Shaia
@ 2018-08-14 10:52 ` Håkon Bugge
0 siblings, 0 replies; 7+ messages in thread
From: Håkon Bugge @ 2018-08-14 10:52 UTC (permalink / raw)
To: Yuval Shaia; +Cc: Saeed Mahameed, David S. Miller, netdev, Huy Nguyen
> On 14 Aug 2018, at 11:01, Yuval Shaia <yuval.shaia@oracle.com> wrote:
>
> On Wed, Aug 08, 2018 at 03:48:08PM -0700, Saeed Mahameed wrote:
>> From: Huy Nguyen <huyn@mellanox.com>
>>
>> Remove unused netdev_registered_init/remove in en.h
>> Return ENOSUPPORT if the check MLX5_DSCP_SUPPORTED fails.
>
> s/ENOSUPPORT/EOPNOTSUPP
> (noted by Haakon)
Sure did,
>
>> Remove extra white space
and I also said that this has nothing to with the commit (no matter how tempting it can be) ;-)
Thxs, Håkon
>>
>> 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>
>> ---
>> drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 --
>> .../ethernet/mellanox/mlx5/core/en_dcbnl.c | 30 +++++++------------
>> 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 {
>> mlx5e_fp_handle_rx_cqe handle_rx_cqe;
>> mlx5e_fp_handle_rx_cqe handle_rx_cqe_mpwqe;
>> } rx_handlers;
>> - void (*netdev_registered_init)(struct mlx5e_priv *priv);
>> - void (*netdev_registered_remove)(struct mlx5e_priv *priv);
>> int max_tc;
>> };
>>
>> 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)
>> bool is_new;
>> int err;
>>
>> - if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
>> - return -EINVAL;
>> -
>> - if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
>> - return -EINVAL;
>> -
>> - if (!MLX5_DSCP_SUPPORTED(priv->mdev))
>> - return -EINVAL;
>> + if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
>> + !MLX5_DSCP_SUPPORTED(priv->mdev))
>> + return -EOPNOTSUPP;
>>
>> - if (app->protocol >= MLX5E_MAX_DSCP)
>> + if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
>> + (app->protocol >= MLX5E_MAX_DSCP))
>> return -EINVAL;
>>
>> /* Save the old entry info */
>> @@ -500,16 +496,12 @@ static int mlx5e_dcbnl_ieee_delapp(struct net_device *dev, struct dcb_app *app)
>> struct mlx5e_priv *priv = netdev_priv(dev);
>> int err;
>>
>> - if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
>> - return -EINVAL;
>> -
>> - if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
>> - return -EINVAL;
>> -
>> - if (!MLX5_DSCP_SUPPORTED(priv->mdev))
>> - return -EINVAL;
>> + if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager) ||
>> + !MLX5_DSCP_SUPPORTED(priv->mdev))
>> + return -EOPNOTSUPP;
>>
>> - if (app->protocol >= MLX5E_MAX_DSCP)
>> + if ((app->selector != IEEE_8021QAZ_APP_SEL_DSCP) ||
>> + (app->protocol >= MLX5E_MAX_DSCP))
>> return -EINVAL;
>>
>> /* Skip if no dscp app entry */
>> @@ -1146,7 +1138,7 @@ static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)
>> {
>> int err;
>>
>> - err = mlx5_set_trust_state(priv->mdev, trust_state);
>> + err = mlx5_set_trust_state(priv->mdev, trust_state);
>> if (err)
>> return err;
>> priv->dcbx_dp.trust_state = trust_state;
>> --
>> 2.17.0
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-08-14 13:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-08 22:48 [PATCH net 0/2] Mellanox, mlx5e fixes 2018-08-07 Saeed Mahameed
2018-08-08 22:48 ` [PATCH net 1/2] net/mlx5e: Properly check if hairpin is possible between two functions Saeed Mahameed
2018-08-08 22:48 ` [PATCH net 2/2] net/mlx5e: Cleanup of dcbnl related fields Saeed Mahameed
2018-08-13 12:32 ` Yuval Shaia
2018-08-14 9:01 ` Yuval Shaia
2018-08-14 10:52 ` Håkon Bugge
2018-08-09 2:10 ` [PATCH net 0/2] Mellanox, mlx5e fixes 2018-08-07 David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).