From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0083.outbound.protection.outlook.com [104.47.37.83]) by dpdk.org (Postfix) with ESMTP id 7F63F1B22C for ; Wed, 8 Nov 2017 18:41:44 +0100 (CET) Received: from BLUPR0301CA0020.namprd03.prod.outlook.com (10.162.113.158) by BN6PR03MB2692.namprd03.prod.outlook.com (10.173.144.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Wed, 8 Nov 2017 17:41:42 +0000 Received: from BY2FFO11FD038.protection.gbl (2a01:111:f400:7c0c::114) by BLUPR0301CA0020.outlook.office365.com (2a01:111:e400:5259::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.218.12 via Frontend Transport; Wed, 8 Nov 2017 17:41:42 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.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 BY2FFO11FD038.mail.protection.outlook.com (10.1.14.223) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.178.5 via Frontend Transport; Wed, 8 Nov 2017 17:41:41 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vA8HfcW9031926; Wed, 8 Nov 2017 10:41:39 -0700 From: Hemant Agrawal To: CC: , , Date: Wed, 8 Nov 2017 23:10:52 +0530 Message-ID: <1510162854-10171-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131546365018050193; (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)(7966004)(376002)(39380400002)(39860400002)(346002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(8656006)(97736004)(5820100001)(4326008)(77096006)(104016004)(305945005)(356003)(23676003)(54906003)(316002)(85426001)(50986999)(47776003)(81166006)(8936002)(36756003)(8676002)(86362001)(296002)(2870700001)(50226002)(189998001)(68736007)(2906002)(105606002)(81156014)(50466002)(2351001)(106466001)(33646002)(5660300001)(498600001)(6916009)(6666003)(53936002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2692; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD038; 1:4O94nChfpOxZ+5mxu5yDx+gcldTa7jq9V07lCwrjSP52S5UAPpFMODyyKXPCLXhEsQRWhf7yCG1/OddTIPMo91b9gBU8zwPipDa/Eg+CI3kwiTSAWp8iPJ40OeRwLU4k X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6bbd5a6-3097-4b24-a228-08d526cff8c6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4628075)(201703131517081)(2017052603249); SRVR:BN6PR03MB2692; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 3:VgUYz6O/AtwLfkwmBKDYQkctQKvcQHwb+DYcV3hEx60qDF6bs0asecXdSNCTUZPXnBZ/E1JuIDlOoU/edTTr6a+eSXpd9ryjrZfGbV7DWTjWkUu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fD8PTRPIlKuitlOTU4JOQW8j/V5D36mBJOB40SvAHON1OuLwj0GCiFeOWM9yQ9oYCpab7FSVsvc/+8KygPtAyK25cKBEjUmeBmwvLnes/slXWUIrnT3juU9qSEtNO9pUIbg9Hh1Q3H/O3RtAvoEef23zaVYXa64XT4by9hU9opbk4qqWhdYbqu9E= X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(21532816269658); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(3231021)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(201703131430075)(201703131520075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123556025)(20161123561025)(20161123559100)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB2692; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB2692; X-Forefront-PRVS: 0485417665 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjAzTUIyNjkyOzIzOmdFdEtkT3ZNUlc3YmJjMUkzYmdDVWYvNERN?= =?utf-8?B?MnAyZlJuM2lYVkJSekd1QVl0QzZwQ0JFdjZTNFJkaUxYVjZzU0dYcnRXMVlP?= =?utf-8?B?TmxUOUhXUjFtc0Ywa0Z4dytXZGFpeEk4UnhIalQ5M29VOFdZTG0yZmRZQzJ5?= =?utf-8?B?KzBuWTJ0Nk1oZmIwckJZM1F4TFRNQWhRMnJzYnYvYlZHT0tqWEN6c1BVVkU4?= =?utf-8?B?UTd5ZjJkMHVxaTZRbmQ5WHR4cExVMWMraXA2bEZ1eVFRR2JOVURueWpMYy9n?= =?utf-8?B?d0FZQW9UWnBJb3BO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a2HQ39p4YVUgkO14wHwrV3vYdoYC4OreT3UNp7bQ3NhlOfvm+aGEJMDzuQAEtp0JRX1SbM=; 7:Ab+oTTws7HbuGe9X3clf7QKPsBhnt06xlNn1xI8ULt3AcablPZY8SqZGT7bqQWIK167n4VtOpGYyUncahVjMKzHwf9NDQdMd68F7VFEiQQvpBtzrseMMK6nwj2GBvr0/BlNLFfIZ67GjFr8+7AxTLccBw+kz7dNra7KD7K5TjW31YDt31kvi256qIQmzuLf/mDggxv3vd4JTO/M7QkFQxZ0ldX+B53rmIdhqfJZOxJ8v6GIn/ijqJM+Ri7X0Y//z SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2017 17:41:41.4774 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6bbd5a6-3097-4b24-a228-08d526cff8c6 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: BN6PR03MB2692 Subject: [dpdk-dev] [RFC PATCH 0/2] RAW Device Support 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: Wed, 08 Nov 2017 17:41:45 -0000 Rawdevice Support in DPDK ------------------------- This RFC describes support for rawdevices or generic device support in DPDK. It is supported by following writeup accompanied by skeleton header file with declarations. Motivation ========== In terms of device flavor (type) support, DPDK currently has ethernet (lib_ether), cryptodev (libcryptodev), eventdev (libeventdev) and vdev (virtual device) support. For a new type of device, for example an accelerator, there are not many options except either: 1. create another lib/librte_MySpecialDev, driver/MySpecialDrv and use it through Bus/PMD model. 2. Or, create a vdev and implement necessary custom APIs which are directly exposed from driver layer. However this may still require changes in bus code in DPDK. Either method is unclean (touching lib for specific context) and possibly non-upstreamable (custom APIs). Applications and customers prefers uniform device view and programming model. Scope ===== The rawdevice implementation is targetted towards various accelerator use cases which cannot be generalized within existing device models. Aim is to provided a generalized structure at the cost of portability guarantee. Specific PMDs may also expose any specific config APIs. Applications built over such devices are special use-cases involving IP blocks. The rawdevice may also connect to other standard devices using adapter or other methods e.g. eventdev – single place to get all events. Proposed Solution ================= Defining a very generic super-set of device type and its device operations that can be exposed such that any new/upcoming/experimental device can be layered over it. This RFC names it 'rawdevice' to signify that the device doesn't have any flavor/type associated with it which is advertised (like net, crypto etc). A *rte_rawdevice* is a raw/generic device without any standard configuration or input/output method assumption. Thus, driver for a new accelerator block, which requires operations for start/stop/enqueue/dequeue, can be quickly strapped over this rawdevice layer. Thereafter, any appropriate bus can scan for it (assuming device is discoverable over the Linux interfaces like sysfs) and match it against registered drivers. Similarly, for a new accelerator or a wireless device, which doesn't fit the eth type, a driver can be registered with a bus (on which its device would be scannable) and use this layer for configuring the device. It can also serve as a staging area for new type of devices till they find some commonality and can be standardized. The outline of this proposed library is same as existing ether/crypto devices. +-----------------------------------------------------------+ | Application(s) | +------------------------------.----------------------------+ | | +------------------------------'----------------------------+ | DPDK Framework (APIs) | +--------------|----|-----------------|---------------------+ / \ \ (crypto ops) (eth ops) (rawdev ops) +----+ / \ \ |DrvA| +-----'---+ +----`----+ +---'-----+ +----+ | crypto | | ethdev | | raw | +--/------+ +---/-----+ +----/----+ +----+ /\ __/\ / ..........|DrvB| / \ / \ / ../ \ +----+ +====+ +====+ +====+ +====+ +==/=+ ```Bus Probe |DevA| |DevB| |DevC| |DevD| |DevF| +====+ +====+ +====+ +====+ +====+ | | | | | ``|``````|````````|``````|`````````````````|````````Bus Scan (PCI) | (PCI) (PCI) (PCI) (BusA) * It is assumed above that DrvB is a PCI type driver which registers itself with PCI Bus * Thereafter, when the PCI scan is done, during probe DrvB would match the rawdev DevF ID and take control of device * Applications can then continue using the device through rawdev API interfaces Proposed Interfaces =================== Following broad API categories are exposed by the rawdevice: 1) Device State Operations (start/stop/reset) 2) Communication Channel setup/teardown (queue) 3) Stat Operations (xstats) 4) Enqueue/Dequeue Operations 5) Firmware Operations (Load/unload) Notes: For (1), other than standard start/stop, reset has been added extra. This is for cases where device power cycle has various definitions. Semantics of what stop->start and what reset would mean are still open-ended. For (2), though currently `queue` has been used a semantic, it would be possible in implementation to use this with other methods like internally hosted rte_ring. For (3), Reason for choosing xstats is to allow for the device to define its own stats. Being a generic layer, it doesn't provide any existing fields. For (4), Aim is to allow applications to post buffers (which can be arbit data) to the device. It is device's responsibility to interpret and handle the buffer. It can also be expanded to synchronous and async methods of posting buffer. That would provide broader use-cases. For (5), Aim is to allow for most basic device firmware management. In this, as well as other operations, it is expected that those which are not implemneted would return ENOTSUP allow the application to fail gracefully. Future Work =========== 1. Support for hotplugging and interrupt handling 2. Support for adding dynamic operations (~IOCTLs) 3. Support for callbacks for enqueue and dequeue of buffers 4. Interfacing with Eth/Crypto/Event type devices for inline offloading Hemant Agrawal (2): lib: introduce raw device library config: enable compilation of raw device library config/common_base | 7 + lib/Makefile | 3 + lib/librte_rawdev/Makefile | 53 +++ lib/librte_rawdev/rte_rawdev.c | 626 +++++++++++++++++++++++++++++++ lib/librte_rawdev/rte_rawdev.h | 524 ++++++++++++++++++++++++++ lib/librte_rawdev/rte_rawdev_pmd.h | 540 ++++++++++++++++++++++++++ lib/librte_rawdev/rte_rawdev_version.map | 28 ++ 7 files changed, 1781 insertions(+) create mode 100644 lib/librte_rawdev/Makefile create mode 100644 lib/librte_rawdev/rte_rawdev.c create mode 100644 lib/librte_rawdev/rte_rawdev.h create mode 100644 lib/librte_rawdev/rte_rawdev_pmd.h create mode 100644 lib/librte_rawdev/rte_rawdev_version.map -- 2.7.4