From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7B400A0C4A; Tue, 15 Jun 2021 05:46:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 018824067A; Tue, 15 Jun 2021 05:46:19 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id E2D0B40140 for ; Tue, 15 Jun 2021 05:46:17 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G3vKk2nf1z6yJJ; Tue, 15 Jun 2021 11:43:06 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 15 Jun 2021 11:46:14 +0800 To: Stephen Hemminger CC: , , References: <1623548576-34995-2-git-send-email-humin29@huawei.com> <1623720869-26320-1-git-send-email-humin29@huawei.com> <20210614193737.39f5151c@hermes.local> From: "Min Hu (Connor)" Message-ID: Date: Tue, 15 Jun 2021 11:46:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20210614193737.39f5151c@hermes.local> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v2] net/hns3: support Tx push quick doorbell to improve perf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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)" 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. > . >