lkml.org 
[lkml]   [2020]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@huawei.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;
> + }

\
 
 \ /
  Last update: 2020-08-04 00:08    [W:0.035 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site