From: Lipeng <lipeng321@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>, <yisen.zhuang@huawei.com>,
<salil.mehta@huawei.com>, <lipeng321@huawei.com>
Subject: [PATCH net-next 4/7] net: hns3: get vf count by pci_sriov_get_totalvfs
Date: Mon, 23 Oct 2017 19:51:04 +0800 [thread overview]
Message-ID: <1508759467-18397-5-git-send-email-lipeng321@huawei.com> (raw)
In-Reply-To: <1508759467-18397-1-git-send-email-lipeng321@huawei.com>
This patch gets vf count by standard function pci_sriov_get_totalvfs,
instead of info from NIC HW.
Signed-off-by: Lipeng <lipeng321@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 8508521..4431241 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -837,7 +837,6 @@ static int hclge_parse_func_status(struct hclge_dev *hdev,
else
hdev->flag &= ~HCLGE_FLAG_MAIN;
- hdev->num_req_vfs = status->vf_num / status->pf_num;
return 0;
}
@@ -4361,6 +4360,8 @@ static int hclge_pci_init(struct hclge_dev *hdev)
goto err_clr_master;
}
+ hdev->num_req_vfs = pci_sriov_get_totalvfs(pdev);
+
return 0;
err_clr_master:
pci_clear_master(pdev);
--
1.9.1
next prev parent reply other threads:[~2017-10-23 11:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-23 11:51 [PATCH net-next 0/7] net: hns3: bug fixes & code improvements Lipeng
2017-10-23 11:51 ` [PATCH net-next 1/7] net: hns3: fix a bug when alloc new buffer Lipeng
2017-10-23 11:51 ` [PATCH net-next 2/7] net: hns3: fix the bug when map buffer fail Lipeng
2017-10-23 11:51 ` [PATCH net-next 3/7] net: hns3: fix the ops check in hns3_get_rxnfc Lipeng
2017-10-23 11:51 ` Lipeng [this message]
2017-10-23 11:51 ` [PATCH net-next 5/7] net: hns3: fix the TX/RX ring.queue_index in hns3_ring_get_cfg Lipeng
2017-10-23 11:51 ` [PATCH net-next 6/7] net: hns3: remove redundant memset when alloc buffer Lipeng
2017-10-23 11:51 ` [PATCH net-next 7/7] net: hns3: fix a bug about hns3_clean_tx_ring Lipeng
2017-10-24 0:17 ` [PATCH net-next 0/7] net: hns3: bug fixes & code improvements 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=1508759467-18397-5-git-send-email-lipeng321@huawei.com \
--to=lipeng321@huawei.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@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