net/mlx4_en: Fix mixed PFC and Global pause user control requests
authorEran Ben Elisha <eranbe@mellanox.com>
Tue, 27 Mar 2018 11:41:18 +0000 (14:41 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 31 May 2018 23:30:26 +0000 (00:30 +0100)
commit3cc0730eef779b6d7e27d6dfa5bd81f76a2baa0c
treeeaaf49139c212f6eac59a90ba71771a1994e1d8e
parentf43a81763f525db5509177e36e04a6927a80c14e
net/mlx4_en: Fix mixed PFC and Global pause user control requests

commit 6e8814ceb7e8f468659ef9253bd212c07ae19584 upstream.

Global pause and PFC configuration should be mutually exclusive (i.e. only
one of them at most can be set). However, once PFC was turned off,
driver automatically turned Global pause on. This is a bug.

Fix the driver behaviour to turn off PFC/Global once the user turned the
other on.

This also fixed a weird behaviour that at a current time, the profile
had both PFC and global pause configuration turned on, which is
Hardware-wise impossible and caused returning false positive indication
to query tools.

In addition, fix error code when setting global pause or PFC to change
metadata only upon successful change.

Also, removed useless debug print.

Fixes: af7d51852631 ("net/mlx4_en: Add DCB PFC support through CEE netlink commands")
Fixes: c27a02cd94d6 ("mlx4_en: Add driver for Mellanox ConnectX 10GbE NIC")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2:
 - Drop changes in en_dcb_nl.c
 - Don't call mlx4_en_update_pfc_stats_bitmap()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
drivers/net/ethernet/mellanox/mlx4/en_main.c