From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0064.outbound.protection.outlook.com [104.47.40.64]) by dpdk.org (Postfix) with ESMTP id 4EEE21B1B2 for ; Mon, 8 Jan 2018 14:48:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=P19Cf4THJ285ezfPfdGvgG3+YZ9LbRbEKtPxoPL3OU8=; b=clZ0tyikVi+DMBFsWTlEC3bvskmaPtNf3DQOCZq/QuppUxAsxIdB/EAdwgiFlafloOUH7wfCoGFJpBaGp6TQh2ujfjP1AAFTNxmUJY2kdYgpcsS9usNfthhdtMJvD8aCrXdZZKASJ5FLYlHXxvU1gGuOIKaEs6/JfLhcR0vcU6E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by MWHPR07MB3470.namprd07.prod.outlook.com (10.164.192.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Mon, 8 Jan 2018 13:48:21 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com, gage.eads@intel.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Mon, 8 Jan 2018 19:17:33 +0530 Message-Id: <20180108134742.30857-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180108134742.30857-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20180108134742.30857-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR06CA0105.apcprd06.prod.outlook.com (10.170.138.31) To MWHPR07MB3470.namprd07.prod.outlook.com (10.164.192.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1643038a-2640-4369-09ae-08d5569e7c7c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3470; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 3:+lscrakkFNGGzJ+8l5DLaaJ58OcOMloKsj2GUZWMyGIPir8KwzzOfoflwrrNwaLlyUDQ5b0pYiGdKCFH9U7MxuD69I7zEAVtGJsGpE9Y7zHNFJ7NAnow6VfBIj85Zl0jPzNyuunjeKanYV7BDQ15hoZLoCMCjnZUd3t+dZL35VKP1An9pyxE0Lm/3P5pRHTda/E5/vt/nUqMa7zjtcjkQmctvp4ORACOoBX11x8IFJ8JmbHgKLZBrPB1iHF0vx47; 25:Y7VqNUXNuMvSOvEUK0jEyiTMyG7uSWeJf8/3NnAkqvlFQO3BYJbqg4x43mUbVNM6IdvQk8+Femw6lAsvr1ORFbMABSltLhR2MM6YGkzBBxqmRZSd6mnwxadB7uU7UmsXaSAbOR3GwNBhBZVXJ9pfKK111IPCKY/mMAbFIVVAlfQ5OMknrsDo24Wtt+DJu438Kg0t83lEA3KseHOw9ZZ1h6L4GSJrQsBGsiinNOZI1Hsa9eyDNTvPjTEwzzSgz10ZTngm5SsJRWbSr7TfEsX9i1BGkvZnAqRp6QN09y5AAg4pD06DahfNH7mCJ64OvFydF67N53iPJ2qVrs4W9ZkPuw==; 31:PcT8kZA0EzDCD2G45N+DxLBfs5e7iauWAuWqF45T2Br1pb0F2vHZK9zcbW5rAFFd+ZVdb9HzRqMBMhK2nJgyDORhwz2DRY6a0mxpWjK/g7YsWos5Eu7cYptOCklzDk01DvPE23J947HQm8DSefMYpeiqoz9FcH06WYHnlnoJQ87WzkVPu+kLmeou5CBQ6wPsHuNBKihYyFYz9MXvN+0sD3wNZKhGPDpklmHkhpYUwAY= X-MS-TrafficTypeDiagnostic: MWHPR07MB3470: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 20:9VuZ4tx97x0iYbeindLZPOopkXo+AxeiR0sQ6gYaE82lyAYZ33upaz7fJNWRBZiZx+JeEi/QUfnMMHckJISS6cSu3RhRwf05PfNJYh0Ry9BjWQM/0Esa5BSGFbZsbmDXLjBpm27SpLV+zQzg/8KfvVGkdI0JORt6XihDJTjxWQzSXoEASOF+9jGziG4DCP9MIwHdsPUaBcY8rHVvcz05HvVDG+PlJSw0eJB3yqaG+BDcAkar3iTZHHXWkLRWYOhRdIUl98BOxo77/TrWYYd1wrB7z/7Oo7JkZ4D5AcFYVBvzhCK4qKptxDWcAp0oYS+nc2bq19P4l3IFEvySQfT1Xg3gOkx05vD5FFOORN+RfsQHagylrQIL6MDlAEdcrf+obO0fQ6M59Vcg0E6KL0D6eYrdIvnoxJbki5WTBMMwU8vfvGJnoPc88Mklkck9jM5iFSgoI6raz3e05irTATdakxNlVujhkmsR5c4UQlWLVVMk68rqckpQeDStU254Nn0TI/Aqn9DXSJWdcDu4bkZEbB7RJd0PKX4H6GkNcR72dh5wwmGjdeBv2RMYKjAEWQoEus6tHgMNn9d1G5uWvLRRiKuRJnQqkX8i9ynx+vtoEqI=; 4:aKWeGnLx96yxPOPF/JqCiAv7Pt1+Hf4+LnaeDN/zGa3zWpy+UwsVfIOydZaauqHcaYg285QNz2YFovsoRetXjQXu+GxL9MjaagNRc0Vxz1UqsE6psDpgprCQjXpb7FTxl31D9J/7aaF+XtztXsWA8/J8hQRC71eEGMMcwnH1VNVsNuKmpYyB9dlkfpLeQMjpWQl+CviSYyWSAq40zuqfJaFsWP3Otcd3mp76MayFaZksRhuFJAxwaGcp+guFWxLr6I93Bojn5SFJG5c+TQxPp+wEw/6pkHbCXq3a5x38uYjn3LjO/KB265IBARP4wWw+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501075)(3002001)(10201501046)(93006095)(6041268)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:MWHPR07MB3470; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3470; X-Forefront-PRVS: 054642504A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(366004)(346002)(376002)(39850400004)(39380400002)(396003)(189003)(199004)(1076002)(2906002)(305945005)(7736002)(6486002)(76176011)(51416003)(52116002)(2950100002)(36756003)(16526018)(6116002)(42882006)(6666003)(316002)(3846002)(5660300001)(5009440100003)(16586007)(53936002)(48376002)(50466002)(8676002)(8936002)(50226002)(107886003)(81166006)(72206003)(68736007)(478600001)(105586002)(6506007)(106356001)(59450400001)(97736004)(386003)(47776003)(25786009)(66066001)(81156014)(6512007)(4326008)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3470; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3470; 23:XDtQzkilX3Sgx1my47nEmX3CW/M98sYGhTDPBBLfH?= =?us-ascii?Q?oGkHHJNqj2snEQYByzkMpn0Vq7Y9i9QLKtnIoJzEEQadYbbBOqa7n5j0SQBx?= =?us-ascii?Q?J3bAsypgZMu9VZILXCB57yCM+e0V7pn3JHzGQS5qczWTpJIu6vPPUdD7hmYu?= =?us-ascii?Q?EP8cascCj6Zy7S09I5ubevGBaS7UdsxfhqyOVheDqjq3Tg9AU5CVdm69jHJ9?= =?us-ascii?Q?17Xv0rn5eIveGZ8wK1nWzKTN2hcyBIh6Brxt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amDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2018 13:48:21.5024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1643038a-2640-4369-09ae-08d5569e7c7c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3470 Subject: [dpdk-dev] [PATCH v4 02/11] eventdev: add API to perform self test 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: Mon, 08 Jan 2018 13:48:26 -0000 Add API to perform self test on the underlying event device driver. Signed-off-by: Pavan Nikhilesh Acked-by: Harry van Haaren Acked-by: Jerin Jacob --- lib/librte_eventdev/rte_eventdev.c | 10 ++++++++++ lib/librte_eventdev/rte_eventdev.h | 12 ++++++++++++ lib/librte_eventdev/rte_eventdev_pmd.h | 10 ++++++++++ lib/librte_eventdev/rte_eventdev_version.map | 6 ++++++ 4 files changed, 38 insertions(+) diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 035bd0017..85496e575 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -1114,6 +1114,16 @@ int rte_event_dev_xstats_reset(uint8_t dev_id, return -ENOTSUP; } +int rte_event_dev_selftest(uint8_t dev_id) +{ + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); + struct rte_eventdev *dev = &rte_eventdevs[dev_id]; + + if (dev->dev_ops->dev_selftest != NULL) + return (*dev->dev_ops->dev_selftest)(); + return -ENOTSUP; +} + int rte_event_dev_start(uint8_t dev_id) { diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index 1bbea57db..9201a5af8 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -1787,6 +1787,18 @@ rte_event_dev_xstats_reset(uint8_t dev_id, const uint32_t ids[], uint32_t nb_ids); +/** + * Trigger the eventdev 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_event_dev_selftest(uint8_t dev_id); + #ifdef __cplusplus } #endif diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h index 6ed40cd38..7c39a040c 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -603,6 +603,13 @@ typedef int (*eventdev_eth_rx_adapter_stats_get) typedef int (*eventdev_eth_rx_adapter_stats_reset) (const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev); +/** + * Start eventdev selftest. + * + * @return + * Return 0 on success. + */ +typedef int (*eventdev_selftest)(void); /** Event device operations function pointer table */ struct rte_eventdev_ops { @@ -658,6 +665,9 @@ struct rte_eventdev_ops { /**< Get ethernet Rx stats */ eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset; /**< Reset ethernet Rx stats */ + + eventdev_selftest dev_selftest; + /**< Start eventdev Selftest */ }; /** diff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map index 108ae61fb..2aef470b5 100644 --- a/lib/librte_eventdev/rte_eventdev_version.map +++ b/lib/librte_eventdev/rte_eventdev_version.map @@ -68,3 +68,9 @@ DPDK_17.11 { rte_event_eth_rx_adapter_stop; } DPDK_17.08; + +DPDK_18.02 { + global: + + rte_event_dev_selftest; +} DPDK_17.11; -- 2.15.1