From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0062.outbound.protection.outlook.com [104.47.33.62]) by dpdk.org (Postfix) with ESMTP id 653EC1B3C2 for ; Mon, 25 Dec 2017 20:18:30 +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=woJS1OjA0D5yyygRYR4c9KSvtsHgEHMr/DUCapORRSc=; b=JvZcPHHLJViqKdwWIpC8VQrEtGrLGa7cCwIGDXCnLrRyVtBgCcdDsyurfnL211wEyZ3gXjySOFAjYHtZ2WHyCwnEcxt0zatUj+B4z0jAAgY5+n0pv/K/jdnNsI4wtMv12WLAkFrM8CdDbRUXrQi1MdvAE3qtTsNF49uXKCcG/qc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Mon, 25 Dec 2017 19:18:26 +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: Tue, 26 Dec 2017 00:47:29 +0530 Message-Id: <20171225191738.17151-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171225191738.17151-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20171225191738.17151-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR0601CA0004.apcprd06.prod.outlook.com (10.170.128.14) To DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cb6bfdf0-9ef6-4bc0-4dc3-08d54bcc47c7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:DM5PR07MB3466; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 3:svKCrKhKMv3xUh5p5jdz0qVj2QQDbaD2mnRuxGIsA2WBgmdXaYwt+mbn2MKm0IIsVYjqBkssRE3vNfxm1OnrI83tqA8cHUtFT6X2HwVCHLKpizJrryP4qrem1GKXFtW8Dr5PJMjlmrFjwYjGdTWVgspyaMoMjqs/k0uo66GijiENOhkDmPmWAVupCzE4MwwnrqAcV/GXMAomDHSt38bWf72kZKelJsf5utLwIOQjL3nie9MzltSKJcrZZ7CXyGIo; 25:YOs672zuMF9fyusGJ6e0JuwsRRurUcc9/GuhVgnmp4hmf/GA7mLc2inQR9eZdXk4BZVXU1c1XMAtHvP+9r8EQcShsyOp7L8nRrXHtRCDYEr81fMFhnkLTbSXE6cRju2qljXvA/EDB207+k6K4Vyd9DllJPFswOFfhEmKbxiZcK6xlGW922kw3NaWdRzhhxK8RdFhgIxKLRRl5DLIggPS1kzTow+NaBH7kCd88p4hjynBTUo37jXfEqqbwsZPwf8C0+pdkkr4Q6rihycpQMzM6lqH7jkftkGoqycgIFdE/xL31zTMfT3EcGpwn31w8TjRX1A8cMBAfVFdqRFHYayK1g==; 31:RbgDuflU8SkJ5iyzw5r8WbYnw1a6z0Kyf3/5y1ZioiGCJyoQi66+2f1GVCMNRQ7ptWmmSrJiZrl0XmcGbsuqGKLnTojGB2sADv/8pY6so29N8V7cjDC9PVWnyEUUytJ6Qu6wg6Q5IbtyS/BhqOL1PnHTEWTLvVL+jX6q/0n4P/wehSU4yyP6+/8E/01xaV5ZTzepbNbyiCjQvwvn4/835+/loJMt5I5XocnHyF7hs/o= X-MS-TrafficTypeDiagnostic: DM5PR07MB3466: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 20:cx8FrOB7qWT+uAkddRxaYV7Dya5N7WnFwh06tgpUtH71iTclZdDkeOaV30VHpvLedTRuUyeIZAIuzD3i4BLTnUG56+bnpeJlyIp5uEROldVLqJKFtQHcDvVT0LOJmqfhpGbGu2yhB7uQ1PmirtGk5xa329Atazt9HFYDFXm5YI3+tHvfYTbT9TRw2DUbbku2n6z+E2FRTyk9UVPySAnSQH5jOrpCStjpgp+nrZOFlRlZLnBydDv22NJAF9xEIORuhhMFy/yAddTKaSyYxYD6GnMJWmf4WF6FnUMrw6YaEn3C7AQz36SMNtOXMPaUoWSfgwAWV3WF8u1HWO2gRXz2GzZnBkqIUcnchVn7CZS+Ow5vo/07dkDwx6MjgtHnsri5S8pNnQJvW6AzXSAFQvjVml9PsUw0BzZ76sNH4dw78HpaE8DCq51bJxptzxpaeLJptyLrmW4y/QPpviqcU6+xst35DKBz8NSMIhqf2WjLrnMjehy73hZSNyH5IwdtgR+r5MtTRXiBYmPXnwyfD571ioFpMlLkYZAR/hWm6nxIdo/6Zu3m5qB+yCjhCHQ4nmHayl9Iu5Kug2194bKh3RseyRtPmvwXx8KDID32nohNdm0=; 4:VoysG0OSfGxU9UAUloLdJ/7lJxCKaaVwMLchyB05PuH/Luahv15vnnpycST1QQcamkUGq5X8v/w/o+d9l7uh08r/WJ4zVFdcwMmBMkqatE3gPxNZwIJFy3zY0cSIgUNfLqEGOmm8be3bxite4mzpNOht4FgVbiL0dkQNUcSrS+ExyrmsItajs35hqKfUClZ/sipSDEn320og9KiNnjOPXJ2/audaS4IgtCNOOuhfG4QObZ8quKICdElY4X4jiB2JFXXTGgs1jON4QUD3zrXC8cQDWyk0IPUPlrlOXxeNmb9FynGS9Lm+H4hraEL+FK6M X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(944501075)(10201501046)(3002001)(93006095)(6041268)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR07MB3466; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3466; X-Forefront-PRVS: 0532BF6DC2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(366004)(396003)(376002)(39380400002)(346002)(39850400004)(199004)(189003)(36756003)(68736007)(5009440100003)(7736002)(66066001)(81166006)(478600001)(81156014)(305945005)(47776003)(16526018)(8676002)(59450400001)(6506007)(386003)(316002)(97736004)(16586007)(5660300001)(52116002)(106356001)(25786009)(53936002)(48376002)(2906002)(105586002)(76176011)(51416003)(1076002)(3846002)(107886003)(6486002)(4326008)(50226002)(72206003)(8936002)(6512007)(6116002)(42882006)(2950100002)(50466002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3466; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; DM5PR07MB3466; 23:7VS41ckQPvNwkR8zMSub3Xcj8GiSdpHj2sB4ByQY5?= =?us-ascii?Q?rmg+oUUHwCkA3tTZ0VZ1YZyJL8JZepzj8ZEdpjXpftLbKNSLNHtf1p4pOf4o?= =?us-ascii?Q?NPZTWGzCWpHjzvEebrdraRnpdBjWhC2I5NbgjEUVenKwq61wg9qulRbYbfuA?= =?us-ascii?Q?/5948nhdOLpUb8d76tvA0JBiZH3bQzq7uP6fGRkRn+iwI0iKgJ6H0mGNAxxJ?= =?us-ascii?Q?9iwJfa6G3l2YQHVU2fbzLkn9eFVOdVtck4Cj1TIR7ZLjpT+w4jY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/qghf8pBTN2e6oTwMj3U/fWzAadXcUBGB?= =?us-ascii?Q?JmXLkZXyB6BLvc=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 6:3VASTKG12NhiPlElPGOIeelwkOAr1URtgHG/Rt3wnKedcrHNUZJfmQiUaV0V2cbygFROiKnJrmlb0jvE1Dr6+kzRTlcRi3sMHFqzFfZUS2aNi9fv/RpoxsvyHVDaUx22EHThrGBNWheNE0fn2lGpLkf1xvYoIZeY0jjhbFtI0KCtng2ymJjWE7YY7YWy/JDzro0azztOMQrE8DOb+d3a85CORzBhn/D8NZpVUe7wgiSGA8U4W130m/+3QCVPPP+PwBG1b6wDbsxZKjsy4IVX5qEZD2EUdq0P2+XscJ0bKqVUsq4RC6QgiySVek32L5LjxNfT4uSCGwaKXspvUTUcTaKqWfnVr3hgWMJMLSZYMBA=; 5:xDTuG2XyeHLXXKdRgPy9tT+E0f5qGONhttYalw/y291gxAaSYqAFhwvdrW1iEIoH+jVP0oE8tCY/OBiE0C2m5Kj3fpU4hclWX3cx4o0he6gKXbkUqXjq4A/8Vrd4N8yDYa6PwmhL8twe3THtfvGP6enVZM297xnCf5KRfy+wtUY=; 24:G5N/Zv7AS4ANV8+dnNjiOWP36UCLuUK4uoaBj+GrRlFo42HMFmQ7FbULLw/OjD1VPOfBxOK3inPZq/cbQu/acZ8N4uhntuGycsHy8opngPw=; 7:TElFy/7xHFpKoSJF50OPRkO2qzKbJDDEVOlRdc7hvZ5ZOdQBf17eqUiJNQgSseyPvQBCnfR86UGAIaGAc5HySZLwnCs+6CFhpoheU5C64Mj+jSn5F7ZJtVnsWioP0PTbVGkLAZ2lL1Ti7TuuwBREr8F51Po8qw6JHEaRH5nybzdWrHhiVN7DhmlcOiWwD/khNT4RwTOgMiMRIc/3TxlqhhI9aHsbBoob1+j19PvrdVn9+C6ci+pTxNdEGo5XWKrx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2017 19:18:26.9948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb6bfdf0-9ef6-4bc0-4dc3-08d54bcc47c7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3466 Subject: [dpdk-dev] [PATCH v3 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, 25 Dec 2017 19:18:31 -0000 Add API to perform self test on the underlying event device driver. Signed-off-by: Pavan Nikhilesh Acked-by: Harry van Haaren --- lib/librte_eventdev/rte_eventdev.c | 10 ++++++++++ lib/librte_eventdev/rte_eventdev.h | 12 ++++++++++++ lib/librte_eventdev/rte_eventdev_pmd.h | 11 +++++++++++ lib/librte_eventdev/rte_eventdev_version.map | 6 ++++++ 4 files changed, 39 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..8bf0462f6 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -603,6 +603,14 @@ 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 +666,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.14.1