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 CC421A0509; Wed, 6 Apr 2022 11:23:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A52F3427EB; Wed, 6 Apr 2022 11:23:19 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 8DC0840689 for ; Wed, 6 Apr 2022 11:23:18 +0200 (CEST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KYJt51mzVzgYPS; Wed, 6 Apr 2022 17:21:33 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 6 Apr 2022 17:23:17 +0800 From: "Min Hu (Connor)" To: CC: , Subject: [PATCH 3/7] net/hns3: fix pseudo-sharing between threads Date: Wed, 6 Apr 2022 17:22:36 +0800 Message-ID: <20220406092240.52900-4-humin29@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220406092240.52900-1-humin29@huawei.com> References: <20220406092240.52900-1-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected 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 From: Huisong Li Some fields in the end of 'struct hns3_rx_queue' and 'struct hns3_tx_queue' are not accessed in the I/O path. But these fields may be accessed in other threads, which may lead to the problem of pseudo-sharing of IO threads. This patch add a cacheline alignment to avoid it. Fixes: 9261fd3caf1f ("net/hns3: improve IO path data cache usage") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_rxtx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h index a000318357..62efc854e4 100644 --- a/drivers/net/hns3/hns3_rxtx.h +++ b/drivers/net/hns3/hns3_rxtx.h @@ -348,7 +348,7 @@ struct hns3_rx_queue { * The following fields are not accessed in the I/O path, so they are * placed at the end. */ - void *io_base; + void *io_base __rte_cache_aligned; struct hns3_adapter *hns; uint64_t rx_ring_phys_addr; /* RX ring DMA address */ const struct rte_memzone *mz; @@ -521,7 +521,7 @@ struct hns3_tx_queue { * The following fields are not accessed in the I/O path, so they are * placed at the end. */ - void *io_base; + void *io_base __rte_cache_aligned; struct hns3_adapter *hns; uint64_t tx_ring_phys_addr; /* TX ring DMA address */ const struct rte_memzone *mz; -- 2.33.0