netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Yunsheng Lin <linyunsheng@huawei.com>,
	Peng Li <lipeng321@huawei.com>,
	Huazhong Tan <tanhuazhong@huawei.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 201/219] net: hns3: fix PFC not setting problem for DCB module
Date: Fri, 22 Nov 2019 00:48:52 -0500	[thread overview]
Message-ID: <20191122054911.1750-193-sashal@kernel.org> (raw)
In-Reply-To: <20191122054911.1750-1-sashal@kernel.org>

From: Yunsheng Lin <linyunsheng@huawei.com>

[ Upstream commit d3ad430ac531e65f29c9737f86744c425c9173ef ]

The PFC enabling is based on user priority, currently it is
based on TC, which may cause PFC not setting correctly when pri
to TC mapping is not one to one relation.

This patch adds pfc_en in tm_info to fix it.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c  | 7 ++++---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 1 +
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c   | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index 92f19384e2585..a75d7c826fc2b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -245,6 +245,9 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
 	    hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE)
 		return -EINVAL;
 
+	if (pfc->pfc_en == hdev->tm_info.pfc_en)
+		return 0;
+
 	prio_tc = hdev->tm_info.prio_tc;
 	pfc_map = 0;
 
@@ -257,10 +260,8 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
 		}
 	}
 
-	if (pfc_map == hdev->tm_info.hw_pfc_map)
-		return 0;
-
 	hdev->tm_info.hw_pfc_map = pfc_map;
+	hdev->tm_info.pfc_en = pfc->pfc_en;
 
 	return hclge_pause_setup_hw(hdev);
 }
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
index 1528fb3fa6be6..260b1e7796908 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
@@ -249,6 +249,7 @@ struct hclge_tm_info {
 	struct hclge_tc_info tc_info[HNAE3_MAX_TC];
 	enum hclge_fc_mode fc_mode;
 	u8 hw_pfc_map; /* Allow for packet drop or not on this TC */
+	u8 pfc_en;	/* PFC enabled or not for user priority */
 };
 
 struct hclge_comm_stats_str {
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index 11e9259ca0407..daf364e421b73 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -1162,7 +1162,7 @@ static int hclge_pfc_setup_hw(struct hclge_dev *hdev)
 				HCLGE_RX_MAC_PAUSE_EN_MSK;
 
 	return hclge_pfc_pause_en_cfg(hdev, enable_bitmap,
-				      hdev->tm_info.hw_pfc_map);
+				      hdev->tm_info.pfc_en);
 }
 
 /* Each Tc has a 1024 queue sets to backpress, it divides to
-- 
2.20.1


  parent reply	other threads:[~2019-11-22  5:53 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191122054911.1750-1-sashal@kernel.org>
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 044/219] mwifiex: fix potential NULL dereference and use after free Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 045/219] mwifiex: debugfs: correct histogram spacing, formatting Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 046/219] brcmfmac: set F2 watermark to 256 for 4373 Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 047/219] brcmfmac: set SDIO F1 MesBusyCtrl for CYW4373 Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 048/219] rtl818x: fix potential use after free Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 059/219] iwlwifi: move iwl_nvm_check_version() into dvm Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 060/219] iwlwifi: mvm: force TCM re-evaluation on TCM resume Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 061/219] iwlwifi: pcie: fix erroneous print Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 062/219] iwlwifi: pcie: set cmd_len in the correct place Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 067/219] VSOCK: bind to random port for VMADDR_PORT_ANY Sasha Levin
2019-11-22  5:46 ` [PATCH AUTOSEL 4.19 087/219] net/mlx5: Continue driver initialization despite debugfs failure Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 088/219] netfilter: nf_nat_sip: fix RTP/RTCP source port translations Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 090/219] bnxt_en: Return linux standard errors in bnxt_ethtool.c Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 091/219] bnxt_en: Save ring statistics before reset Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 092/219] bnxt_en: query force speeds before disabling autoneg mode Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 105/219] vxlan: Fix error path in __vxlan_dev_create() Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 115/219] brcmfmac: Fix access point mode Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 116/219] ath6kl: Only use match sets when firmware supports it Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 117/219] ath6kl: Fix off by one error in scan completion Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 130/219] bpf/cpumap: make sure frame_size for build_skb is aligned if headroom isn't Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 138/219] net/netlink_compat: Fix a missing check of nla_parse_nested Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 139/219] net/net_namespace: Check the return value of register_pernet_subsys() Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 140/219] libceph: drop last_piece logic from write_partial_message_data() Sasha Levin
2019-11-22 14:00   ` Ilya Dryomov
2019-12-01 14:34     ` Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 145/219] net: (cpts) fix a missing check of clk_prepare Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 146/219] net: stmicro: " Sasha Levin
2019-11-22  5:47 ` [PATCH AUTOSEL 4.19 147/219] net: dsa: bcm_sf2: Propagate error value from mdio_write Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 148/219] atl1e: checking the status of atl1e_write_phy_reg Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 149/219] tipc: fix a missing check of genlmsg_put Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 150/219] net: marvell: fix a missing check of acpi_match_device Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 151/219] net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 158/219] netfilter: nf_tables: fix a missing check of nla_put_failure Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 159/219] xprtrdma: Prevent leak of rpcrdma_rep objects Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 170/219] tipc: fix memory leak in tipc_nl_compat_publ_dump Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 171/219] net/core/neighbour: tell kmemleak about hash tables Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 174/219] net/core/neighbour: fix kmemleak minimal reference count for " Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 177/219] sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 178/219] ip_tunnel: Make none-tunnel-dst tunnel port work with lwtunnel Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 179/219] decnet: fix DN_IFREQ_SIZE Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 180/219] net/smc: prevent races between smc_lgr_terminate() and smc_conn_free() Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 181/219] net/smc: don't wait for send buffer space when data was already sent Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 184/219] net/smc: fix sender_free computation Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 186/219] net/smc: fix byte_order for rx_curs_confirmed Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 187/219] tipc: fix skb may be leaky in tipc_link_input Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 189/219] sfc: initialise found bitmap in efx_ef10_mtd_probe Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 190/219] geneve: change NET_UDP_TUNNEL dependency to select Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 191/219] net: fix possible overflow in __sk_mem_raise_allocated() Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 192/219] net: ip_gre: do not report erspan_ver for gre or gretap Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 193/219] net: ip6_gre: do not report erspan_ver for ip6gre or ip6gretap Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 194/219] sctp: don't compare hb_timer expire date before starting it Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 195/219] bpf: decrease usercnt if bpf_map_new_fd() fails in bpf_map_get_fd_by_id() Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 197/219] net: dev: Use unsigned integer as an argument to left-shift Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 199/219] bpf: drop refcount if bpf_map_new_fd() fails in map_create() Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 200/219] net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED Sasha Levin
2019-11-22  5:48 ` Sasha Levin [this message]
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 202/219] net: hns3: fix an issue for hclgevf_ae_get_hdev Sasha Levin
2019-11-22  5:48 ` [PATCH AUTOSEL 4.19 203/219] net: hns3: fix an issue for hns3_update_new_int_gl Sasha Levin
2019-11-22  5:49 ` [PATCH AUTOSEL 4.19 218/219] xdp: fix cpumap redirect SKB creation bug Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191122054911.1750-193-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linyunsheng@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tanhuazhong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).