From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0052.outbound.protection.outlook.com [104.47.2.52]) by dpdk.org (Postfix) with ESMTP id A29B81B746 for ; Wed, 31 Jan 2018 09:59:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fkfMyCtu53nT12W31DBL7jMAArhgdkaabcLJ02nWfrQ=; b=SQhxCCNqDmBf8YPkCEt9bUUqKN31BNrkPbp/DvV0XYsNNIBAhrjSSdy7Id3m507zRQAGpHA8FK7FbOAbpNbwhs5Whq+R5BDgbQ1brUgO2R0wmN/Jv/+PeDO5rzw54NrL+8x3n7fH27FC81cM/qAsBovjHjL9mABREA99eyYbZJ0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (192.88.169.1) by VI1PR0401MB2462.eurprd04.prod.outlook.com (2603:10a6:800:55::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Wed, 31 Jan 2018 08:59:10 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: dev@dpdk.org, hemant.agrawal@nxp.com, fiona.trahe@intel.com, rosen.xu@intel.com, Shreyansh Jain Date: Wed, 31 Jan 2018 14:43:14 +0530 Message-Id: <20180131091318.7894-7-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180131091318.7894-1-shreyansh.jain@nxp.com> References: <20180130145710.24757-1-shreyansh.jain@nxp.com> <20180131091318.7894-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: HK2PR02CA0168.apcprd02.prod.outlook.com (2603:1096:201:1f::28) To VI1PR0401MB2462.eurprd04.prod.outlook.com (2603:10a6:800:55::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0522b8aa-23c8-40ac-c0bf-08d56888e74c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:VI1PR0401MB2462; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2462; 3:kF2mN9+/2JEPgVNSe6ENmyILkFxK6+BqsCM5zjf9omTbX0U4gm4SQCJR2jUYy5rjJfDR3mzhl2tgFGVCfAi7hA+tesx20/BqqS2ipzfahapepn5H3anITlh2G388m9mkf/Nva2+8XejuMTHp0pjNBzmuFmmc2iKAhDwwuBJobtrJgi5PezbnfGGv1r4QmEB9Q2zpoAr31nrcwCDceJJ1H+ijTVsdVWoU6x9NzSsmXJGAyw/vzznnwKexLu38D9Or; 25:ie6Bk/MxaRxMhF8oxkG2UElANOn1szow5DLghsTPVe2L8xkN4i1OdHUjqzcqMPGddKY/ulm/pKi2RsbtfnmCuVJylB9xRkdRnRy75KtFlIY4MacXkxD6KPZ1jAmgRSyh3Wccyk5IRPXTpVktgfFltfwq5QdfLkbX8Afi7uYkLpUiR/o9MheVw7q3fIBI+VqvnI9o4j2/zmpQQ5paUDk8hUs1MzL6Q96CeFDAiD8uLlfaTx6alPm2MmPIv3kT7TxCWs4Wbz8cl7jr8LngsuVzeBEzA0gm6s4k4ejO5+pFqo3iv1MH+Djb+sVenPIc7MMw9EHk5n39OVZBQdIOKr0f+w==; 31:lnuP0+gJxCxoSNy64ZtnPuNejwBDvju1MOYy1R7mJWt/IJtKe4n0AVgkSjUj3XMh0qc64g8CfZx1l/lbEAuGLmD2LnAPCy6V7tJRifL0OS8+R0dacVYgMdCdTNerjc4af/CCdOlGlkTCK6hGaVd5vuhmo0WXYPesJ5NAzOVxxVSQPBQdlTtRvM4JIeRLdYG0riSP1xLRJ5l0ZOzX8LD4o0vxBienjR+hgSfukmYvIog= X-MS-TrafficTypeDiagnostic: VI1PR0401MB2462: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2462; 20:eJ3KLez4f9xLuEouuRjN+JMNDWKdLsP90IBP8YQ50L/k1zATMyIUyir4KjRmxNxfJIJHzh2PeW+GYEnHOogDO6jtSVEICyOQ3NaJrNjyK4VzlsTso2pCmuhKHYRDv3m3IU87RIA631VwuN4pKVh4f9z9FmG5lkSkc90/BitvRrf4Xm/n+tgr6DxU+YN8ejJhckE0KvmHqVp1d6GZLon7V4uPwN3qtSVrSivl5RWCe10oWPJQjXmKS485bs88UnGUO1tohcQlcKeURfFHzcFMrj7s3dO7qnt+qCIR1T/O/u9OMaUCTkobO4eo20til46OfNAEWB1pYjKXhDsHDEEvfgb7bNyEONHmKGGvJxPmy/15hN7bHmbXjlS6ghOfnmUcH2gvw7CabplFk7uUGZ1Y58VnQxi4uPCbnJ7+/WaJ2eO3HGFb17tseCyLA4Jso29/8Ffw/xMsEoL9OYOAk9bd0waiZYkFFllCArmN4DgXimASoJaQPFgJ4+MahHbA8iwA; 4:L3b9BFF1xbS7QWV739p0XhiO7FW9vc1wd7ecQBP4a1dIK0gS8yZSkhp+wPVHSY3TSIsXxeF/dMaiCLndFb5/KhXBDrDGmIpssbyiFR8fffaTk+PfeKrqKy1LJS9Ga+zTJfZos020bxwd9MboYlwpKX5ZB3kUDgW3c5cStnjkYQ/bSLtzbhDE4plqF4guMPAZ+nUykR1+GPEWpDgqKHBuaR2jxTe1ZTu8SteXiyQd+QOCIE/QaM9ZO1a+iHFnhFk1uNOeeK+6qaLgGCzhMKvQkcdDJZHoFqvqJkq7zwB59n+V7af5fO1RY56anjZWagvt X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(3231101)(2400082)(944501161)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:VI1PR0401MB2462; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2462; X-Forefront-PRVS: 056929CBB8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(376002)(366004)(346002)(39860400002)(199004)(189003)(6486002)(6512007)(50226002)(8676002)(48376002)(4326008)(81156014)(316002)(8936002)(66066001)(2950100002)(81166006)(6916009)(53936002)(16526019)(5660300001)(47776003)(186003)(26005)(106356001)(2361001)(97736004)(16586007)(305945005)(478600001)(51416003)(386003)(575784001)(36756003)(86362001)(105586002)(68736007)(2351001)(76176011)(1076002)(52116002)(2906002)(6506007)(25786009)(3846002)(6116002)(50466002)(59450400001)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2462; H:Tophie.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0401MB2462; 23:Zx1XlBq+gXqlAvGdAN9xLUq1KkXFwR5MS2SEZmF?= =?us-ascii?Q?xgvhje0HjMv7LmKc4fAkV0KIL1r69Jt0Smi/kTrZcKwGRbY70bS9O4WY/0RK?= =?us-ascii?Q?aMfW7qHcY2y9bgpzTvzYkmNS4LzfGh+2TIItzf6+prAnSlzcsI0QWK4wpmP0?= =?us-ascii?Q?AgZcTbvg5FFYy1yL4yx2+QNmSJ55b+/7y0wFqIzzNlOuUqjimVDUR5C0X4od?= =?us-ascii?Q?+jTeguSOtQ0kiRSHosWusdfJSshcCraxiFAMV0zH0z4jsHQlMP/M2oEupqeP?= =?us-ascii?Q?Bcy6h+UiYD1jKZVY0n1jGcBQNBJM+PNh+wXuKFvC0zbmgD2dzW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X-Microsoft-Exchange-Diagnostics: 1; VI1PR0401MB2462; 6:3jBOr7It63gIDQlm/A4mgji9ZCCs9cluSmXo7OnJfXqg8PY6PFudSibuTw64P2QM+LGUzy2kPMJ6do/lU6XVBvv9g59R2XAwa6p3gFHXdo3VpV8063DY6soGuKXd2tK/h2LExS4kv+oXYv2LkLckK+gUlngMfMtLveVWNLs/QB7GDHHsG5DLY7XIUy8g00U5mSNaBMtABTO40fo0PzGkYQulBj+EFlRHzhR89wZv6EIb0DZ/3aGk2UrHDWB1nlZdxtAgev5wMgvkevpVWy2Z7SxdKzoLhZvqCbS+rIZTgoyBOG8XP3GDTSG0QX/XlOAy6my52hiHPo2hX6VoV6Mq7bxkZ/3w2pPcOXpAbrDYenY=; 5:k5mjwvSvGfBTcWEDXoTkWB3f19lozq/8TLF/q9gHUuLAJtUP41xxz0rIf18GsZSLO0db+QAI31KUQE7Af5GJMT0MBMwKdwAUQmrv/b3A3HmZKDMN6gngAaqVaJtRbgDs8JhWl6P4YqkcxgsV/WcN5HkX7h0Bbs9qXstQhyUyjK8=; 24:ZHorEz+6LqnqFv/Zd8VWgMNDXn1P/zY7C9xqN1mhidelVhLF/MB/pYHtg4O6g0wyVw4nSaQapKulZlflwAuTNcQbk0astTAkSbdT31x4BnU=; 7:LVTI0eZdKX4KliBGD+ofdRo5Rd+kLiw2nZyQy7mFzBHGrL6DXdZh8Qgyx3md8XAkyZPwc/OTt/XBf5ZJiQkFwmkJ7lya+ahswvR9//6nWZjlS8rStEg2ZTOYF0crhF9M4I1Et2sllBH24ezCMKX3OcBB8E7ouc2KLQ4vKpQu4Yyro9+R0dd5Gxvov9DQVBF9LtTyy2GJolybPUYOGI1/X7moDo2rshVzmlfvksT69jwMLyEqQXiyfA1FQ6XSrKMd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2018 08:59:10.5232 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0522b8aa-23c8-40ac-c0bf-08d56888e74c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2462 Subject: [dpdk-dev] [PATCH v4 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: Wed, 31 Jan 2018 08:59:17 -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 389b009d7..4170a618e 100644 --- a/lib/librte_rawdev/rte_rawdev.h +++ b/lib/librte_rawdev/rte_rawdev.h @@ -589,6 +589,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 41b3a3b5f..408adf0fd 100644 --- a/lib/librte_rawdev/rte_rawdev_pmd.h +++ b/lib/librte_rawdev/rte_rawdev_pmd.h @@ -477,6 +477,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. */ @@ -530,6 +538,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