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 2EC9943A4E; Fri, 2 Feb 2024 10:06:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DF1D4026E; Fri, 2 Feb 2024 10:06:42 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id A9ACF4021D for ; Fri, 2 Feb 2024 10:06:40 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4121WVPk011544; Fri, 2 Feb 2024 01:06:39 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=pfpt0220; bh=VhkmThj9 A6jyVvatvG8oAasI6m89Cj6RDRSUL90eD/s=; b=kBIy0n/0187jUGFgkg9EMCHw 995O81263V4RDB6GWIaf3IcQW856MAHnHK9XN57y9jOd+PgtJialWCDCfDzyC614 Rdxd/687I7CLKRt+YiT8Unv221a2SD74xmHAB7o13QM0N6uPsj8WJ5pmv37d0wNz 0gYWs5hvrgecbVBGBbtXQDi72YTy0pnckErXQ/V5MwQnYUGP9UL98wvW/bv38nyx zoKZqYGElyFq7aGzkLfK+Kovo5j+Ej4LEfQGy3p9PlVcE3mMGOgjAG+mQ5F9ANUO 5OGRHloDExC1kSKRUUO20e95cZvUgSt2iLQ/4Q3BNU9/OQRsyPDYRmbt5q8qJg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3w0ptnh2fa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 02 Feb 2024 01:06:39 -0800 (PST) Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 2 Feb 2024 01:06:37 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Fri, 2 Feb 2024 01:06:37 -0800 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id 83D725C6C68; Fri, 2 Feb 2024 01:06:35 -0800 (PST) From: To: , Chengwen Feng , Kevin Laatz , Bruce Richardson CC: , Pavan Nikhilesh Subject: [PATCH] dmadev: standardize alignment and allocation Date: Fri, 2 Feb 2024 14:36:33 +0530 Message-ID: <20240202090633.10816-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: TF6hcT40WBifH3_hOCKqeSmIs2CvABbR X-Proofpoint-GUID: TF6hcT40WBifH3_hOCKqeSmIs2CvABbR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-02_03,2024-01-31_01,2023-05-22_02 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: Pavan Nikhilesh Align fp_objects based on cacheline size, allocate devices and fp_objects memory on hugepages. Signed-off-by: Pavan Nikhilesh --- lib/dmadev/rte_dmadev.c | 6 ++---- lib/dmadev/rte_dmadev_core.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 67434c805f43..1fe1434019f0 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -143,10 +143,9 @@ dma_fp_data_prepare(void) */ size = dma_devices_max * sizeof(struct rte_dma_fp_object) + RTE_CACHE_LINE_SIZE; - ptr = malloc(size); + ptr = rte_zmalloc("", size, RTE_CACHE_LINE_SIZE); if (ptr == NULL) return -ENOMEM; - memset(ptr, 0, size); rte_dma_fp_objs = RTE_PTR_ALIGN(ptr, RTE_CACHE_LINE_SIZE); for (i = 0; i < dma_devices_max; i++) @@ -164,10 +163,9 @@ dma_dev_data_prepare(void) return 0; size = dma_devices_max * sizeof(struct rte_dma_dev); - rte_dma_devices = malloc(size); + rte_dma_devices = rte_zmalloc("", size, RTE_CACHE_LINE_SIZE); if (rte_dma_devices == NULL) return -ENOMEM; - memset(rte_dma_devices, 0, size); return 0; } diff --git a/lib/dmadev/rte_dmadev_core.h b/lib/dmadev/rte_dmadev_core.h index 064785686f7f..e8239c2d22b6 100644 --- a/lib/dmadev/rte_dmadev_core.h +++ b/lib/dmadev/rte_dmadev_core.h @@ -73,7 +73,7 @@ struct rte_dma_fp_object { rte_dma_completed_t completed; rte_dma_completed_status_t completed_status; rte_dma_burst_capacity_t burst_capacity; -} __rte_aligned(128); +} __rte_cache_aligned; extern struct rte_dma_fp_object *rte_dma_fp_objs; -- 2.43.0