From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0086.outbound.protection.outlook.com [104.47.42.86]) by dpdk.org (Postfix) with ESMTP id 236451B75A for ; Fri, 13 Oct 2017 18:37:12 +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=Gzvw5u2FC0xmutJ2LTHv7mX43NeBWLYiI3MUpMj//wU=; b=YV8M89FynJB0wFk5QUtnxhlbg/L0Fe/tnuSHUv84WqvEA1FqRdFXSLtJs8o6HJHpetvNov2auIcb82GQJkrI0+MKbBx+bbBBMFDnUd/va6qE8cPtjtqG/2qSoU9VNBlee2+hWojukbW2OM9gzt2rJmpJ63TcTgZXPPa740DY4uM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-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.77.7; Fri, 13 Oct 2017 16:37:07 +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: Fri, 13 Oct 2017 22:06:44 +0530 Message-Id: <1507912610-14409-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: DM5PR05CA0054.namprd05.prod.outlook.com (10.174.188.171) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 594ac2b8-36d6-45f2-fabf-08d51258a645 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:u6yUoGPV87Tg81AF7sj4ZxCdxL1TYxDS6zILw0BEC7QCN/w3U3Qzle8yaT5bbjfUdov/w4vehUlUMUZCASTpk2aOVIOKJlPkUiVcAFzFNKUvR34ax2TjNJKt2Gb8Y+rJ9Ll8Gs42j7EsEuUfrFr+omsrAhfy85dPoMzSOd6mBj1DX1lnORaNCU9TV1OeMLmruaYNW9cXziBDMtbctlbVEeML1iTFhl8qRWHQxOSUeexRiO9Ihy4QrTRyghG11UMo; 25:0+00IdOpnZk6iEcGchnJ9TfwDl7czejw5Ohr6/7oZYWksRmyV6TBRd9M0Ye3onV25i/mizwyVTsspToV5OM7RBA1alM/qjE9angTuNFUJtu8+QdibJZQAmfLj+/0SZN8a1UdChR5CCPHCos4nBNagiGyIl9kKTs/v9lwUxSgPJGecmjSRjts34u2UPCo0pDVFMqYPS4BGbC3dQiId5mIsduol0lLxSC4DKufAkwCFp4+jKUUZa1/KbE+9uiTREZFe4Rf7TdE5Mvky+52H/VsS1uWIIUgEsGagq5b1RrZ+oVUVtIt2zLc9Pm3Is0M/a4/vc14LnSqh5aqoA3ckAalsQ==; 31:XaEteU1VOhQwPOF6EWQPcZWEJOtojtzotqsDvE3A8ipSBB5qnxnyiQ9PLWvvwtwth9Oi11qpuMARVtLHeAX9HOiDya1Jje0e/J5zY2Iie1tDZHMlDv08kRKe4OwQlcnx036vCnIDRGC7OYe+TEbaldk6Eg/yFcEooeJXzYXGL7TrxbAdWXyurCCAvvHpfwO2gurAvqThhspGSzgo4eD4fOfKdbn5wEIs9oZAHZCmU5o= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:hl5F54oFai1927DX92w+yEU03CjGkf/dL9A6SJr09hOD70C6Ur8aaBFIwVvjfxsmLYizdO09cWWuqCO67AE5tyFM1D1vaFdF971AZX8+rr4YChXpf7qADVZQrz/N8z1hx3lbHwF5N1WHTKR5Oc9CGSt6XXkw+UZKOivAbQB3aBw4m9dr8XGW5q9TQu+NQVaYo8RFy98WyRnb9tHoDTjOHk4lSpsvcMTwomc9d4Ve0ZWVby5EQ4PNbb2/l6HPwEniEzIaHNUerPcmDDSKRj8N09QqfHSyrPeRqCl3Ou4+pPLwguGNAFGsDRE7cOM7u0BqWTi0qXsc4FNWLO78qmfngkhezvIR4z0QKxL3zqlqubndy9GnubZm7h9R5jrz6GOcK8xXA+fFIEzV1N09jF+GbHiCLVf6bMzrqw0sruaSIEx22XBUsR1YAOpYiuyJgsVuNDYHPUxR8ztLCpmwIQJy+/IjLKMbq/JtA55AcLZnZbI3cx7gmsvYew3C5tbVo7U195BUrVPpr25eKhvyihiXfty+wrJrvjJkigF2AosAE3QDNtLfpleitTs5Gl+GuQDKj+e0MCNQjSYicM0+5vX+Nns9/fUHp65hZMYL+NCgUJ4=; 4:a6M+sUiTUNE9fJxntLZ4M75UVl+Jj1fjnRrsMR01K+ZXkE6Xw8SN3jRn+8ngb+8sx8M8EGq3jhmzqSPXKoryMAzFi7ZR7Sjx9IeYkWTinKrVxDadMkaE2I1y4SoLHV4d/bu2bLudRLIlpeu/MidA1G8yjLSV0EVKoi7Y8cQLXgl4Vk2lLBkGLBXCs7OFijwVCe0WmJNH/ZFwAZjNFnsWBmTaYC85d0SyDlehfauFSO+s9q26ETygQzb/NLngxOPn 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)(8121501046)(5005006)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 04599F3534 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(68736007)(5660300001)(53416004)(3846002)(6116002)(33646002)(6486002)(316002)(6506006)(5009440100003)(50466002)(72206003)(478600001)(4326008)(2906002)(2950100002)(25786009)(42882006)(107886003)(6666003)(36756003)(53936002)(5003940100001)(48376002)(69596002)(97736004)(105586002)(6512007)(16526018)(106356001)(50226002)(8676002)(50986999)(7736002)(189998001)(101416001)(16586007)(81156014)(8656003)(47776003)(81166006)(305945005)(8936002)(66066001)(76176999)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; 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; CY4PR07MB3464; 23:BylU1ux6AX4NQzEaAP1Dc95zCa1YhswDhpN/puYr4?= =?us-ascii?Q?OrGJP8eh/dp0gKSauLt0F7MOnEj8w+zZ6JXLD4OxwBA2yYsQQtDuK64Ckgio?= =?us-ascii?Q?whSAcPaqjf55nISPs0NNBbS9DGrxFtaQhmMcoC214DNIaI4tp60p1keBhfg3?= =?us-ascii?Q?wACnlgBuiaTBkesyHd5B59Wbm7Gqsn9v6w0q/gm7xn/iRb//fR2dRojnlO54?= =?us-ascii?Q?abGy+o5oLXvg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SPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2017 16:37:07.9885 (UTC) 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 v2 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: Fri, 13 Oct 2017 16:37:12 -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 --- 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 d555b19..59c36a0 100644 --- a/lib/librte_eventdev/rte_eventdev_version.map +++ b/lib/librte_eventdev/rte_eventdev_version.map @@ -53,6 +53,7 @@ DPDK_17.11 { rte_event_dev_attr_get; rte_event_port_attr_get; rte_event_queue_attr_get; + rte_event_dev_service_id_get; rte_event_eth_rx_adapter_create; rte_event_eth_rx_adapter_free; -- 2.7.4