From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0045.outbound.protection.outlook.com [104.47.38.45]) by dpdk.org (Postfix) with ESMTP id A0A9C7CFF for ; Fri, 25 Aug 2017 12:10:28 +0200 (CEST) Received: from CY4PR03CA0080.namprd03.prod.outlook.com (10.171.242.149) by BN3PR03MB2258.namprd03.prod.outlook.com (10.166.74.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:10:27 +0000 Received: from BY2FFO11FD020.protection.gbl (2a01:111:f400:7c0c::181) by CY4PR03CA0080.outlook.office365.com (2603:10b6:910:4d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:10:27 +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 BY2FFO11FD020.mail.protection.outlook.com (10.1.14.137) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:10:26 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7PAAHC0025398; Fri, 25 Aug 2017 03:10:24 -0700 From: Shreyansh Jain To: CC: , , , Shreyansh Jain Date: Fri, 25 Aug 2017 15:49:50 +0530 Message-ID: <20170825101954.28124-3-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170825101954.28124-1-shreyansh.jain@nxp.com> References: <20170818125127.22346-1-shreyansh.jain@nxp.com> <20170825101954.28124-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481294269267987; (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)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(105606002)(50986999)(53936002)(106466001)(2906002)(76176999)(6666003)(54906002)(77096006)(1076002)(8676002)(6916009)(305945005)(85426001)(81156014)(5660300001)(36756003)(2950100002)(5003940100001)(81166006)(33646002)(47776003)(68736007)(110136004)(356003)(104016004)(2351001)(50466002)(48376002)(8936002)(8656003)(189998001)(626005)(4326008)(498600001)(50226002)(86362001)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2258; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD020; 1:3Sb39AGtjJ87cNq0lbrLNTUuS4+5MxBEHvvNy7mug4q2WTzk4OoTQe0wdc8zXxdhc44o2Z+c18G++yBWYtPabOWlQOTpdubT9sy54zkvcQVFf2XG1zdsh6xGDtECgnBt MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: faf7f65e-9aeb-4d12-350b-08d4eba181eb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN3PR03MB2258; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2258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XRBzYQimwPkJ5fLbkdbxST98+F/PzUFzl2pHnnpRaQqH0BCC/6Dr6GXRMfZDKTaPDXinaSosTmYoUkQnlr0ZJv9p9TyNsj/+DATiBbReHUNfc+lDgF9Nq8G5S54Tgi4O49iAA2GtwhnDcK0F8bNc99EgKsB/6522ee2oZcKgW4yKqXTgcFXkGKHJ7rbGYf+5WuUBM7GtEjG2s5x0YDQpF2+ATaT1LnWcZ9ie0GC+RafGhMdk= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(13018025)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123561025)(20161123563025)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR03MB2258; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR03MB2258; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2258; 23:eBmyqmYP5WTlzVE5a5x7iQpX1d9+qKIjqit7K8jj8?= =?us-ascii?Q?vl3jEsqmS5qhHp51dzDbxiqD6KCHpm0c3Yph/mpEN68/imEBzvnaOVycdUDf?= =?us-ascii?Q?91AW2S411BQZP0GDEKZwlp84AOf4+BA05fAeQo1zNMDWl84Wk7ycB/Lty50m?= =?us-ascii?Q?vuJYmKXbpkArJkWfCuqMHhOxgmfcjDBR12RCvLGGUHfh1gAoZT/6zf3nCKKR?= =?us-ascii?Q?yFV9RIt6ZI5uMHmBk2r+SIJtNr1DDhOIDgr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ascii?Q?eqFU5q3ulxJOO7waIlMLTSgL+wnC67q?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2258; 6:mIO99kMUkKyLG8rQfwKQFuLcdxcvaYkIr7pM8UGQ94JkXlNiQZjb7bnN76HpslDR5mSHIAZ993DVxciESPx+jW2cMeNdakz7zaii2JVbSB4Fw136J4S1CJn9Jo+3GrHUCgrufFLEK2iHsUDhacDaWjewCAtXQMrlStk2NI7dYYoKeVmel/9/rOSF3ShN9Q+nCBl9um+4G955SlPfvmeekgymeK0YHnmfFTWbDrH3wZsF9Rplkg6VaVanjdNO1MrmygcmogMXgcIl8//CS2V551Wg+0xwPCuFJJ3oxonQFR4+77TgQpqcNpi328M+GmrPKd3TUWJlVEB5NzgMO8mhMQ==; 5:AQK8Z24Rt3+pE7gU6J5EV8EU6iOx609Hsg2411bO25ZASLC+r7xb5Psb7Vg4aQ1LbAAoq7tEfqE2mNRgXhDRPztzofaX6tdnUPKVxC96O3gfQ/MSkHqOuUghjKR5yu8lwr0uFQdyJlB35i0n206otA==; 24:hAw2yVVD5DMQc15+MD+ka5sRSqqV+K0BtpxNaIjhhQzcDkb4MD8QeY3lWzksyHhmetbVxbf7bZOMyKYzZzpOwAsc8dJOXz6cKfIvqT4GraU=; 7:ob9a7b8X2QoEHSc2nI7le41mSn+UKr/cYNxzcA25i6xeOuwa8zVGARZSrwrnop7XGbVeJ5Z9u1r4HY1vtyX45eMCGFm78n4/Kiet/hxdDguY17DwEhCQwBj25STh1Ulb5induBC0k56SQstnWfUSbnMh5dSdybx9cfqGIjDuOgHuUSvrQHi+puUtJGTcgNalrpP6X9jWe6JcyG4OdvuKQGKy8KwhavOdx/FcFplScPc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:10:26.6147 (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: BN3PR03MB2258 Subject: [dpdk-dev] [PATCH v2 2/6] bus/fslmc: introduce new device type enumerator 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: Fri, 25 Aug 2017 10:10:29 -0000 Existing devices and drivers depended on device ID rather than type. A new enumerator for all DPAA2 devices is introduced in this patch. At this point, the probe would not be able to link DPAA2 devices with the driver and I/O would not work. Subsequent patches will fix this. Signed-off-by: Shreyansh Jain --- drivers/bus/fslmc/fslmc_vfio.c | 6 +++--- drivers/bus/fslmc/rte_bus_fslmc_version.map | 7 +++++++ drivers/bus/fslmc/rte_fslmc.h | 24 ++++++++++++++++++++---- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 3423b57..3b452e1 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -288,8 +288,8 @@ dpaa2_compare_dpaa2_dev(const struct rte_dpaa2_device *dev, const struct rte_dpaa2_device *dev2) { /*not the same family device */ - if (dev->dev_type != DPAA2_MC_DPNI_DEVID || - dev->dev_type != DPAA2_MC_DPSECI_DEVID) + if (dev->dev_type != DPAA2_ETH || + dev->dev_type != DPAA2_CRYPTO) return -1; if (dev->object_id == dev2->object_id) @@ -506,7 +506,7 @@ int fslmc_vfio_process_group(void) /* store hw_id of dpni/dpseci device */ dev->object_id = object_id; dev->dev_type = (strcmp(object_type, "dpseci")) ? - DPAA2_MC_DPNI_DEVID : DPAA2_MC_DPSECI_DEVID; + DPAA2_ETH : DPAA2_CRYPTO; sprintf(dev->name, "%s.%d", object_type, object_id); dev->device.name = dev->name; diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 3cdf14e..6ac256d 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -77,3 +77,10 @@ DPDK_17.08 { rte_global_active_dqs_list; } DPDK_17.05; + +DPDK_17.11 { + global: + + rte_dpaa2_dev_type; + +} DPDK_17.08; diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h index e60d6eb..ff7a49e 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -56,6 +56,8 @@ extern "C" { #include #include +#define FSLMC_OBJECT_MAX_LEN 32 /**< Length of each device on bus */ + struct rte_dpaa2_driver; /* DPAA2 Device and Driver lists for FSLMC bus */ @@ -64,6 +66,20 @@ TAILQ_HEAD(rte_fslmc_driver_list, rte_dpaa2_driver); extern struct rte_fslmc_bus rte_fslmc_bus; +enum rte_dpaa2_dev_type { + /* Devices backed by DPDK driver */ + DPAA2_ETH, /**< DPNI type device*/ + DPAA2_CRYPTO, /**< DPSECI type device */ + DPAA2_CON, /**< DPCONC type device */ + /* Devices not backed by a DPDK driver: DPIO, DPBP, DPCI, DPMCP */ + DPAA2_BPOOL, /**< DPBP type device */ + DPAA2_IO, /**< DPIO type device */ + DPAA2_CI, /**< DPCI type device */ + DPAA2_MPORTAL, /**< DPMCP type device */ + /* Unknown device placeholder */ + DPAA2_UNKNOWN +}; + /** * A structure describing a DPAA2 device. */ @@ -74,11 +90,11 @@ struct rte_dpaa2_device { struct rte_eth_dev *eth_dev; /**< ethernet device */ struct rte_cryptodev *cryptodev; /**< Crypto Device */ }; - uint16_t dev_type; /**< Device Type */ - uint16_t object_id; /**< DPAA2 Object ID */ + enum rte_dpaa2_dev_type dev_type; /**< Device Type */ + uint16_t object_id; /**< DPAA2 Object ID */ struct rte_intr_handle intr_handle; /**< Interrupt handle */ struct rte_dpaa2_driver *driver; /**< Associated driver */ - char name[32]; /**< DPAA2 Object name*/ + char name[FSLMC_OBJECT_MAX_LEN]; /**< DPAA2 Object name*/ }; typedef int (*rte_dpaa2_probe_t)(struct rte_dpaa2_driver *dpaa2_drv, @@ -93,7 +109,7 @@ struct rte_dpaa2_driver { struct rte_driver driver; /**< Inherit core driver. */ struct rte_fslmc_bus *fslmc_bus; /**< FSLMC bus reference */ uint32_t drv_flags; /**< Flags for controlling device.*/ - uint16_t drv_type; /**< Driver Type */ + enum rte_dpaa2_dev_type drv_type; /**< Driver Type */ rte_dpaa2_probe_t probe; rte_dpaa2_remove_t remove; }; -- 2.9.3