From patchwork Wed Sep 19 17:29:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 147043 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp987278ljw; Wed, 19 Sep 2018 10:31:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbB8EAt4XHoBBQ4g9+HkiykBGDIs48dRMJWPUNmfQAuHkSf+6Kul7jy5gK8xZ+yZPC5vtGI X-Received: by 2002:a17:902:e5:: with SMTP id a92-v6mr35520559pla.273.1537378302711; Wed, 19 Sep 2018 10:31:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537378302; cv=none; d=google.com; s=arc-20160816; b=eGr+t3CYWf3mxaj4Y+1Jf7X7OdAwT0U7iL4hQ380s91UKYTD83zMHe8XgqIyClfs4z kxtsYV1RxOO/YPDOEOLBz/Z7Cb3gqL61JgexMyE/n5knL0yff/xDwFgPOGN3Xegw8xv5 aPsJc2EbrjPVdwkuag8X9GWRhcFvhk/6YdNmzY+byBXxTaz6HmAt/ZzASL8BiwutBQ6G Rl5uqysuldNJIsOza3S4I7kp4wIpDPPRIHpsU4rmT+lPZVWdjVRl6M0Y+tfoz39exBi+ 0+q9i728dG3nufphv3Kk50gAsUkzGuXoMXxpl2MO0Bf/U7Fi9GzuZp9E50AA8/Swf63v w70g== 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 m39-v6si21192601plg.486.2018.09.19.10.31.42; Wed, 19 Sep 2018 10:31:42 -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 S2387400AbeISXKf (ORCPT + 32 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 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(-) -- 2.7.4 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;