/[packages]/cauldron/kernel/current/PATCHES/patches/0050-net-hns3-Fix-ets-validate-issue.patch
ViewVC logotype

Contents of /cauldron/kernel/current/PATCHES/patches/0050-net-hns3-Fix-ets-validate-issue.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1329221 - (show annotations) (download)
Fri Nov 9 22:05:45 2018 UTC (5 years, 10 months ago) by tmb
File size: 1957 byte(s)
add fixes from sashas autosel queue
1 From 15280c1ca9340e12e9ce94807e19d191ee353b63 Mon Sep 17 00:00:00 2001
2 From: Jian Shen <shenjian15@huawei.com>
3 Date: Fri, 21 Sep 2018 16:41:37 +0100
4 Subject: [PATCH 050/145] net: hns3: Fix ets validate issue
5
6 [ Upstream commit adefc0a2ff465f4ac4a88450fe69d336c8b074c5 ]
7
8 There is a defect in hclge_ets_validate(). If each member of tc_tsa is
9 not IEEE_8021QAZ_TSA_ETS, the variable total_ets_bw won't be updated.
10 In this case, the check for value of total_ets_bw will fail. This patch
11 fixes it by checking total_ets_bw only after it has been updated.
12
13 Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
14 Signed-off-by: Jian Shen <shenjian15@huawei.com>
15 Signed-off-by: Peng Li <lipeng321@huawei.com>
16 Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
17 Signed-off-by: David S. Miller <davem@davemloft.net>
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
19 ---
20 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 6 ++++--
21 1 file changed, 4 insertions(+), 2 deletions(-)
22
23 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
24 index f08ebb7caaaf..92f19384e258 100644
25 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
26 +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
27 @@ -73,6 +73,7 @@ static int hclge_ieee_getets(struct hnae3_handle *h, struct ieee_ets *ets)
28 static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets,
29 u8 *tc, bool *changed)
30 {
31 + bool has_ets_tc = false;
32 u32 total_ets_bw = 0;
33 u8 max_tc = 0;
34 u8 i;
35 @@ -100,13 +101,14 @@ static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets,
36 *changed = true;
37
38 total_ets_bw += ets->tc_tx_bw[i];
39 - break;
40 + has_ets_tc = true;
41 + break;
42 default:
43 return -EINVAL;
44 }
45 }
46
47 - if (total_ets_bw != BW_PERCENT)
48 + if (has_ets_tc && total_ets_bw != BW_PERCENT)
49 return -EINVAL;
50
51 *tc = max_tc + 1;
52 --
53 2.19.1
54

  ViewVC Help
Powered by ViewVC 1.1.30