net: hns3: Fix parameter type for q_id in hclge_tm_q_to_qs_map_cfg()
authorJian Shen <shenjian15@huawei.com>
Wed, 19 Sep 2018 17:29:58 +0000 (18:29 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Sep 2018 04:20:23 +0000 (21:20 -0700)
So far all the places calling hclge_tm_q_to_qs_map_cfg() are assigning
an u16 type value to "q_id", and in the processing of
hclge_tm_q_to_qs_map_cfg(), it also converts the "q_id" to le16.

The max tqp number for pf can be more than 256, we should use "u16" to
store the queue id, instead of "u8", which may cause data lost.

Fixes: 848440544b41 ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c

index 5db70a1451c58c8f683fb67320f39e50640f5d6a..0282067b157c0b42b0151d4119d93324545b77cb 100644 (file)
@@ -297,7 +297,7 @@ static int hclge_tm_qs_to_pri_map_cfg(struct hclge_dev *hdev,
 }
 
 static int hclge_tm_q_to_qs_map_cfg(struct hclge_dev *hdev,
-                                   u8 q_id, u16 qs_id)
+                                   u16 q_id, u16 qs_id)
 {
        struct hclge_nq_to_qs_link_cmd *map;
        struct hclge_desc desc;