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 E079B45495; Wed, 19 Jun 2024 12:00:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E71242DCB; Wed, 19 Jun 2024 11:59:22 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2103.outbound.protection.outlook.com [40.107.243.103]) by mails.dpdk.org (Postfix) with ESMTP id 2AB0D42D6A for ; Wed, 19 Jun 2024 11:59:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HZG3Inf/iwuGb0XZvCV+UEUaxqui/0qwFyDFFFjjphI9ATRy1KK+V81BE5se1aHQsOXPKNhi7OKwJvbHC6poXXKJB++SZYnM7phkUvtCetfCMjROs77VSbp8VDS6gIQ7f2Kchk5lGn9VmaP6iCuqtwwIFDqm/lX4U29dPXz2X67xYhr1uFs4sHNv/olmcvagEaYlHMDewTFz5/w11uOMOEKc1tdo2YbF0PiQYLnu2Au7GXgakBjhrsnOhDxJ6v7jvD5mDyzBJvw/Xq4Q9IUFW7rc2BcpjwvZejyag/VjpyaeeFkcG3qSDXMkTyIGxf+zZ9W6Gd+o3fhSroxkAmD8yQ== 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=zvSwmhfbWQOmwJoB5BKfR1epkK20vc6T9mQriBtJFYE=; b=GMTGOsNdzM/xuBNJyrTxuWfmaYNg61+Ig6z7K1Bbhxwz/xZZkypCxJgNGUaxgnTxpOUM2Kv/85aez7dMry0PZK59bSTOFuYVQeExzaGCRVNknvVBYeFcDqlFl8FUX9uLB/6RGGWaDQy2UVy+ItRHZXGdsbrOtscqQ39T5NLJH+nqoTxa80ZxVh5VRut0EwkERGWAAzQpgYerS6WfrT/CSAU82pqRQLxci3ryiWcfOD1FXG/K6Ya/DM+0quy++/Q2ReYVmQm6XeFeQtnHhAHGC4AVBCglr1hnGutmTK937JNa24n103T9ra1dcPCuOQps0PCEjHEF3TiiJOAlDoEycw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zvSwmhfbWQOmwJoB5BKfR1epkK20vc6T9mQriBtJFYE=; b=HKVNWap/XloX3N0rkwwa3ICSbguaHqRjAGvZgXqycGl3lNM0eW1k2eU24V7XP8lk8ShCPdbg5492+Nneq3BwPeEQSHTS/d0tIPB2B/5drt0fUQkLsNKclJRNsb9JeH+0uPyI2jxVub2wCAFzyh5TwdZTKeQJBHPxonwKBsXhaqM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by MN2PR13MB3912.namprd13.prod.outlook.com (2603:10b6:208:263::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Wed, 19 Jun 2024 09:59:16 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7677.030; Wed, 19 Jun 2024 09:59:16 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Peng Zhang , Chaoyong He , Long Wu Subject: [PATCH 14/23] net/nfp: add the helper function to map rtsym with offset Date: Wed, 19 Jun 2024 17:58:21 +0800 Message-Id: <20240619095830.3479757-15-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240619095830.3479757-1-chaoyong.he@corigine.com> References: <20240619095830.3479757-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0057.namprd13.prod.outlook.com (2603:10b6:a03:2c2::32) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MN2PR13MB3912:EE_ X-MS-Office365-Filtering-Correlation-Id: ea79c147-1635-47c7-6b7d-08dc90467ac3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|366013|376011|52116011|1800799021|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?KxzB2aAR7NgyYDioDcg7/+OWopPM87/8R/dZJOsQFDXZXCwx7rVv+sv2Zc+L?= =?us-ascii?Q?4ijGMioiLlLup66efrdAIOIfZ8GEal0i6k8we51gwDOna3jaNBDoFdvyiN8x?= =?us-ascii?Q?Cdj3iMKe0r2/aidgBxUIwDhOI80NMVxe0duGMlYe0FCQNUWDKauOd0K6piM7?= =?us-ascii?Q?MPULB8lFFhQkow/q1blBpgA8rpdhbOoHSt5AHQCCw+ahE9atxMevs+VDR0BM?= =?us-ascii?Q?iCKNxUp+7bWAKcdvSgdi9h/ul7uOWdgsZoGhntEyrY2GV59IQBmCncXI/3S6?= =?us-ascii?Q?RhD7BwuQoYv8mNctBjkLW0OB/AK587QDw4H/klCZrlS/21ch4VzpwaXvGybu?= =?us-ascii?Q?Hi3dBlE04diB0RWnvar+rnPTEHUxfyKpFhASYS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8IPbcnxwB0iCFn+7APOrJ6T2i2fcAKLHxFJuq5h+lg+uY2?= =?us-ascii?Q?36w+dYItsSh7pHajpDDbFhIaGfvw2B9GPI6NKIVnCCYgKy5RKgG9vyO5CFgI?= =?us-ascii?Q?jUkWOU0=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230037)(366013)(376011)(52116011)(1800799021)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?EYCubi2m5VDtmS5XzFr0KottWFPzybSem6n5pUl36ouu387yLnRQIB44p2EH?= =?us-ascii?Q?70ileUlROyZmQohfhCoSBoqLAJYOPUp76Nhk+5Y0NE/7vPy1wB85FvVRuvh5?= =?us-ascii?Q?gty8X1GdiFJSbUUFGyPhrfqrj+JjbqxQ2b+0iHWbX+XRfGqe+t7YgoT+K0rH?= =?us-ascii?Q?hMMxGXp3mfBrBJMcJWGUR9wIlJ9CjpU2tdYy8bk7BTqVqWD35PyPxGwN11os?= =?us-ascii?Q?Fkpj5TPJ5dik+2JkkxNjs04HipilfYmicaN9dTBJYauPCr1Vu2D5gYPeDqWR?= =?us-ascii?Q?XokSoTzASGIaTI6bzDSnT35orYXp6MLUp+5YT7zTSeXcxzPRKqqZe/MuB6g0?= =?us-ascii?Q?uJlFptwGGdPgwousih2OqAwPDHazpK/j4R7Q2/tZGNRZt6/Ate6aZGty86SN?= =?us-ascii?Q?gQhhPHW0edyBZPrBZh9E87gnR7HVhtXH/h4UwBBtBmjinkYcrHTxha63oTmY?= =?us-ascii?Q?btn/mhLmoemtKseUmOxSu8ImRM6LhIT6RXLlShcB/fTnMDtDIgqCc7kH3ThJ?= =?us-ascii?Q?KZzcRnPT5OXWWTTuUQAD9cOWplZvxxa8Xpe7XXh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9t3Sz3dVwX/lLC8W4uqBtJsUFJs1nlRtwDX8riYLjq6Kt/7mWBak?= =?us-ascii?Q?VorkJmD1/v6vrnLhSS37vobCE1/npDpx0jR9A+48ziubzGcNg4dk4bbrTwMf?= =?us-ascii?Q?DPZreg4YUXKzuxGoV+NBnN6QxA/cMb+TsZw51ad8sfiyvZYymgdWAWlpzzP7?= =?us-ascii?Q?/g=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea79c147-1635-47c7-6b7d-08dc90467ac3 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 09:59:16.4086 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rotu6ByoAzm+VVbpi0Opo7tUscGzVguedMnNIVoy6MSHyZfWJgfbM29c6YbXRQdiZQCEDawcLHSo9scc6KXBauErPXTcV2nXbW0Nqbk2cLY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3912 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: Peng Zhang Add the helper function to map rtsym with specified offset. Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Long Wu --- drivers/net/nfp/nfpcore/nfp_rtsym.c | 14 ++++++++++++-- drivers/net/nfp/nfpcore/nfp_rtsym.h | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c index 5cefbace96..2fedd4d9af 100644 --- a/drivers/net/nfp/nfpcore/nfp_rtsym.c +++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c @@ -658,8 +658,9 @@ nfp_rtsym_write_le(struct nfp_rtsym_table *rtbl, } uint8_t * -nfp_rtsym_map(struct nfp_rtsym_table *rtbl, +nfp_rtsym_map_offset(struct nfp_rtsym_table *rtbl, const char *name, + uint32_t offset, uint32_t min_size, struct nfp_cpp_area **area) { @@ -688,7 +689,7 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl, return NULL; } - mem = nfp_cpp_map_area(rtbl->cpp, cpp_id, addr, sym->size, area); + mem = nfp_cpp_map_area(rtbl->cpp, cpp_id, addr + offset, sym->size, area); if (mem == NULL) { PMD_DRV_LOG(ERR, "Failed to map symbol %s", name); return NULL; @@ -696,3 +697,12 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl, return mem; } + +uint8_t * +nfp_rtsym_map(struct nfp_rtsym_table *rtbl, + const char *name, + uint32_t min_size, + struct nfp_cpp_area **area) +{ + return nfp_rtsym_map_offset(rtbl, name, 0, min_size, area); +} diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h index f79637ac50..3e8acdd38e 100644 --- a/drivers/net/nfp/nfpcore/nfp_rtsym.h +++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h @@ -40,5 +40,7 @@ int nfp_rtsym_write_le(struct nfp_rtsym_table *rtbl, const char *name, uint64_t value); uint8_t *nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name, uint32_t min_size, struct nfp_cpp_area **area); +uint8_t *nfp_rtsym_map_offset(struct nfp_rtsym_table *rtbl, const char *name, + uint32_t offset, uint32_t min_size, struct nfp_cpp_area **area); #endif /* __NFP_RTSYM_H__ */ -- 2.39.1