From: "lipeng (Y)" <lipeng321@huawei.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>, <yisen.zhuang@huawei.com>,
<salil.mehta@huawei.com>
Subject: Re: [PATCH net-next 05/10] net: hns3: using modulo for cyclic counters in hclge_cmd_send
Date: Mon, 2 Jul 2018 15:06:46 +0800 [thread overview]
Message-ID: <5ef0b797-67ff-e84a-367d-bd3da96a13b3@huawei.com> (raw)
In-Reply-To: <20180630.210342.804224843120744818.davem@davemloft.net>
On 2018/6/30 20:03, David Miller wrote:
> From: Peng Li <lipeng321@huawei.com>
> Date: Fri, 29 Jun 2018 19:23:00 +0800
>
>> @@ -228,8 +228,7 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
>> desc_to_use = &hw->cmq.csq.desc[hw->cmq.csq.next_to_use];
>> *desc_to_use = desc[handle];
>> (hw->cmq.csq.next_to_use)++;
>> - if (hw->cmq.csq.next_to_use == hw->cmq.csq.desc_num)
>> - hw->cmq.csq.next_to_use = 0;
>> + hw->cmq.csq.next_to_use %= hw->cmq.csq.desc_num;
>> handle++;
> I would advise against this.
>
> The "%" modulus operation takes many cpu cycles, and the current code
> is thus much faster.
>
> .
Agree with you.
Thanks for your review, we concentrate on the code style and ignore the
performance in this patch, It is not good.
I will remove this patch from the patchset.
>
next prev parent reply other threads:[~2018-07-02 7:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-29 11:22 [PATCH net-next 00/10] net: hns3: a few code improvements Peng Li
2018-06-29 11:22 ` [PATCH net-next 01/10] net: hns3: remove unused hclge_ring_to_dma_dir Peng Li
2018-06-29 11:22 ` [PATCH net-next 02/10] net: hns3: remove useless code in hclge_cmd_send Peng Li
2018-06-29 11:22 ` [PATCH net-next 03/10] net: hns3: remove some redundant assignments Peng Li
2018-06-29 11:22 ` [PATCH net-next 04/10] net: hns3: simplify hclge_cmd_csq_clean Peng Li
2018-06-29 11:23 ` [PATCH net-next 05/10] net: hns3: using modulo for cyclic counters in hclge_cmd_send Peng Li
2018-06-30 12:03 ` David Miller
2018-07-02 7:06 ` lipeng (Y) [this message]
2018-06-29 11:23 ` [PATCH net-next 06/10] net: hns3: remove a redundant hclge_cmd_csq_done Peng Li
2018-06-29 11:23 ` [PATCH net-next 07/10] net: hns3: remove some unused members of some structures Peng Li
2018-06-29 11:23 ` [PATCH net-next 08/10] net: hns3: give default option while dependency HNS3 set Peng Li
2018-06-29 11:23 ` [PATCH net-next 09/10] net: hns3: use dma_zalloc_coherent instead of kzalloc/dma_map_single Peng Li
2018-06-29 11:23 ` [PATCH net-next 10/10] net: hns3: modify hnae_ to hnae3_ Peng Li
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=5ef0b797-67ff-e84a-367d-bd3da96a13b3@huawei.com \
--to=lipeng321@huawei.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.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