From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0051.outbound.protection.outlook.com [104.47.36.51]) by dpdk.org (Postfix) with ESMTP id ACFF51B3DB for ; Tue, 30 Jan 2018 16:24:49 +0100 (CET) Received: from BN3PR03CA0109.namprd03.prod.outlook.com (2603:10b6:400:4::27) by DM2PR03MB479.namprd03.prod.outlook.com (2a01:111:e400:2420::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Tue, 30 Jan 2018 15:24:48 +0000 Received: from BY2FFO11OLC001.protection.gbl (2a01:111:f400:7c0c::196) by BN3PR03CA0109.outlook.office365.com (2603:10b6:400:4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.464.11 via Frontend Transport; Tue, 30 Jan 2018 15:24:48 +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 BY2FFO11OLC001.mail.protection.outlook.com (10.1.15.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.444.13 via Frontend Transport; Tue, 30 Jan 2018 15:24:47 +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 w0UEh7sj023996; Tue, 30 Jan 2018 07:43:29 -0700 From: Shreyansh Jain To: CC: , , , , Shreyansh Jain Date: Tue, 30 Jan 2018 20:27:05 +0530 Message-ID: <20180130145710.24757-7-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180130145710.24757-1-shreyansh.jain@nxp.com> References: <20180123135910.10755-1-shreyansh.jain@nxp.com> <20180130145710.24757-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131617994882084746; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(376002)(346002)(39860400002)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(6666003)(97736004)(104016004)(2950100002)(36756003)(26005)(5660300001)(8936002)(498600001)(4326008)(8676002)(6862004)(2906002)(47776003)(59450400001)(77096007)(1076002)(81166006)(336011)(81156014)(76176011)(48376002)(316002)(54906003)(68736007)(86362001)(16586007)(50226002)(305945005)(53936002)(50466002)(105606002)(356003)(85426001)(51416003)(2351001)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR03MB479; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC001; 1:d1AUkqDQjgh5wWka128mpFTT/nqjZJHBL5Xm7/+J2sUe4CLB82TJvkfv+UAvGdMNsRRhOa4qSah4PWBMol6+qQPgaXgOOoMJxrHsblFAJbVAa0JygXZB5ui6kYD3sk10 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2bf9dc1f-e63c-4047-8e2b-08d567f59973 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:DM2PR03MB479; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB479; 3:4HZa26lbrlvGeASKgs2K8JZeZllp/JwgkwxXDMFOb9BKnVtgE0pT4xNaL3NuVQfaAfs3t514nQDn6LLAORpasizREj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Wezunq0xQ2TmWKs5K1MBD1w8YARQiBwARWEBBl1Y4SBn3QNLpOPi9QWZJvCd1n+gYXJTrfooYtjtVOT7l37Nk7oX7Hos+WbuUWFUeQ5KkbClusNJDNcBBqWFZ0ifrpB2rIfriV2h7CUxZlxd3P7+RhZ/sAcnAYMI7iSKt1X+27hZI1FYzko4ZpF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231101)(944501161)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(20161123561025)(20161123556025)(201708071742011); SRVR:DM2PR03MB479; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR03MB479; X-Forefront-PRVS: 0568F32D91 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR03MB479; 23:mkOzjpZItk4BiWqNh0Tnindbe4bdtlU9PLGgDQJmcF?= =?us-ascii?Q?YDVhG5i1zhyK07FYaAyT2bC6eeq5wQcfa4Ko4+4yQstM3iKLmCHVdlhZDwhA?= =?us-ascii?Q?jy0XAIH44CRtXrowqlPGBPUeC2lHFVtm18KoTwWAj5/H1MyHYhyCEPnzl57C?= =?us-ascii?Q?Cak2qzRz0OUxiYQaLwF9dh3OSR/C+seje4Evn9/E2To/kUG+uaJ1LPC/0VBx?= =?us-ascii?Q?nFN31auINHcz5KEzCNdwZzF/iChW1FPL4zdx1a5IYdtWXONfbvR7dpALQZYV?= =?us-ascii?Q?r70+Ljjnk3Po427sGkyQI4uEysAEKjOVLgbkRt2PuxHeXshz/tjhA6/CSGz2?= =?us-ascii?Q?YGYSxPOSHOvGDA0OmMy9LCAMoeESizKwJ7AbnqGDrGD4wZdQu+cDrhsWC8Iz?= =?us-ascii?Q?4EfNqPvdXQBk8K18KOMd3aYQmEt2Equ5ocKp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SkoGFGv708Qt2D//BJzONQIh9Yaph0xvYESK+zmfISBAPBvFqP+GtBP0ibrgbEaI+/FAmjiN+1v2XmGWN1b8PDD1w/H5H6sYID3anwT8Sf2gYcpTpwAFXDypePHQ2nOJjhwxQEEL3KgrsyFZZdQ6qY/BOyWEtuHJr4kCt84FpIYfzKqqp2xNKbtVfygLEmfA=; 5:XJO1QOde2txLdMyhqPnf+LeEyuruEtHSwNofZJYV65Dy8Y13tZVltI9bgZ8b1yBAM+6tsFbrRQEcidel7jVPCLciZrAvDJyOSEbq+xplq+GSMjr7it9sbzawtTKzbggUcnNyh0gKByrSY5TcLVH+sK/LDgciyIAfdFYoT8Kvc20=; 24:Azh3GhElcr5hhRcIeGEOFjDwhW6cqq5Z3/hb1/GQdi3kXhXs8vynBjgthXXQTjJAXclsshek40+OEsFVIAmRAP9S54SNZZV22aC3/CtStkU=; 7:IknV6lA2MKEp2ayhKiX0eaFQQ5hv3SWYNPsnrbAeVa3SFL/vmwZfvwipzherm+QkuK8AJ5bQa1KyuUNLninC5dxfFxKs0DvKNXR36HsoTIPQnkK9SunEpsGyVPCgThvcUKjvZhTwQ4hWSNR9vQRhxpxbKBT6cADYY5+BgBmvGesZ+UFd5fnvZ5dWOOHApo3OFcU6Ea9KFFKeU5/Fw2jHADgQt01/eFhF6EVY/2PIK+z/Kz6RgThBmGaANW9xzjrn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2018 15:24:47.0540 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2bf9dc1f-e63c-4047-8e2b-08d567f59973 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: DM2PR03MB479 Subject: [dpdk-dev] [PATCH v3 06/11] 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, 30 Jan 2018 15:24:50 -0000 Signed-off-by: Shreyansh Jain --- lib/librte_rawdev/rte_rawdev.c | 10 ++++++++++ lib/librte_rawdev/rte_rawdev.h | 13 +++++++++++++ lib/librte_rawdev/rte_rawdev_pmd.h | 11 +++++++++++ lib/librte_rawdev/rte_rawdev_version.map | 1 + 4 files changed, 35 insertions(+) diff --git a/lib/librte_rawdev/rte_rawdev.c b/lib/librte_rawdev/rte_rawdev.c index b52293c47..d314ef96b 100644 --- a/lib/librte_rawdev/rte_rawdev.c +++ b/lib/librte_rawdev/rte_rawdev.c @@ -363,6 +363,16 @@ rte_rawdev_firmware_unload(uint16_t dev_id) return (*dev->dev_ops->firmware_unload)(dev); } +int __rte_experimental +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_experimental rte_rawdev_start(uint16_t dev_id) { diff --git a/lib/librte_rawdev/rte_rawdev.h b/lib/librte_rawdev/rte_rawdev.h index 8eab3974f..5946ea67c 100644 --- a/lib/librte_rawdev/rte_rawdev.h +++ b/lib/librte_rawdev/rte_rawdev.h @@ -577,6 +577,19 @@ rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image); int __rte_experimental 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_experimental +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 f74bf171a..eb8f68b8b 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