From: "luobin (L)" <luobin9@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <davem@davemloft.net>, <linux-kernel@vger.kernel.org>,
<netdev@vger.kernel.org>, <luoxianjun@huawei.com>,
<yin.yinshi@huawei.com>, <cloud.wangxiaoyun@huawei.com>,
<chiqijun@huawei.com>
Subject: Re: [PATCH net-next v3 1/2] hinic: add generating mailbox random index support
Date: Tue, 4 Aug 2020 09:57:56 +0800 [thread overview]
Message-ID: <5f8a2fd5-292b-db53-3cbd-def7c1f22725@huawei.com> (raw)
In-Reply-To: <20200803150544.57dbe802@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On 2020/8/4 6:05, Jakub Kicinski wrote:
> 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.
>
Okay, I'll pay attention to that next time.
>> +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.
Will fix. Thanks. Taking it out of the loop is a better way to avoid a long line length.
>
>> + if (err)
>> + break;
>> + }
> .
>
next prev parent reply other threads:[~2020-08-04 1:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-01 2:49 [PATCH net-next v3 0/2] hinic: mailbox channel enhancement Luo bin
2020-08-01 2:49 ` [PATCH net-next v3 1/2] hinic: add generating mailbox random index support Luo bin
2020-08-03 22:05 ` Jakub Kicinski
2020-08-04 1:57 ` luobin (L) [this message]
2020-08-01 2:49 ` [PATCH net-next v3 2/2] hinic: add check for mailbox msg from VF Luo bin
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=5f8a2fd5-292b-db53-3cbd-def7c1f22725@huawei.com \
--to=luobin9@huawei.com \
--cc=chiqijun@huawei.com \
--cc=cloud.wangxiaoyun@huawei.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luoxianjun@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=yin.yinshi@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;
as well as URLs for NNTP newsgroup(s).