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 2F32CA0352; Tue, 1 Mar 2022 11:58:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55E29426E9; Tue, 1 Mar 2022 11:58:23 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2065.outbound.protection.outlook.com [40.107.243.65]) by mails.dpdk.org (Postfix) with ESMTP id 6C42A407FF for ; Tue, 1 Mar 2022 11:58:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XSae3wbTzHX/rImo6zUZKiwhVRG28wRX9EgON/DRNlTVYaOCQgn2gxA6JTBy/afXXLkAqdULIbSf/G6p7JkQHzNwmjmcQspvSPQVVIcEh2IPZHRvrRhs7kbNyYF24cwMYWO0TQsSRwOD2Stluge38i6ldnlRSLOE9fyxqANjdBTj+U8+ddQxLl0RtC9bVPdTZm6CDL1IIot4n9h3OFFkmrEniN6YDJylZsm1XRf1NroqpmcnQ1P6MVQvaEmm0ZxxTK0FvzWtMK6AN/NkQzlLu4UtqZbb9WPVe1XOqwmxHKwXKbCA9tzmA7u1k1/0gJ3NJRk1BKD9jM458/8hnJ/Fug== 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=J9zb+19SgVB+QQ5ybsy3Ys4foqE3c89bMXH8o5DrXow=; b=nRxG1cviN76Q33wMH6Pa2Mo7u6PlcqcN1BsLvA+RbH5HweCeFHCXFW9BPD/vsLMxMsFaEWSHW71BZXi/kW5Zddu7nIZ/pZbUVBOVqCIZPKXBzRu8rdRLXsfokVVJUucCxQpylklQfJPsxZQB7WiETAN14Bqidt382Z1qqvlaCKM3HhBINkEN1lSMLhNLe9MFfhnQU875GS/k7h/TWcc+0IhBkrS+kIFvQc0ePuU7PLh70tD/bc+pROv7fnmIyvA96dXDvAtwxgl0Ci+48ZgRgDu/72fuot7XFnGM9ZvE5Av+Zkbu+TK6fTGoYCLhqyjw6kLfAxq7vKGaKA/KMKDNKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J9zb+19SgVB+QQ5ybsy3Ys4foqE3c89bMXH8o5DrXow=; b=V/UEXYGFBX8oPj609KhjMXpMsqXNvLgTAJ/fpGIh9E4rexyzqvzpkM5oUKOJFgHKeadtWa/Ekicmp0KZOwj09FQGYcf7o5ewDjjBleAuqWLzdhQO1TBDe13JxW/MNRyJ3+H7O5bBu8fUkj20wz4nXjJTAICskRy96UMXM8OzQjJF2jXo+PhgOEKdQdpIMDctETh5tXklUSpa0pgkkBr1S0QRNsAiLJwY29IzrgMjA0xqqFbuLJbZnvG9I7Y7gkny9fVx4p4iaO5KU0kR2n12uxmgNC5PxvTfw+q1mYsth6ePXlP3c7FV6z8CxRFdge0pnkxc/NI/s/YyIBoU6eOd7Q== Received: from BN6PR19CA0061.namprd19.prod.outlook.com (2603:10b6:404:e3::23) by MN2PR12MB4581.namprd12.prod.outlook.com (2603:10b6:208:260::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Tue, 1 Mar 2022 10:58:18 +0000 Received: from BN8NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:404:e3:cafe::4e) by BN6PR19CA0061.outlook.office365.com (2603:10b6:404:e3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14 via Frontend Transport; Tue, 1 Mar 2022 10:58:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT056.mail.protection.outlook.com (10.13.177.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.22 via Frontend Transport; Tue, 1 Mar 2022 10:58:18 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 1 Mar 2022 10:58:17 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Tue, 1 Mar 2022 02:58:16 -0800 From: To: CC: Elena Agostini Subject: [PATCH v1 1/2] gpudev: add GPU page_size to info Date: Tue, 1 Mar 2022 19:05:54 +0000 Message-ID: <20220301190555.20012-1-eagostini@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7e052ef4-76cf-49df-a946-08d9fb7264d9 X-MS-TrafficTypeDiagnostic: MN2PR12MB4581:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OqXdVC3JfydhXzyi1bttV/QG1W/5Thpx2B1Z8R7QPIGegcs+F548/5eX41lcy1cWsPkAdFp8dZMGIG0EUggjWs+jOOf6hFsQ+HDLGsmJXCV9dad/RXmRlXWXl1phHIi9VEzPRTRjLQmW0uv/QPai44nHCHbmE7yQYdoiRzC8eIsJaDQw/9WOqaJk9RjcfNwZUaSwhkXlnzrtM5A599LOag44A1XJJE7qQjeD7ch7yMCCD5tLcgmXEfBOJWJDTK+hC1bLD7zBlGJD0SPvAOIv21nBAUoPEWlEbWw/sDkeA+BPtPBjHsG1Ssw/6OEmDn0eVq2SLQjgh8mFvvmE/wTHAf9Luw+Z05/LzvNt569jr9Mer8A5NWDOE8qeWIqU2gmSVTQMVZgCoWQ+pZ+TMyEBCJaUVBs/4THeXVWXE3HQ5pcGwvRhYDst8MQ7BXVCCl7V7mFgeHxVy1KsfnEX84qoDU6s3WlUeZ/rzYnsv9bpieANm8JhoZmI3rJgN1/JNapz1VdUk8lYYyZtYRYGYSMKmo9HV0CIRkeSX7KkRwzAT/Dp+Z6FdUnUBrzS0bxY0GplxE66tSHPJyTR7/uAOr3IKz5gQ7f9g078b6dpCtpBmqal7mkSEzAGD2/xKB0uI/oi0n1Q6IeldaULQ9FunimkqT7N+XGdvcisn3NhA6C0NfnXcr9AxUlef/4dUvfr445DGoEtZ+HnlULzF25KQFoKPw== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(70586007)(55016003)(356005)(81166007)(316002)(7696005)(6916009)(36860700001)(47076005)(36756003)(6666004)(83380400001)(508600001)(40460700003)(70206006)(2616005)(107886003)(8936002)(2906002)(2876002)(4326008)(26005)(6286002)(186003)(16526019)(82310400004)(86362001)(1076003)(8676002)(5660300002)(336012)(426003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2022 10:58:18.4590 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e052ef4-76cf-49df-a946-08d9fb7264d9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4581 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: Elena Agostini Page alignment on the GPU can be different from the CPU page alignment. Signed-off-by: Elena Agostini --- drivers/gpu/cuda/cuda.c | 4 ++++ lib/gpudev/rte_gpudev.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/cuda/cuda.c b/drivers/gpu/cuda/cuda.c index efb5d146f6..2f8c4684ce 100644 --- a/drivers/gpu/cuda/cuda.c +++ b/drivers/gpu/cuda/cuda.c @@ -523,6 +523,8 @@ cuda_dev_info_get(struct rte_gpu *dev, struct rte_gpu_info *info) } dev->mpshared->info.total_memory = parent_info.total_memory; + dev->mpshared->info.page_size = parent_info.page_size; + /* * GPU Device private info */ @@ -1173,6 +1175,8 @@ cuda_gpu_probe(__rte_unused struct rte_pci_driver *pci_drv, struct rte_pci_devic return -rte_errno; } + dev->mpshared->info.page_size = (size_t)GPU_PAGE_SIZE; + /* * GPU Device private info */ diff --git a/lib/gpudev/rte_gpudev.h b/lib/gpudev/rte_gpudev.h index 7e2401a4b7..971aeacfff 100644 --- a/lib/gpudev/rte_gpudev.h +++ b/lib/gpudev/rte_gpudev.h @@ -61,6 +61,8 @@ struct rte_gpu_info { size_t total_memory; /* Local NUMA memory ID. -1 if unknown. */ int16_t numa_node; + /* Get GPU memory page size. */ + size_t page_size; }; /** Flags passed in notification callback. */ -- 2.17.1