From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0077.outbound.protection.outlook.com [104.47.37.77]) by dpdk.org (Postfix) with ESMTP id 8696B1B300 for ; Sun, 22 Oct 2017 11:16:49 +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=BIexRug0KicMSzVYyixwiikh6xR4O08S4tn3+Sqmr2c=; b=OnkgnS7915pofvCe8rCH9WCf8XankrOyjAIjAsEuYrk0uShWoF+YPERkDCxN7TSvuEoWJttTa4ctifDq5SkerVckr5PdmAli3jy8V7Td9Ij+D+G7P1v2GxVCmAQkSgxx84kY6RJKCtkUlcBuO/8HeaF9PZ5DGG2AsGwDFNtukeg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (103.16.71.47) by BN6PR07MB3460.namprd07.prod.outlook.com (10.161.153.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Sun, 22 Oct 2017 09:16:45 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, harry.van.haaren@intel.com Cc: dev@dpdk.org, Pavan Bhagavatula Date: Sun, 22 Oct 2017 14:46:19 +0530 Message-Id: <1508663785-15288-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: [103.16.71.47] X-ClientProxiedBy: HK2PR04CA0083.apcprd04.prod.outlook.com (10.170.154.155) To BN6PR07MB3460.namprd07.prod.outlook.com (10.161.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b170ea1-6558-41ed-9034-08d5192d9f14 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:BN6PR07MB3460; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3460; 3:r4J9el7g/S3u9pgkm4NK5wYdLU2wmF9RgpMakFHL+ia9wVz6tomyRFLK9dPwFCyn8CC3AO1ScznqriyJxXCL3Kcs3mU50wEMoImUxwCs7dPaWjq6pI9rGhE24KQg44iYpFd9QT4lgHhO+OPaZi8CWV/5GBKkRSRvS9bfXyMN3n8zr/QfprWdOlJsGDArpF4WgfbbMKnrHNEIvy/omBNid58Yg9wOMw4A7xFzPoWXYz4cgM4YqLcv0s/A9xctAslH; 25:vFAlVwESxnny95wbIYxhqKpoUMdCbxAcD9cawMlzgBBUjx2mjgAcGowyHlugGX2sOKUlgsqKb9DU4ezWNnWfuG9nBLarTxh7EzrYGMoIRDuJG1JVnmWOeWajS2i4SBQzpc10PMh/w3QWEJD45zcwd35bHxcuUimJwK6pmphBnP3WOv877fdMnZjsNLFRwSv9Va08LK+UEkK4DIdFbRpumBMJX42woUC7+avQ18l6xUOD+Q4sVFmfzGlfoiOW32mkwIA4jcrWYiXgePTVJXWFadY94WtglSSJiiqY9pj6rjRrb7UyMoz/1AWrQ1pYq8c7PNomgOXpI42gx+hmZoxxgw==; 31:NoItmkLlrkWvUNyAroS/s7PsJkJPwDn5dprnpKMN91uP3whgoyGA+6grg0qYaS1KdoMC3KUpO6RIcvO6vBlubE2aMXhx7WT57KjEQpKqdTPH1MS4OfNOCzzF2WRzfd/E0jHbCSemnPCkecKteT6sDsy7yz6Txe68QoNNfyuZ9otJnlLV2JQfB28rj0tIoAothyKE8CPCRvSvZpcqduzemdKcGyfpIA8MRI7b+T1TiiQ= X-MS-TrafficTypeDiagnostic: BN6PR07MB3460: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3460; 20:KgppxeM9WEBmgDZnvY9ITRp8Ve7eupOi09xnumcockcfV6YBIIVJz0K4TbTbRhqfyWa+ZBIvAGw/6zELg0Iw5d9FCz3s1GDBpVqm2eIN1WEj+P9v2WOTtcvmBH/vpx5cGNCiGXCP8LLwHJVAL0AqPE+KezGN8SGAP0t/v7FuicX/WYZgBZ0mlXdaCISdhNAVF7gK4jVU5HiAvJp7oo2ruz+E9UTEpIZlmWRtlhXhr0K6qZ3gpsx0yxPOogALlKLwdtBVtVLuSI/OAUEaURcVLZdqV8faCSXo3I7FLceOSoT4AXgm/VcDi5b4TQYTBJ2jOAXLUj4WO/uMc5RipD940+6ma9bCFRcKn16Pkeh8fX51kENudO5O5zMMvouH/ZXdxwndihNauI0ZAjJoh0ht42owTqEvCngBpXnpJ8LZLPs8noJDvSlPCN78Ps75PjRY2Lw+fta35gdXwry+u3PsWNDN09XiIz1UQM3Yg0kXZcI9cjArGv2JFfNTUal4/IQjM2sHFBvY/F9+U16cFHWk0dZ1gq/JG9UIa8ib5OQDWT6QypJcsoGzHhA6PVZnZjxrzlxQILUGE4qzwwMik3JjnzAsom5IlNI7WSooluKvKQY=; 4:HaxHB/skPp5qiLc0iV2Awwc0Lh5MHoP9VKd4tgw3zF58Q74J9CVWRkbFoVp1emzlL/ECvoaxX6C+ZXcmDswzWmIPxYdenEzpbeOBMQ6LiPO/80/Xt7SUNJtQOguD5hzrGsH/RjdqAZcn5Ud/SnTSCGDGDWnoP3fSuOmnz770LzA09tL5+pIlA/N0F9wfnMWk5TCz7gb4G5j7QeQEvZKfwRDZ9dRQ7F0igDs9sFvZkAsPeO8QQlO8O48HQf/bSzNx0zYAB/je226XlKUkGnVTAVdHa97ev0Q3CuxHVX32ujk= 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)(8121501046)(5005006)(93006095)(100000703101)(100105400095)(3002001)(10201501046)(3231020)(6041248)(20161123558100)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3460; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3460; X-Forefront-PRVS: 0468FE4A2B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(346002)(376002)(189002)(199003)(72206003)(478600001)(8936002)(3846002)(6116002)(6506006)(6486002)(7736002)(66066001)(50226002)(97736004)(101416001)(6666003)(2906002)(8656005)(305945005)(189998001)(8656005)(5660300001)(16526018)(76176999)(50986999)(33646002)(47776003)(105586002)(81166006)(81156014)(106356001)(2950100002)(42882006)(68736007)(4326008)(107886003)(316002)(16586007)(50466002)(48376002)(5003940100001)(25786009)(36756003)(53936002)(6512007)(8676002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3460; 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; BN6PR07MB3460; 23:B28EM72JrDCTniRz06dBi06sKM/5nMZzZsVu9QfUQ?= =?us-ascii?Q?b/TONlRRx/fvByJht16+GSK4LlaaDzkCx6sdashMBt9lekhGjgxE700xbK32?= =?us-ascii?Q?4G3Gcy8tBG+JZleMH4kyELGA6s+urtzMpS0aTYkRUYXJ+aVWfKyQriMox0Jq?= =?us-ascii?Q?Shx0awRN7w2birRK8PG3ZHRpnz5UhIFvji4brXwo3KDXAxuwRvRXhgH975pv?= =?us-ascii?Q?nA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6bt99mgR/NAxucF+a9t6?= =?us-ascii?Q?8+jd9s1P1TC4liUC1yT3oxhmfz0BGz4GHKzBfJ1kqzgVSyn8Aw9HQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3460; 6:Q8U8vl2/BjQ4IkEZIEM8hqr2Ud05Pr+URAmbhI9y140PwzXgq1t8q+EFZylyng73biqTu3VX2ntixhJOAWWPdOPiwV2OzLWnlTabTgp+dksqy0nZibnx4CYe9bvygTj7OiSgT6P8JbIaamSd/hs91aJRKotaBZr10cRUZsZKAxPrcp++OpwYmUqB1alXYfJIcXK/n3FflFdgYNskDO2/kEFaPl39u+VBpPcyNnvnpPCxcH3c6lk780KUy1DVyfdS7XJUzC8pwOW4xs8LmLLqboMmEIlmUWucmTyQMGlvlnehRNITcz3raOwRFwsG96kuEe0afo3IMz9j9cVEYx1Txw==; 5:b4vT1gldXk2PDaeKw66qPwuGudW3sOm8hM2n62UxzJ/4OuxOdm+vZxAuU9RxwyKn0BHKPL8hoEcWoiBUywDxypL27CQkD+bwN5+Wh20n6/McINxhcOHePpS73pPF5D4e9eDdUic1vRzzvVoCtpNBCw==; 24:cbD8KL4gTpw7q/bzieDMwbKnb3TLGpI55krhHa9CCiELqCdsMiY6V8137RiKbeate4NWT4Yc0f13Uxc61bQMe6PfulK5AXY7z1W0724Fzlo=; 7:CsZJ/hCZqkQ9RJmjVFPt3tUXhwuqrw+w83uYSDcRC+PtpSlMTnSrZf7riqlPheJrYNN+5qgOUKWZ2SIiogN5h2it1qTxcZXki8JN4ZD4ZWZb9mP0mU8+ti0vbN+VDu8pjHgLJ1tcoGJzc/9v1SuTnlJ/AVA6KboHFpV4WmX02OiD6LMTSdSSCb0W21wkGzHNWh9Ywuc5XcsLhu7sg3GBvU9kEu5tOS5PdZRjLEg6J1o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2017 09:16:45.4554 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b170ea1-6558-41ed-9034-08d5192d9f14 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3460 Subject: [dpdk-dev] [PATCH v3 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: Sun, 22 Oct 2017 09:16:50 -0000 From: Pavan Bhagavatula 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 378ccb5..f179aa4 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -961,6 +961,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 1dbc872..1c1ff6b 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -1116,6 +1116,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; @@ -1619,6 +1623,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