From: "Min Hu (Connor)" <humin29@huawei.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, <ferruh.yigit@intel.com>,
<andrew.rybchenko@oktetlabs.ru>
Subject: Re: [dpdk-dev] [PATCH v2] net/hns3: support Tx push quick doorbell to improve perf
Date: Tue, 15 Jun 2021 11:46:14 +0800 [thread overview]
Message-ID: <af94bb20-d371-a1d9-bc00-ef182f79f470@huawei.com> (raw)
In-Reply-To: <20210614193737.39f5151c@hermes.local>
Hi, Stephen,
Volatile is used here to prevent compiler optimization (deleting the reg
write operation).
By the way, this is an initialization process and does not involve
multi-thread synchronization.
Therefore no need to use the barrier.
在 2021/6/15 10:37, Stephen Hemminger 写道:
> On Tue, 15 Jun 2021 09:34:29 +0800
> "Min Hu (Connor)" <humin29@huawei.com> wrote:
>
>> +void
>> +hns3_tx_push_init(struct rte_eth_dev *dev)
>> +{
>> + struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>> + volatile uint32_t *reg;
>> + uint32_t val;
>> +
>> + if (!hns3_dev_tx_push_supported(hw))
>> + return;
>> +
>> + reg = (volatile uint32_t *)hns3_tx_push_get_queue_tail_reg(dev, 0);
>
> Better to use proper barrier function than using volatile.
> .
>
next prev parent reply other threads:[~2021-06-15 3:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-13 1:42 [dpdk-dev] [PATCH] " Min Hu (Connor)
2021-06-13 1:42 ` Min Hu (Connor)
2021-06-14 14:35 ` Andrew Rybchenko
2021-06-15 1:35 ` Min Hu (Connor)
2021-06-15 1:34 ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
2021-06-15 2:36 ` Stephen Hemminger
2021-06-15 2:37 ` Stephen Hemminger
2021-06-15 3:46 ` Min Hu (Connor) [this message]
2021-06-17 15:18 ` Andrew Rybchenko
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=af94bb20-d371-a1d9-bc00-ef182f79f470@huawei.com \
--to=humin29@huawei.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=stephen@networkplumber.org \
/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).