From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0060.outbound.protection.outlook.com [104.47.32.60]) by dpdk.org (Postfix) with ESMTP id 783E57292 for ; Thu, 11 Jan 2018 11:23:13 +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=gK19jkaOy23lBllWrXFSREArpKlVER0i+Jy3eeVtHZTpve9oUOcXSARZYuS22peh8+3AnZLdExAlEwSRNPbwSRx8Viwaf/9CYCV6SsixCrfEaNtaXS0zLNCCKz3O/wcZUGjl1OgHy5PTDTGxRDOAtvK71mkjSM9suvoAgnhp5ms= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Thu, 11 Jan 2018 10:23:08 +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: Thu, 11 Jan 2018 15:51:47 +0530 Message-Id: <20180111102156.12726-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180111102156.12726-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20180111102156.12726-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR2001CA0023.namprd20.prod.outlook.com (10.172.58.161) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 69c2f7c4-2dfb-4ac4-d928-08d558dd50c1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:S2bezyYvShahTorXm+1dS5P48jnmfTfA/00t205EQ3QooiCNnbhHi0N2NAg5kbpZAQ5yDBkxGnx6zTuJ9U1Ijw7g9fuHElQ7zVNJ4un8Pe5QlhmEh1qn1VZZ+dcAOgkkL0rFA2Uqj2J9cDwQEyaGvVPEDE7cVooDTGT/hPUVgoAmNrj6utS+9u18M3ycVW9XOkZ+Ldq7k52QUP4RfpJtQWSluNDyejBsFCValg6Zx/pt4lQqyk4+Gl2W5gv8znQw; 25:ghNMeU1OJXcJiENXi6mG4GmbDq9BCvhMRicpsypnM7fbopastC0KfoRsqyDOzSAHXzYhNqQ5edUmQ28TgqM4kQ4AXiG3j2RU8gDPF2JEoGw0Zh9sCmDFCjeo5r0BfreUQshE5OdqMh3r4z75WSEa4jgsPn/i6XioGx7MwpfNQg8sbBCVtyxSyvkeL6EAgDmSLRYq4dy4ThpowyXJl5o6wfipl8Vlc8esbc176pBJ0ZZYmdrfRGwvi9fFKnnNNBn6Ih7rElnb7WHK5A5tsIb/8lhrR5qGJ1AaVoRB6FX0wNbUFe9DiSJAWFzpQ15ysqipIouuAeK2y8tRZlkGSXU+jQ==; 31:BIZ1DUrPUTlKMND0Fs2m/8OOzyHdWZlhCXS2GJ9Lh7mtn5rUWmN3W+4ISRAIejSiGMEpYkHm4v+6DN2FSReJ0Z7ELR3+XGRGQqKfzr+pwU1QXmNZ17Kxw3ThMf2FEziq1xpiKYm+uJ3Iv+Q97Jr8niHgFa2L7qKVkijwRD+PlmmgdW9WDSTnCe8sKs+QVr/vN3zJg+rPXhaS3BuD6q+IKrsh/8wEfwr7XYq+YZvVek8= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:HRoh5me7cpKDHkjBdsRwXjK+tzYo4FkOU5tCmjP2iIeGW9zd6YFadgZ5SLwnOgFEeFbvRFV7JsWkw70N5Yu2kbM6cmzt7aPtGpiBbwOFzcdVBth3+ad+eWnxm418WCYW1H0kWBTJEHCvvD9leSi5oGjXYwWJFtjtM++2IQO2KuIEh77taDbjE1Zvw86QofRoO+duBzhgGli+GdJMQiv20LpaIegD823cbNWCp5ZwS9Vakuew5p604t1BG6C93EhzE0eg065Rv6eBn1JsRvEGAym4WNTe7vw84rn7ygoVlJsXPBShLqLL4eTn1P6FgUfFtLdHHLHMidoTYMot255ps/+jQs8bbwvtTA5x76UI/4Qb+Pb2j8kad1VezO1eAqemHmHTt0/U8uOLHvJ9xic3OTBd3sRzlgYNXwGk8ge7qDnl5ojMTUTfXp7dYsaCInDoysUNxTNJcQQcl49+RvrypwIKNDTynTnvar8zpGynJ6YVvnvQ2B1XLln+R5479ME+jBN++ngJi5Vh++1o8C1gmpQo43CFfflgrbCZRndt41LJh/DjKT5cJTvhLw01709Dps6LgJeIVb0ijoX403iyvjFytFBTNqWEBO6Xw+kLRbU=; 4:jgsmMZQTkFwjiM0A6t1gju4hi/LUyAXDogE1uKZPFv/uos2DGW/lCdFju3xANDJXs2SrF6K3FRt0+jHh8mJ4WKawmGo2wdobOcgLNeeJJbqkIcKT1jVAuTm2cKPi85QeUrKZC8KNeUgbm3Kj5Fp1hYhwm4boRysnpT2EPnZulUlgQsNCLCKhZcCDOauf6CEayMQcAP6/QtiTspeko4wOutsqvoA5UVPnRl/dw2NKwKDUYVoEgFAQxBFB6+Etq+2RpDyojkGwDM73DlIzaLE9mP+YbiaP4JjFEfdeCPfa5DS06BDSUXwu1VH9MbhpwwZi 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)(3002001)(10201501046)(3231023)(944501075)(93006095)(6041268)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0549E6FD50 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(39380400002)(366004)(376002)(396003)(189003)(199004)(6116002)(2906002)(8676002)(6506007)(47776003)(97736004)(53936002)(5009440100003)(72206003)(1076002)(16526018)(53416004)(51416003)(66066001)(59450400001)(50226002)(16586007)(386003)(76176011)(25786009)(6486002)(316002)(69596002)(48376002)(42882006)(106356001)(52116002)(8936002)(6666003)(7736002)(6512007)(3846002)(81166006)(2950100002)(4326008)(478600001)(107886003)(5660300001)(81156014)(68736007)(105586002)(50466002)(305945005)(36756003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:Pavan-LT.caveonetworks.com; 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; CY4PR07MB3464; 23:J5Y9Ye+aKmkL+sOks6Zmj+On+P0mVKaLhmGf70NJy?= =?us-ascii?Q?P1BLEsjKnYH9RYcymV4VX0aBFBos2p25EiZ9ZrzRdm+UjiTwtXqz8UPEM/EW?= =?us-ascii?Q?y1Piy3r1/0lgNsOqdYdJkqtGgATZV5qrS79NJx3CNUus0KAo2Avj1b5VkzKQ?= =?us-ascii?Q?ydX9y8wLObrhUKEdq3OGiu5MzhkMC/HQJ4mf/TZ7fQzBY1zJ5JVX8PeK9MEM?= =?us-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UfQ7MrNk7ZX3Fy/K+eHCLmeEMJx10qEU6wv0dlQG9lPr02gU4m3i6O46uEt0QUxK9hX8yRlTnJnxn1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2018 10:23:08.6347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 69c2f7c4-2dfb-4ac4-d928-08d558dd50c1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH v5 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: Thu, 11 Jan 2018 10:23:14 -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