From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0078.outbound.protection.outlook.com [104.47.34.78]) by dpdk.org (Postfix) with ESMTP id 004D199B9 for ; Thu, 25 May 2017 20:08:30 +0200 (CEST) Received: from MWHPR03CA0016.namprd03.prod.outlook.com (10.175.133.154) by BY1PR0301MB0904.namprd03.prod.outlook.com (10.160.195.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Thu, 25 May 2017 18:08:29 +0000 Received: from BL2FFO11FD047.protection.gbl (2a01:111:f400:7c09::162) by MWHPR03CA0016.outlook.office365.com (2603:10b6:300:117::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Thu, 25 May 2017 18:08:29 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD047.mail.protection.outlook.com (10.173.161.209) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1075.5 via Frontend Transport; Thu, 25 May 2017 18:08:29 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v4PI84WD022340; Thu, 25 May 2017 11:08:26 -0700 From: Nipun Gupta To: CC: , , , , , , Nipun Gupta Date: Thu, 25 May 2017 23:37:33 +0530 Message-ID: <1495735671-4917-3-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495735671-4917-1-git-send-email-nipun.gupta@nxp.com> References: <1495735671-4917-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131402093096284493; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39400400002)(39860400002)(39380400002)(39410400002)(39840400002)(39850400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(356003)(110136004)(38730400002)(498600001)(6666003)(189998001)(2906002)(50466002)(48376002)(305945005)(5660300001)(53936002)(36756003)(54906002)(2950100002)(76176999)(8656002)(50986999)(6916009)(5003940100001)(4326008)(85426001)(575784001)(50226002)(77096006)(8676002)(81166006)(104016004)(86362001)(8936002)(105606002)(106466001)(2351001)(33646002)(47776003)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0301MB0904; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD047; 1:fzGb6W7ZWTBXPrBG6OoDyJnn8k01OUM2ZWiUs/E/N6E8CXNv+PW0sBtcjdjX3WL+h19brydHuPHDt3/dALOKRRQq7bi1NBfqCZ/N5fA3tukCSb6GdoudEMd56yR41muYRwc2gpfLCptvsNQ6HuNccWZdSDhQRMo9v6hWy9oFjhleDKMR9QHRCumGROxma5e5Z+xjEhiBpwSJUF3XMN99VylDQD71rFICVZbZnCJ8P7pCmkNTk0HD2EB5eSdF/lNkERKfEGNtfGZujo1sJNUAjc4ROgS4O6RDXUldaar00qSzSJWJGkju2UbG/5UW1/EPi1MGsZCp+xR1pJRf5m9azSO6+BL9li8cxi8SnBqbKWaVGgAcE55PYGtZNBdBJzqKoBjhaiEYPGalKc8maf0lwoGLfObbCDOKodnO/bDCveyhMjEpEZFm2AxQB1OhLyhVSRQbaAiDrNaB688KszS+BLAS2J71awL0ZicvKoy1KfXxZJ5kwADX7p4yMYK+9t8eu7LIUtXnvxrszCyD/taj6+0Z0Gj46KMT9NV2wYovsibMUYWrpCyyng+w6OiEDAE8Vx554tI7Cyxn6OcR5nHFAqNQxJctVZkQpaAH+QcSSApAzmEHTHkQ2gTvM9Y1I4s1I7C5sGHxHBqyhvHekSudlf8nGzBVcd4eJgI53O7MTbUz7KQ7Se/WvEpz12nvWiJr45P1UZmr8UWZSnDPX4mKkg== MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PR0301MB0904: X-MS-Office365-Filtering-Correlation-Id: 31fae1a2-0db2-4188-cff1-08d4a3990c33 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BY1PR0301MB0904; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0904; 3:6w3UfhY22ar9ycx6HW1KziJLjVapbl4iz77fyP3ycYxfEBpJddWpxqGsjCJKCa/hb1Opy1x8TW0AYbiRbR3Esg0A86sD4IJpp21xVIyNgVGttmAm6AyCzwEZIAwZK+65mrsK1jRvhW/oWoMfx+xXy+IQ4c07A4bUzS005eyIqUuQkupPGTtFog3zvUJQJTytn993xjoHjcJcDnPcoYFtpjZkNw6w2VJbIKH5LaLS/MUMaS1Y1FMRpKSniMLKnWzGxhF7/2MHt9+kZgKFGPBtJNJBWqpuPvkdI6nFf/MMfuNf838xjy4emtksa8LdydMsr13zY/oqsnp7PIPdmdBob0PKKPN9cEQ+rZ/dUbx5wxhu5Ilesl6e54rsva3saS241+nrZxREC3QkzGKTZRJX82ShVd7IDzrWuNOlO4upOjgOZ86KQlKuGFPRYxBPKI9Q; 25:EZetOY23DYmvjN3FJYeJuuxYS3jiratYdvU6iReE0WyzqZ0a/6gvWtBi7HKnOe/i27H0mckmSjdB4TtRNudM/KXDRGppRHDu3XKb/toWl+DsO34CUiBb/R+/AusqXLr+H2HnB6F4A1Rp+8jlpEcWyZOm0RKV6SRHlSy7zPhgvi+xFkXbIIWR3JaSAa/uUH0EHYTlIOw0YU01SRbR4Dp/WLQoz5kcO2hgBFOVpbsleE0Xxf3UcJgv84nguv8EOb9t0ys8LuCZfFBeDk2ReHyYuXmDU5Ld6RS4vzlsfrIqjFoA377FpiBmqlqScvvmmfTSl+vy90hCZQnu76R+QlTGRH+N6PUOIrFte7edKlLxPwAgGtHUVbEHH7YyspmXQ4ULMq4CAGuTiO6uWcgKDlYKdBR8U0E+1qA2q8uYdHAr3KI2DWAeaeBsCfHXfWNRSJJd5Om3s7YAaog/lszVGz0YK8en4jyJYsluLY7+66fDaWM= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0904; 31:oDHSh0dkROMrtbUSk2cLDm1+jcGNIa07E+VFS/GTTgMTxsbjWOB/XHZcxzZ1TeKnHTQLyaw4ADWW987vRBLoDb7O3v2cn7/7jlH0FLJMunDcEqhBenwPKyUb39GujT+5GcDRMGIMrNOhDK9/5WOeIj0fxBKQ73SqDXYqFFPEkE1RR4D+NwIuZIpWaVUYOwgHPgL5YjoCvU2pKclXHitR+UCmNlsUhiwRBYcY4geDMHTbr3pLGO59MEjJzHpG6362Zo2smnhSa6yjEyDXkJWeuQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13016025)(5005006)(8121501046)(13018025)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123561025)(20161123556025)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123559100); SRVR:BY1PR0301MB0904; BCL:0; PCL:0; RULEID:(400006); SRVR:BY1PR0301MB0904; X-Microsoft-Exchange-Diagnostics: 1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:IqsRDtM6jtWDmca1s/jABHGJDuPqu8kOgUEW2jXRxjDZbFM4Zpd1bh56dL1CZY/UStejVx3BIOrDP40T1XMkZa+BLDF5CisAzF5FZRBVdkAW71iN6naNpTzgIbYMzlhpRoW7f0RLjr+dKRDF2HcaW8ZK8XT7NPsW5F6EBgkshbVBrEgsGFZcUCoKi7R/Vt+G; 24:ROFBPF3xoDZ1hAtrromD2VnoFIUy27k1N2Ap7zuPDMzux6zaSoz8dJ5nA6HLu7s2r4ltOZMDiHPzaPPOyOjyN7XbPYffYnIcR2GVsI2Ar5Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0904; 7:veAb98eZdXutKjgzRothYsOVk54U+gMudYol0hmNOTZHQDzJ80ohHJ8JKk6DjGQBhlN8dPEshq/Z7WBnwQCGI6cQ4s9kjxItc38KzMU93UBrW+73bKnz+nW0fsKwZG+GeT7CtpSvQ2nnYDvizLWn2gw6RsKibfV6HL9F6C3qmGfF6ayExEXBxZ1YMYc7qVu0qedolPpFFMipPt6ESmLHsbiOEuvWC7MPik+5aVirWsTya5iJjd5d/m0Xq8oIOY+WBjDnVZtA/aimZGCSTQWQ+azMCvT+B60QOg75rvjuvSXh8OBq/anbTfRpeytM3AjOOmgRgRVmOdNrWjeOiqKqfw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2017 18:08:29.4412 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB0904 Subject: [dpdk-dev] [PATCH 02/20] bus/fslmc: generic framework for mc object creation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 May 2017 18:08:31 -0000 From: Hemant Agrawal There are muliple help mc object, which are not an independent device, but they are required for dpaa2 based devices. This framework allows registration and handling of all such mc devices. Signed-off-by: Hemant Agrawal Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/fslmc_vfio.c | 11 +++++++++ drivers/bus/fslmc/fslmc_vfio.h | 37 +++++++++++++++++++++++++++++ drivers/bus/fslmc/rte_bus_fslmc_version.map | 6 +++++ 3 files changed, 54 insertions(+) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 5d4ac67..b9ea358 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -80,6 +80,17 @@ void *(*rte_mcp_ptr_list); static uint32_t mcp_id; static int is_dma_done; +static struct rte_fslmc_object_list fslmc_obj_list = + TAILQ_HEAD_INITIALIZER(fslmc_obj_list); + +/*register a fslmc bus based dpaa2 driver */ +void +rte_fslmc_object_register(struct rte_dpaa2_object *object) +{ + RTE_VERIFY(object); + + TAILQ_INSERT_TAIL(&fslmc_obj_list, object, next); +} static int vfio_connect_container(struct fslmc_vfio_group *vfio_group) { diff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h index 53dd0b7..58b3acd 100644 --- a/drivers/bus/fslmc/fslmc_vfio.h +++ b/drivers/bus/fslmc/fslmc_vfio.h @@ -63,6 +63,24 @@ struct fslmc_vfio_group *group_list[VFIO_MAX_GRP]; } fslmc_vfio_container; +struct rte_dpaa2_object; + +TAILQ_HEAD(rte_fslmc_object_list, rte_dpaa2_object); + +typedef int (*rte_fslmc_obj_create_t)(struct fslmc_vfio_device *vdev, + struct vfio_device_info *obj_info, + int object_id); + +/** + * A structure describing a DPAA2 driver. + */ +struct rte_dpaa2_object { + TAILQ_ENTRY(rte_dpaa2_object) next; /**< Next in list. */ + const char *name; /**< Name of Object. */ + uint16_t object_id; /**< DPAA2 Object ID */ + rte_fslmc_obj_create_t create; +}; + int vfio_dmamap_mem_region( uint64_t vaddr, uint64_t iova, @@ -79,4 +97,23 @@ int dpaa2_create_dpio_device(struct fslmc_vfio_device *vdev, int dpaa2_create_dpbp_device(int dpbp_id); +/** + * Register a DPAA2 MC Object driver. + * + * @param mc_object + * A pointer to a rte_dpaa_object structure describing the mc object + * to be registered. + */ +void rte_fslmc_object_register(struct rte_dpaa2_object *object); + +/** Helper for DPAA2 object registration */ +#define RTE_PMD_REGISTER_DPAA2_OBJECT(nm, dpaa2_obj) \ +RTE_INIT(dpaa2objinitfn_ ##nm); \ +static void dpaa2objinitfn_ ##nm(void) \ +{\ + (dpaa2_obj).name = RTE_STR(nm);\ + rte_fslmc_object_register(&dpaa2_obj); \ +} \ +RTE_PMD_EXPORT_NAME(nm, __COUNTER__) + #endif /* _FSLMC_VFIO_H_ */ diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 2db0fce..4c03e67 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -49,3 +49,9 @@ DPDK_17.05 { local: *; }; + +DPDK_17.08 { + global: + + rte_fslmc_object_register; +} DPDK_17.05; -- 1.9.1