From: Jakub Kicinski <kuba@kernel.org>
To: Huazhong Tan <tanhuazhong@huawei.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
<salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
<huangdaode@huawei.com>, <linuxarm@openeuler.org>,
<linuxarm@huawei.com>, Guangbin Huang <huangguangbin2@huawei.com>
Subject: Re: [PATCH net-next 1/2] net: hns3: PF add support for pushing link status to VFs
Date: Tue, 13 Apr 2021 10:18:26 -0700 [thread overview]
Message-ID: <20210413101826.103b25fc@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <1618294621-41356-2-git-send-email-tanhuazhong@huawei.com>
On Tue, 13 Apr 2021 14:17:00 +0800 Huazhong Tan wrote:
> +static void hclge_push_link_status(struct hclge_dev *hdev)
> +{
> + struct hclge_vport *vport;
> + int ret;
> + u16 i;
> +
> + for (i = 0; i < pci_num_vf(hdev->pdev); i++) {
> + vport = &hdev->vport[i + HCLGE_VF_VPORT_START_NUM];
> +
> + if (!test_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state) ||
> + vport->vf_info.link_state != IFLA_VF_LINK_STATE_AUTO)
> + continue;
> +
> + ret = hclge_push_vf_link_status(vport);
> + if (ret) {
> + dev_err(&hdev->pdev->dev,
> + "failed to push link status to vf%u, ret = %d\n",
> + i, ret);
Isn't this error printed twice? Here and...
> +}
> +
> static void hclge_update_link_status(struct hclge_dev *hdev)
> {
> struct hnae3_handle *rhandle = &hdev->vport[0].roce;
> @@ -3246,14 +3269,24 @@ static int hclge_set_vf_link_state(struct hnae3_handle *handle, int vf,
> {
> struct hclge_vport *vport = hclge_get_vport(handle);
> struct hclge_dev *hdev = vport->back;
> + int link_state_old;
> + int ret;
>
> vport = hclge_get_vf_vport(hdev, vf);
> if (!vport)
> return -EINVAL;
>
> + link_state_old = vport->vf_info.link_state;
> vport->vf_info.link_state = link_state;
>
> - return 0;
> + ret = hclge_push_vf_link_status(vport);
> + if (ret) {
> + vport->vf_info.link_state = link_state_old;
> + dev_err(&hdev->pdev->dev,
> + "failed to push vf%d link status, ret = %d\n", vf, ret);
> + }
... here?
Otherwise the patches LGTM.
next prev parent reply other threads:[~2021-04-13 17:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 6:16 [PATCH net-next 0/2] net: hns3: updates for -next Huazhong Tan
2021-04-13 6:17 ` [PATCH net-next 1/2] net: hns3: PF add support for pushing link status to VFs Huazhong Tan
2021-04-13 17:18 ` Jakub Kicinski [this message]
2021-04-14 1:51 ` Huazhong Tan
2021-04-14 16:42 ` Jakub Kicinski
2021-04-15 1:11 ` Huazhong Tan
2021-04-15 1:53 ` Jakub Kicinski
2021-04-15 2:13 ` Huazhong Tan
2021-04-13 6:17 ` [PATCH net-next 2/2] net: hns3: VF not request link status when PF support push link status feature Huazhong Tan
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=20210413101826.103b25fc@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=huangdaode@huawei.com \
--cc=huangguangbin2@huawei.com \
--cc=linuxarm@huawei.com \
--cc=linuxarm@openeuler.org \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=tanhuazhong@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.