lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210413101826.103b25fc@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Tue, 13 Apr 2021 10:18:26 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Huazhong Tan <tanhuazhong@...wei.com>
Cc:     <davem@...emloft.net>, <netdev@...r.kernel.org>,
        <salil.mehta@...wei.com>, <yisen.zhuang@...wei.com>,
        <huangdaode@...wei.com>, <linuxarm@...neuler.org>,
        <linuxarm@...wei.com>, Guangbin Huang <huangguangbin2@...wei.com>
Subject: Re: [PATCH net-next 1/2] net: hns3: PF add support for pushing link
 status to VFs

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ