[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200803150544.57dbe802@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Mon, 3 Aug 2020 15:05:44 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Luo bin <luobin9@...wei.com>
Cc: <davem@...emloft.net>, <linux-kernel@...r.kernel.org>,
<netdev@...r.kernel.org>, <luoxianjun@...wei.com>,
<yin.yinshi@...wei.com>, <cloud.wangxiaoyun@...wei.com>,
<chiqijun@...wei.com>
Subject: Re: [PATCH net-next v3 1/2] hinic: add generating mailbox random
index support
On Sat, 1 Aug 2020 10:49:34 +0800 Luo bin wrote:
> add support to generate mailbox random id of VF to ensure that
> mailbox messages PF received are from the correct VF.
>
> Signed-off-by: Luo bin <luobin9@...wei.com>
> ---
> V2~V3 fix review opinions pointed out by Jakub
In the future please specify what was changed, e.g.:
- use get_random_u32()
- remove unnecessary parenthesis
etc.
> +int hinic_vf_mbox_random_id_init(struct hinic_hwdev *hwdev)
> +{
> + u8 vf_in_pf;
> + int err = 0;
> +
> + if (HINIC_IS_VF(hwdev->hwif))
> + return 0;
> +
> + for (vf_in_pf = 1; vf_in_pf <= hwdev->nic_cap.max_vf; vf_in_pf++) {
> + err = set_vf_mbox_random_id(hwdev, hinic_glb_pf_vf_offset
> + (hwdev->hwif) + vf_in_pf);
I'm sorry but you must put the call to hinic_glb_pf_vf_offset() on a
separate line. Perhaps take this call out of the for loop entirely?
The way it's written with the parenthesis on the next line is hard to
read.
> + if (err)
> + break;
> + }
Powered by blists - more mailing lists