From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0065.outbound.protection.outlook.com [104.47.33.65]) by dpdk.org (Postfix) with ESMTP id A0580199AC for ; Tue, 23 Jan 2018 15:24:54 +0100 (CET) Received: from BLUPR0301CA0025.namprd03.prod.outlook.com (10.162.113.163) by CY1PR03MB1424.namprd03.prod.outlook.com (10.163.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Tue, 23 Jan 2018 14:24:53 +0000 Received: from BY2FFO11FD028.protection.gbl (2a01:111:f400:7c0c::165) by BLUPR0301CA0025.outlook.office365.com (2a01:111:e400:5259::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.444.14 via Frontend Transport; Tue, 23 Jan 2018 14:24:52 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BY2FFO11FD028.mail.protection.outlook.com (10.1.15.217) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.428.12 via Frontend Transport; Tue, 23 Jan 2018 14:24:49 +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 w0NDj5Rh022838; Tue, 23 Jan 2018 06:45:27 -0700 From: Shreyansh Jain To: , CC: , , , Shreyansh Jain Date: Tue, 23 Jan 2018 19:29:06 +0530 Message-ID: <20180123135910.10755-7-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180123135910.10755-1-shreyansh.jain@nxp.com> References: <20180102125749.2379-1-shreyansh.jain@nxp.com> <20180123135910.10755-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131611910918491290; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(26005)(86362001)(77096007)(50466002)(48376002)(54906003)(4326008)(16586007)(336011)(110136005)(97736004)(85426001)(59450400001)(51416003)(316002)(76176011)(2950100002)(6666003)(47776003)(5660300001)(50226002)(68736007)(106466001)(305945005)(2906002)(1076002)(36756003)(105606002)(498600001)(81156014)(356003)(81166006)(8676002)(53936002)(8936002)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB1424; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD028; 1:9LoBmwwFUhSHPNwNiBAoBcDqtUZ6NSpu8SnkV+p/HVpJb7GnTiiaaMi3tLDZ0N/bVfaO8fBVoxMhwHEbpDUIb3s0CIkLAVtRyxYvGOQs/1iNNE4N8PIgxUnrmyQa+wfo MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc5c1203-793d-4fca-6031-08d5626d10e3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB1424; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB1424; 3:A5VY0cqbR9Jqn4mfW9aMNJahshgVdvQEU0ds+ZAhMBCUnj+Qldd8D0fzgfPWKSbmXgU28Omot2qmICE99prYmICodWyDPBEc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BmvzGi+3K+TmjuSFW/JnpzlqzK1Deb0neSvgJ6kKlRX8VUibkngP1/cUrUfnfnoQH8+kMuBHZADuDfKlkaUR3S6lpFszPSt6dLqSw3DFO4+KZMLGbpAcPghrtYSJyoWNVxcBfixj20MKx3tDPVBm/HE29tglzEbK2M0tzVwB/c X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3231023)(2400081)(944501161)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703151042153)(20161123563025)(20161123565025)(20161123559100)(20161123556025)(20161123561025)(201708071742011); SRVR:CY1PR03MB1424; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB1424; X-Forefront-PRVS: 05610E64EE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB1424; 23:qBvH5df/746Q6hwPBIEHAxFk5kjwLZbfzaW7XrsqN?= =?us-ascii?Q?srnrXqEsV83NzpITi6jbefO+Q53QbrSrrhTotYaouZWTdAica8/Lt+Js5vU6?= =?us-ascii?Q?2jOZgnO60S9aZ/NboBtiqIrpzipQXffTGv/J1CiHBbtyHlmQRL8shZh6p3QD?= =?us-ascii?Q?0MQujY6lvN5tcSb9gcnMbtD7BtpOLC9Nmpk6HmUBXHXvkX+3kXUFJYcwB+Ar?= =?us-ascii?Q?LAsa3wo2gkwxR1mVqUN1+ghKJDD5QQNNMjSOm+PekuzkY4Ntuiodh62Wv6N+?= =?us-ascii?Q?hQqYdgpSZ27ChAfZ24SGYNmDW84OZcjAqBCJr8mPbW4xf3xFGypbVQZyQHji?= =?us-ascii?Q?AQrIXs/PPBxNBgvt7oAkfusbDTIkwrijX++Gk2hSLpuExMdZndL1UWAklE4/?= =?us-ascii?Q?wJoTbKPA++3NKA2Fofh8Q1mv8TWJ27mRW6juJK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/ZDfDPniM7qMQESWhBV/0yX7wdsl5asDOszi1SJnH6LwamMIw/o09kYkgI0moU92tXTd6KB35m5QfWznuEC8O1J3PDPoOnY9/W1XvPoaZSYIwYML1mF1QcQeb1K0hqXFJ5L3Z4sV02aWqEVZHcjh1kyHw=; 5:vQ6Hb5vF5w4RTS6dIEiD7biMTA0VRBiSn+LxDxZ7n786YTRvvBwmCzYHXLX1IB65EXdV+JIGQD4o8PEyxArsifZhrd8qBJv56mYkRpdfRx63286mWGRqZ5bATUBhLvdli3RiqwD+q5XFcAvdhNOzcRCUuL0pjTQiKBUcs68TYPA=; 24:E4dhP4cflpXssHK6T4c2fgJDPCc5KeXxffWbriMEdX48DlNr2kwDnmk3xQAI2fkJaDn8W9bJlAxJ6ZZe7bOMFfKeAOtq4p6CJl0EdyWsFh0=; 7:bMkczxZERPah6MMJeuNp/HtpgMrTwtl21p+BbHnLLC93pmQ7hQjnpYc8jCmuIlNYiHet2ChGSmDjlS4PIl79ObsJ+gRAKs9azOViXE7Ysli7AfmZ/0kE7+D1cL8rsi8tYTG+/wfrsJ88IBsmB4+4wkkcvZcFi/ZtNlwKRWNkxDZ9g+coY810mGctRURy3qwavm6C/IAMiKZ+ByW1KchsiQ6eAOuT0U5uy7sNGtD1YVtIvnLLsG6/DgmaTEixl/ST SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2018 14:24:49.8835 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc5c1203-793d-4fca-6031-08d5626d10e3 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: CY1PR03MB1424 Subject: [dpdk-dev] [PATCH v2 06/10] rawdev: add self test 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: Tue, 23 Jan 2018 14:24:55 -0000 Signed-off-by: Shreyansh Jain --- lib/librte_rawdev/rte_rawdev.c | 9 +++++++++ lib/librte_rawdev/rte_rawdev.h | 12 ++++++++++++ lib/librte_rawdev/rte_rawdev_pmd.h | 11 +++++++++++ lib/librte_rawdev/rte_rawdev_version.map | 1 + 4 files changed, 33 insertions(+) diff --git a/lib/librte_rawdev/rte_rawdev.c b/lib/librte_rawdev/rte_rawdev.c index c1001b34b..969244b28 100644 --- a/lib/librte_rawdev/rte_rawdev.c +++ b/lib/librte_rawdev/rte_rawdev.c @@ -363,6 +363,15 @@ rte_rawdev_firmware_unload(uint16_t dev_id) return (*dev->dev_ops->firmware_unload)(dev); } +int rte_rawdev_selftest(uint16_t dev_id) +{ + RTE_RAWDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); + struct rte_rawdev *dev = &rte_rawdevs[dev_id]; + + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_selftest, -ENOTSUP); + return (*dev->dev_ops->dev_selftest)(); +} + int rte_rawdev_start(uint16_t dev_id) { diff --git a/lib/librte_rawdev/rte_rawdev.h b/lib/librte_rawdev/rte_rawdev.h index 388a24cf0..fd3f7d3d2 100644 --- a/lib/librte_rawdev/rte_rawdev.h +++ b/lib/librte_rawdev/rte_rawdev.h @@ -577,6 +577,18 @@ rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image); int rte_rawdev_firmware_unload(uint16_t dev_id); +/** + * Trigger the rawdev self test. + * + * @param dev_id + * The identifier of the device + * @return + * - 0: Selftest successful + * - -ENOTSUP if the device doesn't support selftest + * - other values < 0 on failure. + */ +int rte_rawdev_selftest(uint16_t dev_id); + #ifdef __cplusplus } #endif diff --git a/lib/librte_rawdev/rte_rawdev_pmd.h b/lib/librte_rawdev/rte_rawdev_pmd.h index a8da39343..dd5c26d57 100644 --- a/lib/librte_rawdev/rte_rawdev_pmd.h +++ b/lib/librte_rawdev/rte_rawdev_pmd.h @@ -475,6 +475,14 @@ typedef int (*rawdev_firmware_load_t)(struct rte_rawdev *dev, */ typedef int (*rawdev_firmware_unload_t)(struct rte_rawdev *dev); +/** + * Start rawdev selftest + * + * @return + * Return 0 on success + */ +typedef int (*rawdev_selftest_t)(void); + /** Rawdevice operations function pointer table */ struct rte_rawdev_ops { /**< Get device info. */ @@ -528,6 +536,9 @@ struct rte_rawdev_ops { rawdev_firmware_load_t firmware_load; /**< Unload firmware */ rawdev_firmware_unload_t firmware_unload; + + /**< Device selftest function */ + rawdev_selftest_t dev_selftest; }; /** diff --git a/lib/librte_rawdev/rte_rawdev_version.map b/lib/librte_rawdev/rte_rawdev_version.map index 8de9abdc4..af4465e26 100644 --- a/lib/librte_rawdev/rte_rawdev_version.map +++ b/lib/librte_rawdev/rte_rawdev_version.map @@ -19,6 +19,7 @@ EXPERIMENTAL { rte_rawdev_queue_setup; rte_rawdev_queue_release; rte_rawdev_reset; + rte_rawdev_selftest; rte_rawdev_set_attr; rte_rawdev_socket_id; rte_rawdev_start; -- 2.14.1