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 15E75A0544; Tue, 11 Oct 2022 02:54:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C041542C34; Tue, 11 Oct 2022 02:52:28 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2082.outbound.protection.outlook.com [40.107.93.82]) by mails.dpdk.org (Postfix) with ESMTP id 8F8E342C25 for ; Tue, 11 Oct 2022 02:52:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C96vemvE1ubOtaWmhyvgu0pDxFQEfLW/7eN3QYZO8A5GbmOCNrEtFW/VP2GKyu9xXL3HH4rtU+fA8F3GoH8cmPC/L4gXZ4b/pKKYW68OdvE2GuopN3WyoswDKFmzTkh1Q0cEv5yn9WfgDaahpH/lX4Kz/L5ieIXkoJmMbuMwq7HYDs1DqEfH20MA6fTjUdvji/3dWOfiSV1hXdFInLTIQcLNO0u5XhLFpPuOKzYXmiUVeFVmeqT7/ecq7mRdgDU3sqprpoOtBhfQAwOToYCdC2NAgzy6hcKsf727K4eVO2MfRsS5QMi2DykR+xBaPLgSLnXsZANqyUDn0g+w0+KFZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4IbUbm1maboOS8MtFY/vuuNq/lASa8Zxb9GD2E7/Mm0=; b=CefFXOlbGHmR8CNKYf/Q1j1HvOK5HJigICzr9hI3W4DsC0IeuuaqaTvFocBgAyvwDGOg9g50auN9QzMBXVjqDi3s/Egms2Cb1t1IjyewsGJbcdFWIhRiyOdJx6x1EBxGj1jgS8YstjL8kdPVMJXWGZwFQnwHxDjpmAk8DgcUuXLPdSeDUzJ5t4ZhSG0cqOq1rF/wfNBVwt11ZrsmFVSbk3Iuxh0rZII91gg0l4iEwSGgS4Pv5HH7lo+1+Egbu23TtV1vPu770DtHPLSSm1Age+/0e43XoV0xDqNSvc8IetL5o/Usf0J9UqwxfQMVnNbeKAAMADRSNMutNDgjwKIK3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4IbUbm1maboOS8MtFY/vuuNq/lASa8Zxb9GD2E7/Mm0=; b=fmEHqmNuCwEA9McY8waw9EVAmx9Q/idxutvp/ff+8eNucKUlgsZVl/uqt7hbMUc8sSTl+moUE3NnZAsy0fnQ9Obat/YPblPDW1bWiRbFUtJ4oei9vHrYaCMjmTUnZJKJF1CLojbfy6Q3JxQz4aQD88CNibilFPdQM7Va5dVi20c= Received: from BN9PR03CA0888.namprd03.prod.outlook.com (2603:10b6:408:13c::23) by CH0PR12MB5170.namprd12.prod.outlook.com (2603:10b6:610:b9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Tue, 11 Oct 2022 00:52:19 +0000 Received: from BN8NAM11FT104.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13c:cafe::13) by BN9PR03CA0888.outlook.office365.com (2603:10b6:408:13c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15 via Frontend Transport; Tue, 11 Oct 2022 00:52:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT104.mail.protection.outlook.com (10.13.177.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5709.10 via Frontend Transport; Tue, 11 Oct 2022 00:52:19 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 10 Oct 2022 19:52:19 -0500 From: Andrew Boyer To: CC: Andrew Boyer Subject: [PATCH v1 30/35] net/ionic: add alignment and socket info in allocations Date: Mon, 10 Oct 2022 17:50:27 -0700 Message-ID: <20221011005032.47584-31-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221007174336.54354-1-andrew.boyer@amd.com> References: <20221007174336.54354-1-andrew.boyer@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT104:EE_|CH0PR12MB5170:EE_ X-MS-Office365-Filtering-Correlation-Id: 728228b8-5b5c-4eb6-afa4-08daab22d9ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0gbo6fHe9rd3RwqiYEitNVbjqCwQ1mqjUQ9Pf9KVKP2yDnwvVeaZbr2GWcAxcfBUd9ujT8eQ6wdWI9IGF0Leb6F1kRyBIPy8JcfNqpUeRTO0GIIvWFoYSPeLxagnPp6+VqU4uLCJdwkR8Cgyw0ndsc51nGDFjcJFNcesdiOVCAa6fZEBwT/lWScMD3zprrOk3SoP5fbgW0WumQNzH+KXjPyNJ5CXRXbOaR+kMCAMQsSvELEuqXllf2KpvZ8mpTTa38zE5OILQ7hDSBGocPiKLUNb7E2iX3qIxwZSk9rv3IxbtLfjihMQYmY2yikTfb/FtLdLA6ukXtf6e85Gk6o4FiK6NR39a0pqpC61GPWkbbjQPPQrfmmc4bK9t7e2RV7fIrIGtBaa92S34/czowmy/Ing1yJxO2TJr8O5M4qZx/GXx2a6WRjWI382hcH//ip0QgGQauBsZZ+MukwOcySUBkQ369L3dDok2MUPYNx4hJHzTDZADqaAZjHrNI0oEOnIohL7UpJ+O1JgpFfHYsLY+4oaxQWi5XPDHqdc2lUz4cHo6nsfQhWmp4V1umWGWcvjz481lm8+T698ZAfEhlcGTIYgpUPj0hgFzSnBKqGtxoKTU+ohC4pWe5KMNmhrsm6BYMcZSb3cwQ2s4BuHnCEtGk/xG9e+zrkrauQPMRJbBrD55nZOrfHN3jfbQTJmFb3wjQs889nHU6/SLgcIp/e5D4JFisaP/aLziGZfuMwhi+yrVn7mziAiK/9GSgbQYsVCPSTbi1Bfo2qQDadxpSuRWQRJgx+l4iBVTb+n9Av/0Jpz4j7H9AIKMKdP7kShYktd X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199015)(46966006)(36840700001)(40470700004)(86362001)(478600001)(8676002)(4326008)(26005)(36860700001)(47076005)(6916009)(36756003)(70586007)(70206006)(6666004)(41300700001)(40460700003)(82740400003)(81166007)(8936002)(44832011)(336012)(40480700001)(83380400001)(426003)(5660300002)(82310400005)(186003)(2906002)(356005)(1076003)(16526019)(2616005)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2022 00:52:19.7054 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 728228b8-5b5c-4eb6-afa4-08daab22d9ca X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT104.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5170 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 This will avoid memory access penalties on NUMA systems. Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_ethdev.c | 5 +++-- drivers/net/ionic/ionic_lif.c | 13 ++++++++----- drivers/net/ionic/ionic_rx_filter.c | 3 +-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 43fa5f8bbf..36fb09b810 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -1005,7 +1005,8 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) /* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs = rte_calloc("ionic", adapter->max_mac_addrs, - RTE_ETHER_ADDR_LEN, 0); + RTE_ETHER_ADDR_LEN, + RTE_CACHE_LINE_SIZE); if (eth_dev->data->mac_addrs == NULL) { IONIC_PRINT(ERR, "Failed to allocate %u bytes needed to " "store MAC addresses", @@ -1083,7 +1084,7 @@ eth_ionic_dev_probe(void *bus_dev, struct rte_device *rte_dev, goto err; } - adapter = rte_zmalloc("ionic", sizeof(*adapter), 0); + adapter = rte_zmalloc("ionic", sizeof(*adapter), RTE_CACHE_LINE_SIZE); if (!adapter) { IONIC_PRINT(ERR, "OOM"); err = -ENOMEM; diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c index fbeec8ef2e..cf9605c791 100644 --- a/drivers/net/ionic/ionic_lif.c +++ b/drivers/net/ionic/ionic_lif.c @@ -598,7 +598,8 @@ ionic_qcq_alloc(struct ionic_lif *lif, total_size += rte_mem_page_size(); } - new = rte_zmalloc("ionic", struct_size, 0); + new = rte_zmalloc_socket("ionic", struct_size, + RTE_CACHE_LINE_SIZE, socket_id); if (!new) { IONIC_PRINT(ERR, "Cannot allocate queue structure"); return -ENOMEM; @@ -1037,17 +1038,19 @@ ionic_lif_alloc(struct ionic_lif *lif) return -ENOMEM; } - lif->txqcqs = rte_calloc("ionic", + lif->txqcqs = rte_calloc_socket("ionic", adapter->max_ntxqs_per_lif, - sizeof(*lif->txqcqs), 0); + sizeof(*lif->txqcqs), + RTE_CACHE_LINE_SIZE, socket_id); if (!lif->txqcqs) { IONIC_PRINT(ERR, "Cannot allocate tx queues array"); return -ENOMEM; } - lif->rxqcqs = rte_calloc("ionic", + lif->rxqcqs = rte_calloc_socket("ionic", adapter->max_nrxqs_per_lif, - sizeof(*lif->rxqcqs), 0); + sizeof(*lif->rxqcqs), + RTE_CACHE_LINE_SIZE, socket_id); if (!lif->rxqcqs) { IONIC_PRINT(ERR, "Cannot allocate rx queues array"); return -ENOMEM; diff --git a/drivers/net/ionic/ionic_rx_filter.c b/drivers/net/ionic/ionic_rx_filter.c index fdedb9e288..5f9b569f64 100644 --- a/drivers/net/ionic/ionic_rx_filter.c +++ b/drivers/net/ionic/ionic_rx_filter.c @@ -55,8 +55,7 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id, struct ionic_rx_filter *f; uint32_t key; - f = rte_zmalloc("ionic", sizeof(*f), 0); - + f = rte_zmalloc("ionic", sizeof(*f), RTE_CACHE_LINE_SIZE); if (!f) return -ENOMEM; -- 2.17.1