From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0071.outbound.protection.outlook.com [104.47.42.71]) by dpdk.org (Postfix) with ESMTP id E6AA11B781 for ; Wed, 25 Oct 2017 13:59:46 +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=ZaHv2pRKPNcZ5bv+1HGVax7hN6Z767l9DXkyTetdHtg=; b=MGg4qxxd9OjDTMN4zzVI4ZdY9dom02KR9SuZaeXm1Helkg3+CD2KVcuRrQIfdiOk3yrHq1NiKpSmzP+HMgIqmaZ5mDavMiwLkDWP0nFrO/NLqHBOs6XTqVNRTFW20oqzmdouiu+umjVlRMDS/6vUX4dOI70LILJqu8oAy187PNw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3462.namprd07.prod.outlook.com (10.171.252.143) 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 11:59:43 +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: Wed, 25 Oct 2017 17:29:06 +0530 Message-Id: <1508932752-22964-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: MAXPR0101CA0060.INDPRD01.PROD.OUTLOOK.COM (10.174.63.22) To CY4PR07MB3462.namprd07.prod.outlook.com (10.171.252.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f618e5b-eb69-401c-e9f6-08d51b9fe22f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603238); SRVR:CY4PR07MB3462; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 3:JSnO4z2gjf46Ep1uCT331cXUrpD38Vb+c23iSvIYNL2+t9VPJ0J5vQXWdFd33x7xs0LzX2s4azV+QOJY/9ppSZ/XfbRHVE3sAvvIpJX61N0Zxs1oUNqUhZE12y8KFs74aVIks1u4vtnjKUftORUfayi5kUvSvwAWzjQOAc9ciqXvRuBL+LoMGsQDfvIkBcTxRXINrmXqZ27JeKofRGezpt+Ciu4I2ZikPac3I9BJY3jIVu0IjQmlJ5FG2hBpm2K4; 25:NU81bitSRZnG5PTAOQ1ZvuCeWIwPb68Qwdd7y865OTv8OdK2V2mFfw0qJ11f6SjTaMz1/EG/2epBJ5/cSS0TruZXIl9/z3xm92iXlVnuW34g+vIrVQxkywGXfUg1GtISCcdknU8b5GA87p+mA8fHRgY7qbpODkqcUJMTbLzcy4LWsBj5GK5CcYh+IfcxUP3HrWcn5hi7wtiZknw4IcvrDtcaMpAkd2lg+0f5ZULuZKxj4E+g3pG4AkZPyRX1vHO3FDNbcsEVJJlAyjKNM1QlwHWPbHSVpV6QYFa2bnV2zu8Zk1rbUDUId22ZyIljyJrYMULEvVcFpPCA1HEPISLPAw==; 31:Z+6Hw+sfFRxGrsD9u1U2YBOmeznq4tQTBi5Oh4GdCC4JZwawAl/2KRxpH+GHayzElDNO0qhQScIRJjZgxHEKEfKrOozbSyhx2bynsnPKhSZJvKqU+1a/Z5t5TvvTR2Hau+49VFYHymQ3qhbzRDYVYlESmd09DXQMx6PMlWltUgrdNMKx3yMFr6/ov/NoZkMJ8G4zx6ijfMvZsey9BCk7zvpJovBdWlrp2GlpspviRZY= X-MS-TrafficTypeDiagnostic: CY4PR07MB3462: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 20:mwPb5ViSeZdT/BlYaQ14Sx1jbzL3HMmKh51zcuw09jr6j/JbRbEVAwxzRZip0eKzZdyHAUXhFyAoaTpGVm5OQxQD3l6zyPxRKdjc0MT05uaYXSsCD05aHxw/opZ+iYJLb+bUTFQk8gVdL++3uk5zq0d+7Y4Q3zYjo2keVFtyHx7ELsx0AGVMP0cfDDcsbJCKr7k4UrZfgk4cxP8yK7ShkuSDZf/YmkJMkfH49huwP71kdvfOhmQVdU68sLgLG1s53EPT8fvPbmcdIaceoMt3e1w2HroB4MLujuaOJiROUDc7pYGlk8vBhj6q+1pSnfo70j7sYXr4VzQykpDhSKwLHIiFqWb1gEDpRxO2w+lpXZkCRGUKgTigXMkeIZbmawzIsK2Wjp8jyifNsREGi/jv9bIGRYQk+aArafn/1/AMl44xJKCmHSJhCyWwy5FdP2gotwhORSBXMn1256g8AszkWl1/WU+IsenFa5fMvu5RD4n9TF6Hxbw3EElTpF8w/3vaHkD+fYMpNXFsvui8dddA153A+Nze6ogFXP8nN9TBAFHQJ7RQTiRDOR7bKCZ4cXpL6ax3bBoOwr1i46M10mYWXFSv1b3kybdmNwfe6vfPYvk=; 4:yZxNSKtHX8jL7Yxf7mUh2BWuh4+q4YKFYsSJCCqgl1mPUkjSg49pcVx6EbR/FsPvgoRvPT91X8cg2bWUj8u5RLskzGpdgeg6p78KdOfQKD+2Cz/Fb/V9ELFM8HAS+H2kha/Tk5E7nwhJMChWDuHvA7di9059yH74Z8lz8D+ANZovb2G7QbVkqY3zn48ddKr+Rs4VG4jxS60KXnYCyiXxSMPdix0He8YOoRAf1aKbpEP6GBn2gMJ4JZZRSriWhSRTLy6GI4W+SHu/DSdO5kqsHfDZjGK/2T2n9yn2Zq5lNRw= 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)(100000703101)(100105400095)(3231020)(93006095)(10201501046)(3002001)(6041248)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3462; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3462; X-Forefront-PRVS: 0471B73328 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(199003)(189002)(4326008)(106356001)(42882006)(8676002)(8936002)(97736004)(68736007)(50226002)(7736002)(305945005)(5003940100001)(5009440100003)(48376002)(189998001)(16526018)(6506006)(2906002)(6666003)(6486002)(5660300001)(6116002)(50466002)(76176999)(101416001)(316002)(16586007)(2950100002)(81156014)(25786009)(50986999)(53416004)(36756003)(478600001)(105586002)(69596002)(3846002)(66066001)(33646002)(47776003)(6306002)(53376002)(53936002)(966005)(81166006)(72206003)(107886003)(6512007)(8656006)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3462; H:PBHAGAVATULA-LT.caveonetworks.com; 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; CY4PR07MB3462; 23:YpPSaV5RZYSUiWjcq1rlkpBTBJFxp5HF7HoLRz1da?= =?us-ascii?Q?wHtR6kj1YPvEuYsoibq6K2kzrtPRczgnhzOisgc03gHz7GxTMBBCanP13Vsd?= =?us-ascii?Q?gfOiDbOSU0bzSOk81bOtQ5mSKzst6dc+jgPnyX/i2IQspDn4dBG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RZDhWmCnZ+Vx+v2Q6iW9rM5TtVCmCmEOcaaYkcW3otzsuJJf5LmfQDwFdoIN6N6Koe6qjZue47jxjpQf1AjQZdP0TAY0lSdngIbuct/YJH4/E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2017 11:59:43.4771 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f618e5b-eb69-401c-e9f6-08d51b9fe22f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3462 Subject: [dpdk-dev] [PATCH v4 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 11:59:47 -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 This patch series depends on http://dpdk.org/dev/patchwork/patch/30734/ and http://dpdk.org/dev/patchwork/patch/30732/ 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 fa18422..df01f4b 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