linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Salil Mehta <salil.mehta@huawei.com>
To: <davem@davemloft.net>
Cc: <salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
	<lipeng321@huawei.com>, <mehta.salil@opnsrc.net>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, Jian Shen <shenjian15@huawei.com>
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	[thread overview]
Message-ID: <20180919172958.12992-13-salil.mehta@huawei.com> (raw)
In-Reply-To: <20180919172958.12992-1-salil.mehta@huawei.com>

From: Jian Shen <shenjian15@huawei.com>

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>
---
 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



  parent reply	other threads:[~2018-09-19 17:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 17:29 [PATCH net-next 00/12] Fixes, cleanups & minor additions to HNS3 driver Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 01/12] net: hns3: Add default irq affinity Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 02/12] net: hns3: Add unlikely for buf_num check Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 03/12] net: hns3: Remove tx budget to clean more TX descriptors in a napi Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 04/12] net: hns3: Remove packet statistics of public Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 05/12] net: hns3: Add support for hns3_nic_netdev_ops.ndo_do_ioctl Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 06/12] net: hns3: Set STATE_DOWN bit of hdev state when stopping net Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 07/12] net: hns3: Check hdev state when getting link status Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 08/12] net: hns3: Fix for setting speed for phy failed problem Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 09/12] net: hns3: Fix cmdq registers initialization issue for vf Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 10/12] net: hns3: Clear client pointer when initialize client failed or unintialize finished Salil Mehta
2018-09-19 17:29 ` [PATCH net-next 11/12] net: hns3: Fix client initialize state issue when roce client initialize failed Salil Mehta
2018-09-19 17:29 ` Salil Mehta [this message]
2018-09-20  4:21 ` [PATCH net-next 00/12] Fixes, cleanups & minor additions to HNS3 driver David Miller

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=20180919172958.12992-13-salil.mehta@huawei.com \
    --to=salil.mehta@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=mehta.salil@opnsrc.net \
    --cc=netdev@vger.kernel.org \
    --cc=shenjian15@huawei.com \
    --cc=yisen.zhuang@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).