Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1016050imm; Wed, 19 Sep 2018 10:32:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZPZ/juI4xefbFWDtPssXm/8LdyM/HN0LuCYh70kp7GTrbxPqXjxPmvB4/Pqk5BH5FsPEou X-Received: by 2002:a17:902:ac97:: with SMTP id h23-v6mr31074848plr.174.1537378336978; Wed, 19 Sep 2018 10:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537378336; cv=none; d=google.com; s=arc-20160816; b=VWbY/q3lmlnadp2gILxbjkj9e7VAWW1kTxqR9XqipFhQqPI/bSu3BEQia6ZNcIz3Am euRkfneR4d2SAGorlriFYUB/0PqWX51B2Exv+k5t2wfHTDgWE8k/+HmeDIDSJH9ZPmU+ a5B6i2UsB6AcgJZ++NPSUKAnBdvM7UZnIMynyfS3y2Zs55EUDwjGVQuW8LVjQ56mEjXg dyNKTIIsXPVJ3tZsEFkbZErNMtIWlZSjQJxKmXBWr3uwRDihve9wdSGHdyocJEv6OVOD fEZzLUm5NIy9WinlBN2BgMnP0DP+fOY5TySHwWbPH1OOw+s7BEgH2WzZNd3xYQKPXF81 Z53g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=9MeUm1KgLVizeGs9h15W89cfHGskeAJJkn0W4n6byEk=; b=DzX+xx4aC53f1Q6V1zmOUGsAO0FgpzIXzdI4hz6COhsL2exfqJa99ATQnaC8zhDz8O 943hat+plsBlI+5BeUSzdkVkCcJLfA0V+ZCBQoAd+s1YrAkN1JYK5V3watnWGXmf8wm4 g2FJz9+nHjmicIHVfST6pqc/jTNQzQM24cSDFEhmyLeju1Ei97sXm3eUbpjyzUZnY/CG 1KAbBrdNHE24o1VlM1cVP2XdxT8VuggwpODQcERv7MAexsQ5i8amS9YAfgc8WlP9r1/k l4kXP0ktzeGKD6G47ceDzOgzZT/p0Wb4n4UgmDc5EDpf4MpUXKeQxA6HtwQjhWHwg48Y iLjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v38-v6si25535488plg.179.2018.09.19.10.32.01; Wed, 19 Sep 2018 10:32:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387414AbeISXKf (ORCPT + 99 others); Wed, 19 Sep 2018 19:10:35 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:40338 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733057AbeISXKf (ORCPT ); Wed, 19 Sep 2018 19:10:35 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4333D90B43368; Thu, 20 Sep 2018 01:31:34 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.399.0; Thu, 20 Sep 2018 01:31:26 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 12/12] net: hns3: Fix parameter type for q_id in hclge_tm_q_to_qs_map_cfg() Date: Wed, 19 Sep 2018 18:29:58 +0100 Message-ID: <20180919172958.12992-13-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180919172958.12992-1-salil.mehta@huawei.com> References: <20180919172958.12992-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen 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 Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c index 5db70a1..0282067 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c @@ -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; -- 2.7.4