From: Eugenia Emantayev <eugenia@mellanox.com>
Date: Wed, 21 Aug 2013 07:08:56 +0000 (+0300)
Subject: net/mlx4_en: Disable global flow control when PFC enabled
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e316f1b9bd86261fb3283b3ac2eeebd5ef56f1b;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

net/mlx4_en: Disable global flow control when PFC enabled

Fix a bug when FC and PFC are enabled/disabled at the same time.
According to ConnectX-3 Programmer Manual these two features are mutial
exclusive.  So make sure when enabling PFC to turn off global FC and
vise versa.  Otherwise it hurts the performance.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
index f71fba97d786..b4881b686159 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
@@ -170,8 +170,8 @@ static int mlx4_en_dcbnl_ieee_setpfc(struct net_device *dev,
 			pfc->mbc,
 			pfc->delay);
 
-	prof->rx_pause = !!pfc->pfc_en;
-	prof->tx_pause = !!pfc->pfc_en;
+	prof->rx_pause = !pfc->pfc_en;
+	prof->tx_pause = !pfc->pfc_en;
 	prof->rx_ppp = pfc->pfc_en;
 	prof->tx_ppp = pfc->pfc_en;