From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0043.outbound.protection.outlook.com [104.47.42.43]) by dpdk.org (Postfix) with ESMTP id 02D7F1B9D4 for ; Wed, 25 Oct 2017 16:51:05 +0200 (CEST) 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=XIvBrs3XWmyW4vIzzTx/p9Dv2qi1MTki8aZF3HVWKdA=; b=FcjdLJqV80x+TsC+rEM2reMz4Nd8W7L4BGk2azt8RrFX6nlYjoq9IMDRp15RIoiTxui7Qbs2ywqiQbI9hPe7esFQKgAehsoIoXcxSwlV0rBinbWj9hR9S/9O6OZhCVgkg2n6NYvDyid/1/yhCxqXE12UlNdq/AS7rM1yBYYNjLw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) by BN6PR07MB3458.namprd07.prod.outlook.com (10.161.153.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Wed, 25 Oct 2017 14:51:00 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, harry.van.haaren@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Wed, 25 Oct 2017 20:20:27 +0530 Message-Id: <1508943033-15574-1-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507712990-13064-1-git-send-email-pbhagavatula@caviumnetworks.com> References: <1507712990-13064-1-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MAXPR0101CA0009.INDPRD01.PROD.OUTLOOK.COM (10.174.62.19) To BN6PR07MB3458.namprd07.prod.outlook.com (10.161.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5981aa06-44a6-4b07-8c04-08d51bb7cfe3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:BN6PR07MB3458; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3458; 3:zSNHkTiobjqEiwU9V/zzigciVA6nXIbrb2VKKj5HiOq20cp3Jkv5ZfzwgJ24FAnvk+ievoFOQL+RgzGccIhkQWYyBao+EoEmhmWoRaVg6shp6jeFvOByPK+C8IY1/Wis5MwSDuu8kFGmVfs+nIQ6WN+qA0MF17NxPvFePUymxSI8tasp5FZoM2nMw7EM7MCqS8O6A3j/xS7cUsW3q+jFf7smaBsv5s51xHL4sV89WM5NZ4U2t1l3LzCvZO2hmatC; 25:t5O1L89FMjjadC5HjptU4bMM6l1zd/f02wdCpB5zCYaBSgAmXljvfMvxa437WvHUAnA5ML6MBJUKpWPTcGj7DrJf3PDpiJ6lusmDUj+97eeUydr7dFMSGWQtAzGcy9LN85JCyxSVIBcWB3400XHhsCF0ZItrPZ0WmgmEFb3lM2hxXLJ1tz08WOSPoVYW8Q4qUbiXj02AgaRTXelXy83LGrqP6MJwxm/YeALPLiNKJ6pejjxv1ZAAiF2cs8uTookL6GHFbnyXNHxJBXQt5mXNaKdUIxuCGEE9r4wqHiDLyIKoDK0r2sJyt1Pr9MzNakq/CKTBl28RzoXT3wvr6Kxsdg==; 31:vdqDnAQ//l3qyKaqFgqP7MZOHYPtqBxkTP1Y3crea0Zve0uAVS0zqNnSyXe7eaD55BOhjO91P8IjAwPl2WEtMx56KwDuMJ0z3qGSQlk8t9wFX653787Ut6E8IgmctH6KJKKeeNXyiXxU6yEGGK4bo70ulKs3j5l2NVxRdCP768Prskp5g3Eu2M5IjP8tgdTyXCbY1NAGLjBQUI1FYRftQ47YN2v/Te3aJl+fjl/P/fg= X-MS-TrafficTypeDiagnostic: BN6PR07MB3458: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3458; 20:uoZsOaCbDn/dQATF+DRlSpJqwXQBI8yjajXYFMniOSphJD67U45jjLjo/o9EHcRIo2cr5IJU9w8QSQwW2IYMFUaqKpVUfXoJhAyyzrycxZx09JG3Vu26H925c77XE/fAsi0vQfrSBP1//k9ZCHFFDv9EqiCmr+lcmezWUsrXyidfCmM9JxsWMhxWij/Cy1xXb8Ncl9G0qn+2pGebXdab+prs4tOjkNvU25mT3+A7QJtKwgzJkCVADKgIBlyLdWcv55B6YCfZsNW/2RhzM21XBqYh1JSTrlJHsyEKHdIHdEiED7o2XgjHXRk/nIH2xvZM0OJrFjq+ZyjDk0B5L043gtFI+kXCD10G/NgWViVy/l6s70tRAoqlPBqc6hu1QUGsJSEmRTzOSp6mQMlfU+kIp6U6uWlyxxads8z9WaLcwTnXugmwcjakyPIO5XIRfiXfsCs4vhyR0OjOlvGGsWjRQG5wDM4U7KnExhirsqFIdb/N8njS6X63JpL2znh30iP1R8kpeRUa/atkdie0uDNWictj1vHb+83y31229vKZ8kzV35FcwfZKbCgFXNCV90yGTn1EmpNbre/Et/siP4E854k15nJPHdEaC7xytmBuk2M=; 4:Ir2FPb7hVIp76yITd6X/IbzkgSHG4eG8DNfbuBqLctuvBEkXNIiuOxMzJv2m8MxSycYR2mM1Ib1XTi5qZr5/McnM5OMAi1L1dsyC8nx5+/1B4nEtTG+73e7n0a9W/d/P5DbyYyxhVzn88kZ9RoxP3jSedZOlcg2oET8EUVTtEKvdGtX4++C13DSoHsgHG0/eIEl6CdWuky0dm07QaK8BVcURMJWxmUySRHer/YPXZNDV3EK3i4MJb23YeCpksABcmnm1tUM3r6qZzrCo4/dVaEG4C/mWdsKclTL9VUcdnzQ= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(3231020)(10201501046)(100000703101)(100105400095)(93006095)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3458; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3458; X-Forefront-PRVS: 0471B73328 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(81166006)(53936002)(7736002)(50986999)(16526018)(50226002)(76176999)(4326008)(305945005)(66066001)(5003940100001)(8936002)(2906002)(25786009)(101416001)(42882006)(6666003)(107886003)(6512007)(8676002)(5660300001)(2950100002)(68736007)(81156014)(47776003)(50466002)(36756003)(5009440100003)(316002)(16586007)(33646002)(48376002)(105586002)(106356001)(53416004)(189998001)(6116002)(6506006)(97736004)(478600001)(3846002)(6486002)(72206003)(69596002)(8656006)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3458; H:PBHAGAVATULA-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; BN6PR07MB3458; 23:kfd3BWzk9piUsAPw25MeOcg/vPVt+eWlOxuu9kitf?= =?us-ascii?Q?sltZBwePnygbSxWar1Nq4MQ+WNfH8dAgBTEpPaILoFj8p/VurQOChiC4sCZp?= =?us-ascii?Q?d+/2++q9S/hF3rmtqnGdEN+0z/B/woRYEMOS3qhVyiG/KJFEpZrQMYLX6/um?= =?us-ascii?Q?sCJx6fdAuBAob+uKHUJ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U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2017 14:51:00.5121 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5981aa06-44a6-4b07-8c04-08d51bb7cfe3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3458 Subject: [dpdk-dev] [PATCH v5 1/7] eventdev: add API to get service id 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, 25 Oct 2017 14:51:05 -0000 In case of sw event device the scheduling can be done on a service core using the service registered at the time of probe. This patch adds a helper function to get the service id that can be used by the application to assign a lcore for the service to run on. Signed-off-by: Pavan Nikhilesh Acked-by: Harry van Haaren --- v3 changes: - removed stale slcore option from documentation - fix version map - remove schedule api from dpaa2 event dev driver v2 changes: - fix checkpatch issues - update eventdev versio map - fix --slcore option not removed in app/test-event-dev lib/librte_eventdev/rte_eventdev.c | 17 +++++++++++++++++ lib/librte_eventdev/rte_eventdev.h | 22 ++++++++++++++++++++++ lib/librte_eventdev/rte_eventdev_version.map | 1 + 3 files changed, 40 insertions(+) diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 250bfc8..ce6a5dc 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -963,6 +963,23 @@ rte_event_dequeue_timeout_ticks(uint8_t dev_id, uint64_t ns, } int +rte_event_dev_service_id_get(uint8_t dev_id, uint32_t *service_id) +{ + struct rte_eventdev *dev; + + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); + dev = &rte_eventdevs[dev_id]; + + if (service_id == NULL) + return -EINVAL; + + if (dev->data->service_inited) + *service_id = dev->data->service_id; + + return dev->data->service_inited ? 0 : -ESRCH; +} + +int rte_event_dev_dump(uint8_t dev_id, FILE *f) { struct rte_eventdev *dev; diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index b9d1b98..a7973a9 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -1103,6 +1103,10 @@ struct rte_eventdev_data { /**< Event device capabilities(RTE_EVENT_DEV_CAP_)*/ struct rte_event_dev_config dev_conf; /**< Configuration applied to device. */ + uint8_t service_inited; + /* Service initialization state */ + uint32_t service_id; + /* Service ID*/ RTE_STD_C11 uint8_t dev_started : 1; @@ -1606,6 +1610,24 @@ rte_event_port_links_get(uint8_t dev_id, uint8_t port_id, uint8_t queues[], uint8_t priorities[]); /** + * Retrieve the service ID of the event dev. If the adapter doesn't use + * a rte_service function, this function returns -ESRCH. + * + * @param dev_id + * The identifier of the device. + * + * @param [out] service_id + * A pointer to a uint32_t, to be filled in with the service id. + * + * @return + * - 0: Success + * - <0: Error code on failure, if the event dev doesn't use a rte_service + * function, this function returns -ESRCH. + */ +int +rte_event_dev_service_id_get(uint8_t dev_id, uint32_t *service_id); + +/** * Dump internal information about *dev_id* to the FILE* provided in *f*. * * @param dev_id diff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map index 800ca6e..108ae61 100644 --- a/lib/librte_eventdev/rte_eventdev_version.map +++ b/lib/librte_eventdev/rte_eventdev_version.map @@ -51,6 +51,7 @@ DPDK_17.11 { global: rte_event_dev_attr_get; + rte_event_dev_service_id_get; rte_event_port_attr_get; rte_event_queue_attr_get; -- 2.7.4