From: "Yankejian (Hackim Yim)" <yankejian@huawei.com>
To: Joe Perches <joe@perches.com>, David Miller <davem@davemloft.net>
Cc: <lisheng011@huawei.com>, <lipeng321@huawei.com>,
<salil.mehta@huawei.com>, <huangdaode@hisilicon.com>,
<xuwei5@hisilicon.com>, <liguozhu@huawei.com>,
<haifeng.wei@huawei.com>, <yisen.zhuang@huawei.com>,
<linuxarm@huawei.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: hns: optimize XGE capability by reducing cpu usage
Date: Mon, 7 Dec 2015 17:26:15 +0800 [thread overview]
Message-ID: <566550B7.5000104@huawei.com> (raw)
In-Reply-To: <1449479109.3597.1.camel@perches.com>
On 2015/12/7 17:05, Joe Perches wrote:
> On Mon, 2015-12-07 at 16:58 +0800, Yankejian (Hackim Yim) wrote:
>> On 2015/12/7 11:32, Joe Perches wrote:
>>> On Sun, 2015-12-06 at 22:29 -0500, David Miller wrote:
>>>>> From: yankejian <yankejian@huawei.com>
>>>>> Date: Sat, 5 Dec 2015 15:32:29 +0800
>>>>>
>>>>>>> +#if (PAGE_SIZE < 8192)
>>>>>>> + if (hnae_buf_size(ring) == HNS_BUFFER_SIZE_2048) {
>>>>>>> + truesize = hnae_buf_size(ring);
>>>>>>> + } else {
>>>>>>> + truesize = ALIGN(size, L1_CACHE_BYTES);
>>>>>>> + last_offset = hnae_page_size(ring) - hnae_buf_size(ring);
>>>>>>> + }
>>>>>>> +
>>>>>>> +#else
>>>>>>> + truesize = ALIGN(size, L1_CACHE_BYTES);
>>>>>>> + last_offset = hnae_page_size(ring) - hnae_buf_size(ring);
>>>>>>> +#endif
>>>>> This is not indented properly, and it looks terrible.
>>> And it makes one curious as to why last_offset isn't set
>>> in the first block.
>> Hi Joe,
> Hello.
>
>> if hnae_buf_size que equal to HNS_BUFFER_SIZE, last_offset is useless in the routines of this function.
>> so it is ignored in the first block. thanks for your suggestion.
> More to the point, last_offset is initialized to 0.
>
> It'd be clearer not to initialize it at all and
thanks, that is a good idea.
> set it to 0 in the first block and not overwrite
> the initialization in each subsequent block.
because it is useless, i think we'd better ignored it.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> .
>
next prev parent reply other threads:[~2015-12-07 9:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-05 7:32 [PATCH net-next] net: hns: optimize XGE capability by reducing cpu usage yankejian
2015-12-07 3:29 ` David Miller
2015-12-07 3:32 ` Joe Perches
2015-12-07 8:58 ` Yankejian (Hackim Yim)
2015-12-07 9:05 ` Joe Perches
2015-12-07 9:26 ` Yankejian (Hackim Yim) [this message]
2015-12-07 8:37 ` Yankejian (Hackim Yim)
2015-12-07 8:58 ` Du, Fan
2015-12-08 6:22 ` Yankejian (Hackim Yim)
2015-12-08 6:30 ` Du, Fan
2015-12-08 6:58 ` Yankejian (Hackim Yim)
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=566550B7.5000104@huawei.com \
--to=yankejian@huawei.com \
--cc=davem@davemloft.net \
--cc=haifeng.wei@huawei.com \
--cc=huangdaode@hisilicon.com \
--cc=joe@perches.com \
--cc=liguozhu@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lipeng321@huawei.com \
--cc=lisheng011@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=xuwei5@hisilicon.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 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).