From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0063.outbound.protection.outlook.com [104.47.42.63]) by dpdk.org (Postfix) with ESMTP id B62041AF03 for ; Wed, 11 Oct 2017 11:10:50 +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=2t9pa57/6BQlfHb9V99e5cADDh7Q7+8p5frlHl4f9lM=; b=OMvrzKDGic7DkwNvganit/N6C/ZpttffXGgwD2HDwUQ0EgdCU9k7HmO4fy4kkERg8VTKv7PQqq1C9yTF2QHBDmkXw8iwo4PeJA+52pfHI23Tq/Xc6JsMReTKPccV3/xq1CAw2Kw2dWyBLLxB8KEc01cohxIIleBzthqCF2KJ/0E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) by BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 11 Oct 2017 09:10:42 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, santosh.shukla@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Wed, 11 Oct 2017 14:39:44 +0530 Message-Id: <1507712990-13064-2-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: BMXPR01CA0014.INDPRD01.PROD.OUTLOOK.COM (10.174.214.152) To BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 770a09df-448f-4505-5cc1-08d51087f46f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR07MB3457; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 3:gtk+UxoUIvFqavFucnmsTf/6pOOKmY54P0er4LUUYoU1Uq9AFtn62sSO2YpazfDL5DA2bdB73PDcuTrsNQ9ZdOJG/pGaFw4vFrXY05XLISTFLayB0DGNXi4w7awBSqewVvS1MA0BJxO7pWojwmXt0R2cmGc48uBveH10mxTg5DpMRjqLOuodB6zM46wDPR4ZktF3plA6MR1tSm2Ff1Vi4FT3aRHpB0gwkMfyrL8D+hRFNH5fTX5uqz2uRU1wQjFc; 25:tBqJV0sggCqfFEXqYEVlJE+94MkOYLIOyDZQuWhtAbgL2wf+P+hKxjeUl/2DQZaGhYiPTL8EB7HVK6M/eAU34pSdxjMaaByxwPs2JW/rgs0R9KqxexCddyBmhoWvWkuRs9m4jnZatZfEuqfPU0C0T1ANmq+GMuJhYlIj4VuACL1APUZ5T4O/JRHD8liaox0N5sbJc3rcip2N9kfiZLQhMQsoW2o5ezhY2CS5Kgh2VrCW8/iGXuEOLEH2CDHWTlELhiZEbhtV8/HgaAUpPuB9esFMRh4NFOOd/EmCNuAPYmC9dzeSRrvhTUlSdc7+5Ebo5xg3cS/vc8OL47qGicmrNQ==; 31:rd0swVSKgoMsPp1c8ssLX+IgnqkukFRcy+Fu7AuHOAO501heN+b6GQMATIDfg3S46KOzaScAmNwKhXjRswE4pt40ppbsvkQRECD0gE4DzWBwp2olgkZ0jhuwLo6EZdCrACvjD3mnp683JcAlWrQqE++mTZ6MiFPUCKA7xVgpHldwQkkl/Y8YBy2armTkkElYKBbVpOshaQnjBzpQ83rn6rTkNB0b3qMBdQSZWa+HFJs= X-MS-TrafficTypeDiagnostic: BN6PR07MB3457: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 20:V0OZHnbxYQJC0fLhRmbj6pZnOnCzY6fuv08EXmYnsIeUkErh5r1iKGgohflRwEr8AwlhT5wxHZ97zYVUjyYXquEgqkwBo1n6HXZH13gGrQqPOXuGt4hKLyNEn/zjje22vPNe4xDvMuxe0QhdmdACtTXaeD/gNcoUk9RlK2qHeCT58pHjYVyuFm+EDUmB+d5F4VU3xfPZ3HVtFeefqbJVoaBlkwnaVRcwXzQZH+loD6CnsqwjUdGn7gmL7Gd9JZqip7HzilOud60QuPqwAMhaKe2wJdprbyrM+y7+dP2gi2ScIFdEEvNsidsCS9ZTJrqv0mC/JYiXEvUwgPK29o+lUtBEo0tMyUBKwUGP8auWN0m+Q28jKyDJiTM6OlS3zUWUPrG4kCBfXZZHRo/R1kDN7zZjSxGrTOKaP5lWNi4aY18o5O/xg9LsZxEy7yKzz6Mqj3lf1P95xUb+nGTRQpQUR2QXRkK/haYdqw1cI6OlLV3gn6YryRftdq47+6JGHK1xi3B6YarXt6ufVBHDMXWN7Da2AVidbiIvyiUp5Qa61WFu4j1fKj2S/obh197UGNwMwbAUUD+KyA0HRBS5UXGhQCZkIw3CgqvigwQ3Qql9vp8=; 4:uEI04y7ck7txTsO6P6+ewF/yUFh1BkRP4wBBCA48xAnAX+pbmb0GD+QVPqeXWgyPzw7xAzaEI0vEwErnIcfvaqJ3uwtvV7A5ag5gjcisK422gYck+jKFjXz9Ch4yZdDuuINrtXPAu6bwIIy8VgN+/SJw2HrrtzljLIgaDZXYiC5EK3Wa35mwrI/EkNk2NkgiHASEcdFb0vNm5dNdwNLMQbS8pCGdbP/yisChhUmJFXnRQfBDWPGOhWuTl9H+aPqy X-Exchange-Antispam-Report-Test: UriScan:; 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)(10201501046)(93006095)(3002001)(6041248)(20161123558100)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3457; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3457; X-Forefront-PRVS: 0457F11EAF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(2906002)(50986999)(6116002)(68736007)(5009440100003)(6506006)(6486002)(76176999)(3846002)(4326008)(72206003)(33646002)(478600001)(16586007)(189998001)(316002)(48376002)(16526018)(6636002)(25786009)(105586002)(5660300001)(50466002)(66066001)(42882006)(36756003)(47776003)(53416004)(97736004)(53936002)(5003940100001)(8936002)(81166006)(101416001)(106356001)(50226002)(81156014)(107886003)(6512007)(8656003)(8676002)(305945005)(7736002)(69596002)(2950100002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3457; 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; BN6PR07MB3457; 23:mDbIhi3oOJKNux7wyy70fxxTKULIivH1zsxq3MOR9?= =?us-ascii?Q?pp6+bAR5VABjqFgjWVdNfJd9vsjAPAd1jqJrKolMB3GeyZliOLXsR+Ss+w3i?= =?us-ascii?Q?poZMKSLtzF7QuAGxZE7B+IUdrkUGt8iPUS0La5MyRSxA2nWLdOTRm/hnCmEw?= =?us-ascii?Q?u4ZsCQoeUdEuSrvmmSfwAql89wkw/oX6YXJUIQaSy37ynf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ticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2017 09:10:42.8017 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3457 Subject: [dpdk-dev] [PATCH 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, 11 Oct 2017 09:10:51 -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 --- lib/librte_eventdev/rte_eventdev.c | 17 +++++++++++++++++ lib/librte_eventdev/rte_eventdev.h | 22 ++++++++++++++++++++++ 2 files changed, 39 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 -- 2.7.4